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

Unified Diff: ash/wm/window_animations_unittest.cc

Issue 10800020: Add brightness/grayscale animations and use them for OOBE boot transition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix hide animation Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_animations.cc ('k') | chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « ash/wm/window_animations.cc ('k') | chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698