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

Unified Diff: ui/aura/window_unittest.cc

Issue 241983003: Stops animations when removing a window from its parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stops animations when removing a window from its parent (comment) Created 6 years, 8 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
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index bdd4f73dd6c16e360a6393e39011d9281528a942..fcec27869a7c58a8ab5560acab9bcf7e1cd9c33c 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -2244,7 +2244,8 @@ TEST_F(WindowTest, RootWindowSetWhenReparenting) {
ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
ui::ScopedLayerAnimationSettings settings1(child.layer()->GetAnimator());
settings1.SetTransitionDuration(base::TimeDelta::FromMilliseconds(100));
- child.SetBounds(gfx::Rect(35, 35, 100, 100));
+ gfx::Rect new_bounds(gfx::Rect(35, 35, 50, 50));
+ child.SetBounds(new_bounds);
BoundsChangedWindowObserver observer;
child.AddObserver(&observer);
@@ -2254,7 +2255,11 @@ TEST_F(WindowTest, RootWindowSetWhenReparenting) {
parent2.AddChild(&child);
EXPECT_TRUE(observer.root_set());
- // TODO(varkha): Check that the target bounds didn't change after reparenting.
+ // Animations should stop and the bounds should be as set before the |child|
+ // got reparented.
+ EXPECT_EQ(new_bounds.ToString(), child.GetTargetBounds().ToString());
+ EXPECT_EQ(new_bounds.ToString(), child.bounds().ToString());
+ EXPECT_EQ("55,55 50x50", child.GetBoundsInRootWindow().ToString());
}
TEST_F(WindowTest, OwnedByParentFalse) {
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698