Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: ui/compositor/layer_owner_unittest.cc

Issue 231193002: Makes recreating a layer inherit target visibility and opacity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer_owner.cc ('k') | ui/wm/core/window_animations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ui/compositor/layer_owner.h"
6
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"
11
12 namespace ui {
13
14 TEST(LayerOwnerTest, RecreateLayerHonorsTargetVisibilityAndOpacity) {
15 LayerOwner owner;
16 Layer* layer = new Layer;
17 layer->SetVisible(true);
18 layer->SetOpacity(1.0f);
19
20 owner.SetLayer(layer);
21
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());
27
28 scoped_ptr<Layer> old_layer(owner.RecreateLayer());
29 EXPECT_FALSE(owner.layer()->visible());
30 EXPECT_EQ(0.0f, owner.layer()->opacity());
31 }
32
33 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_owner.cc ('k') | ui/wm/core/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698