Added llvm into exceptions as we can't add README.chromium into 3rd party repository
[chromium-blink-merge.git] / ui / compositor / layer_owner_unittest.cc
blob6390ecaf4633f026c409573114a6defb216f003e
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/compositor/layer_owner.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/compositor/layer.h"
9 #include "ui/compositor/layer_animator.h"
10 #include "ui/compositor/scoped_layer_animation_settings.h"
12 namespace ui {
14 TEST(LayerOwnerTest, RecreateLayerHonorsTargetVisibilityAndOpacity) {
15 LayerOwner owner;
16 Layer* layer = new Layer;
17 layer->SetVisible(true);
18 layer->SetOpacity(1.0f);
20 owner.SetLayer(layer);
22 ScopedLayerAnimationSettings settings(layer->GetAnimator());
23 layer->SetVisible(false);
24 layer->SetOpacity(0.0f);
25 EXPECT_TRUE(layer->visible());
26 EXPECT_EQ(1.0f, layer->opacity());
28 scoped_ptr<Layer> old_layer(owner.RecreateLayer());
29 EXPECT_FALSE(owner.layer()->visible());
30 EXPECT_EQ(0.0f, owner.layer()->opacity());
33 } // namespace ui