Index: ash/wm/window_animations_unittest.cc |
diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc |
index 8e453dca329187e542e01083feeb4de9b31582d5..7768b18ed72335587b22fd3f33bf3f388e896cfe 100644 |
--- a/ash/wm/window_animations_unittest.cc |
+++ b/ash/wm/window_animations_unittest.cc |
@@ -97,6 +97,47 @@ TEST_F(WindowAnimationsTest, ShowHide) { |
EXPECT_FALSE(window->layer()->visible()); |
} |
+TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { |
+ aura::Window* default_container = |
+ ash::Shell::GetContainer( |
+ Shell::GetPrimaryRootWindow(), |
+ internal::kShellWindowId_DefaultContainer); |
+ scoped_ptr<aura::Window> window( |
+ aura::test::CreateTestWindowWithId(0, default_container)); |
+ window->Show(); |
+ EXPECT_TRUE(window->layer()->visible()); |
+ |
+ // Hiding. |
+ SetWindowVisibilityAnimationType( |
+ window.get(), |
+ WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); |
+ ash::internal::AnimateOnChildWindowVisibilityChanged( |
+ window.get(), false); |
+ EXPECT_EQ(0.0f, window->layer()->GetTargetOpacity()); |
+ EXPECT_FALSE(window->layer()->GetTargetVisibility()); |
+ EXPECT_FALSE(window->layer()->visible()); |
+ |
+ // Showing. |
+ SetWindowVisibilityAnimationType( |
+ window.get(), |
+ WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); |
+ ash::internal::AnimateOnChildWindowVisibilityChanged( |
+ window.get(), true); |
+ EXPECT_EQ(0.0f, window->layer()->GetTargetBrightness()); |
+ EXPECT_EQ(0.0f, window->layer()->GetTargetGrayscale()); |
+ EXPECT_TRUE(window->layer()->visible()); |
+ |
+ // Stays shown. |
+ ui::AnimationContainerElement* element = |
+ static_cast<ui::AnimationContainerElement*>( |
+ window->layer()->GetAnimator()); |
+ element->Step(base::TimeTicks::Now() + |
+ base::TimeDelta::FromSeconds(5)); |
+ EXPECT_EQ(0.0f, window->layer()->GetTargetBrightness()); |
+ EXPECT_EQ(0.0f, window->layer()->GetTargetGrayscale()); |
+ EXPECT_TRUE(window->layer()->visible()); |
+} |
+ |
TEST_F(WindowAnimationsTest, LayerTargetVisibility) { |
aura::Window* default_container = |
ash::Shell::GetContainer( |