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

Side by Side Diff: ash/wm/visibility_controller_unittest.cc

Issue 11316245: Move VisibilityController to corewm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 | « ash/wm/visibility_controller.cc ('k') | ash/wm/window_properties.h » ('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 (c) 2012 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 "ash/wm/visibility_controller.h"
6
7 #include "ash/test/ash_test_base.h"
8 #include "ui/aura/test/test_window_delegate.h"
9 #include "ui/aura/test/test_windows.h"
10 #include "ui/aura/window.h"
11 #include "ui/compositor/layer.h"
12 #include "ui/compositor/layer_animator.h"
13
14 namespace ash {
15 namespace internal {
16
17 typedef test::AshTestBase VisibilityControllerTest;
18
19 // Hiding a window in an animatable container should not hide the window's layer
20 // immediately.
21 TEST_F(VisibilityControllerTest, AnimateHideDoesntHideWindowLayer) {
22 // We cannot disable animations for this test.
23 ui::LayerAnimator::set_disable_animations_for_test(false);
24
25 scoped_ptr<aura::Window> container(CreateTestWindowInShellWithId(-1));
26 SetChildWindowVisibilityChangesAnimated(container.get());
27
28 aura::test::TestWindowDelegate d;
29 scoped_ptr<aura::Window> animatable(
30 aura::test::CreateTestWindowWithDelegate(
31 &d, -2, gfx::Rect(0, 0, 50, 50), container.get()));
32 scoped_ptr<aura::Window> non_animatable(
33 aura::test::CreateTestWindowWithDelegateAndType(
34 &d, aura::client::WINDOW_TYPE_CONTROL, -3, gfx::Rect(51, 51, 50, 50),
35 container.get()));
36 EXPECT_TRUE(animatable->IsVisible());
37 EXPECT_TRUE(animatable->layer()->visible());
38 animatable->Hide();
39 EXPECT_FALSE(animatable->IsVisible());
40 EXPECT_TRUE(animatable->layer()->visible());
41
42 EXPECT_TRUE(non_animatable->IsVisible());
43 EXPECT_TRUE(non_animatable->layer()->visible());
44 non_animatable->Hide();
45 EXPECT_FALSE(non_animatable->IsVisible());
46 EXPECT_FALSE(non_animatable->layer()->visible());
47 }
48
49 } // namespace internal
50 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/visibility_controller.cc ('k') | ash/wm/window_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698