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

Unified Diff: ash/wm/window_animations_unittest.cc

Issue 11201002: Removes worskpace 1 code. Will rename next. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove constants and add back kDisableLoginAnimations Created 8 years, 2 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') | ash/wm/window_cycle_controller.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 ee6a1c9b80c0c6e8b06c2b7758e5a540ce417cc5..eebed144f0712b34d276629b9d4ce2e7e1638906 100644
--- a/ash/wm/window_animations_unittest.cc
+++ b/ash/wm/window_animations_unittest.cc
@@ -33,74 +33,6 @@ class WindowAnimationsTest : public ash::test::AshTestBase {
DISALLOW_COPY_AND_ASSIGN(WindowAnimationsTest);
};
-TEST_F(WindowAnimationsTest, HideShow) {
- scoped_ptr<aura::Window> window(
- aura::test::CreateTestWindowWithId(0, NULL));
- window->Show();
- EXPECT_TRUE(window->layer()->visible());
- // Hiding.
- SetWindowVisibilityAnimationType(
- window.get(),
- WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE);
- 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_WORKSPACE_SHOW);
- ash::internal::AnimateOnChildWindowVisibilityChanged(
- window.get(), true);
- EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity());
- EXPECT_TRUE(window->layer()->GetTargetVisibility());
- EXPECT_TRUE(window->layer()->visible());
- // Stays showing.
- ui::AnimationContainerElement* element =
- static_cast<ui::AnimationContainerElement*>(
- window->layer()->GetAnimator());
- element->Step(base::TimeTicks::Now() +
- base::TimeDelta::FromSeconds(5));
- EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity());
- EXPECT_TRUE(window->layer()->GetTargetVisibility());
- EXPECT_TRUE(window->layer()->visible());
-}
-
-TEST_F(WindowAnimationsTest, ShowHide) {
- scoped_ptr<aura::Window> window(
- aura::test::CreateTestWindowWithId(0, NULL));
- window->Show();
- EXPECT_TRUE(window->layer()->visible());
- // Showing -- should be a no-op.
- SetWindowVisibilityAnimationType(
- window.get(),
- WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_SHOW);
- ash::internal::AnimateOnChildWindowVisibilityChanged(
- window.get(), true);
- EXPECT_EQ(1.0f, window->layer()->GetTargetOpacity());
- EXPECT_TRUE(window->layer()->GetTargetVisibility());
- EXPECT_TRUE(window->layer()->visible());
- // Hiding.
- SetWindowVisibilityAnimationType(
- window.get(),
- WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE);
- ash::internal::AnimateOnChildWindowVisibilityChanged(
- window.get(), false);
- EXPECT_EQ(0.0f, window->layer()->GetTargetOpacity());
- EXPECT_FALSE(window->layer()->GetTargetVisibility());
- EXPECT_FALSE(window->layer()->visible());
- // Stays hidden.
- 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()->GetTargetOpacity());
- EXPECT_FALSE(window->layer()->GetTargetVisibility());
- EXPECT_FALSE(window->layer()->visible());
-}
-
TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) {
scoped_ptr<aura::Window> window(
aura::test::CreateTestWindowWithId(0, NULL));
@@ -205,40 +137,5 @@ TEST_F(WindowAnimationsTest, CrossFadeToBounds) {
Step(base::TimeTicks::Now() + base::TimeDelta::FromSeconds(1));
}
-TEST_F(WindowAnimationsTest, GetCrossFadeDuration) {
- if (WorkspaceController::IsWorkspace2Enabled())
- return;
-
- gfx::Rect empty;
- gfx::Rect screen(0, 0, 1000, 500);
-
- // No change takes no time.
- EXPECT_EQ(0, GetCrossFadeDuration(empty, empty).InMilliseconds());
- EXPECT_EQ(0, GetCrossFadeDuration(screen, screen).InMilliseconds());
-
- // Small changes are fast.
- const int kMinimum = 100;
- const int kRange = 300;
- gfx::Rect almost_screen(10, 10, 1000, 450); // 90% of screen area
- EXPECT_EQ(kMinimum + kRange / 10,
- GetCrossFadeDuration(almost_screen, screen).InMilliseconds());
- EXPECT_EQ(kMinimum + kRange / 10,
- GetCrossFadeDuration(screen, almost_screen).InMilliseconds());
-
- // Large changes are slow.
- gfx::Rect ten_percent(10, 10, 100, 500); // 10% of screen area
- EXPECT_EQ(kMinimum + kRange * 9 / 10,
- GetCrossFadeDuration(ten_percent, screen).InMilliseconds());
- EXPECT_EQ(kMinimum + kRange * 9 / 10,
- GetCrossFadeDuration(screen, ten_percent).InMilliseconds());
-
- // Medium changes take medium time.
- gfx::Rect half_screen(10, 10, 500, 250);
- EXPECT_EQ(kMinimum + kRange * 3 / 4,
- GetCrossFadeDuration(half_screen, screen).InMilliseconds());
- EXPECT_EQ(kMinimum + kRange * 3 / 4,
- GetCrossFadeDuration(screen, half_screen).InMilliseconds());
-}
-
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/window_animations.cc ('k') | ash/wm/window_cycle_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698