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

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

Issue 196063002: Move wm/core to wm namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | « ash/wm/window_animations.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_animations.h" 5 #include "ash/wm/window_animations.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "ash/wm/workspace_controller.h" 10 #include "ash/wm/workspace_controller.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 DISALLOW_COPY_AND_ASSIGN(MinimizeAnimationObserver); 65 DISALLOW_COPY_AND_ASSIGN(MinimizeAnimationObserver);
66 }; 66 };
67 67
68 TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { 68 TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) {
69 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); 69 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
70 window->Show(); 70 window->Show();
71 EXPECT_TRUE(window->layer()->visible()); 71 EXPECT_TRUE(window->layer()->visible());
72 72
73 // Hiding. 73 // Hiding.
74 views::corewm::SetWindowVisibilityAnimationType( 74 ::wm::SetWindowVisibilityAnimationType(
75 window.get(), 75 window.get(),
76 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); 76 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE);
77 AnimateOnChildWindowVisibilityChanged(window.get(), false); 77 AnimateOnChildWindowVisibilityChanged(window.get(), false);
78 EXPECT_EQ(0.0f, window->layer()->GetTargetOpacity()); 78 EXPECT_EQ(0.0f, window->layer()->GetTargetOpacity());
79 EXPECT_FALSE(window->layer()->GetTargetVisibility()); 79 EXPECT_FALSE(window->layer()->GetTargetVisibility());
80 EXPECT_FALSE(window->layer()->visible()); 80 EXPECT_FALSE(window->layer()->visible());
81 81
82 // Showing. 82 // Showing.
83 views::corewm::SetWindowVisibilityAnimationType( 83 ::wm::SetWindowVisibilityAnimationType(
84 window.get(), 84 window.get(),
85 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); 85 WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE);
86 AnimateOnChildWindowVisibilityChanged(window.get(), true); 86 AnimateOnChildWindowVisibilityChanged(window.get(), true);
87 EXPECT_EQ(0.0f, window->layer()->GetTargetBrightness()); 87 EXPECT_EQ(0.0f, window->layer()->GetTargetBrightness());
88 EXPECT_EQ(0.0f, window->layer()->GetTargetGrayscale()); 88 EXPECT_EQ(0.0f, window->layer()->GetTargetGrayscale());
89 EXPECT_TRUE(window->layer()->visible()); 89 EXPECT_TRUE(window->layer()->visible());
90 90
91 // Stays shown. 91 // Stays shown.
92 gfx::AnimationContainerElement* element = 92 gfx::AnimationContainerElement* element =
93 static_cast<gfx::AnimationContainerElement*>( 93 static_cast<gfx::AnimationContainerElement*>(
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 EXPECT_TRUE(layer->GetAnimator()->is_animating()); 237 EXPECT_TRUE(layer->GetAnimator()->is_animating());
238 // Expect default duration (200ms for stock ash minimizing animation). 238 // Expect default duration (200ms for stock ash minimizing animation).
239 EXPECT_EQ(default_duration.InMilliseconds(), 239 EXPECT_EQ(default_duration.InMilliseconds(),
240 layer->GetAnimator()->GetTransitionDuration().InMilliseconds()); 240 layer->GetAnimator()->GetTransitionDuration().InMilliseconds());
241 window->Show(); 241 window->Show();
242 layer->GetAnimator()->StopAnimating(); 242 layer->GetAnimator()->StopAnimating();
243 } 243 }
244 } 244 }
245 245
246 } // namespace ash 246 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_animations.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698