summaryrefslogtreecommitdiffstats
path: root/ash/wm/workspace_controller_unittest.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 01:24:46 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 01:24:46 +0000
commit3c90fbf66e5a61be5a02be8b4fe8bbf3bff32c75 (patch)
treefaf60cab7cab4304c995aa718e179ea5b9c988ef /ash/wm/workspace_controller_unittest.cc
parentdb683c912eaf6b81ba64d49d4b3d796450609c90 (diff)
downloadchromium_src-3c90fbf66e5a61be5a02be8b4fe8bbf3bff32c75.zip
chromium_src-3c90fbf66e5a61be5a02be8b4fe8bbf3bff32c75.tar.gz
chromium_src-3c90fbf66e5a61be5a02be8b4fe8bbf3bff32c75.tar.bz2
compositor: Tick the UI animations from cc, instead of from timer callbacks.
Update the animations in the UI in response to the animation step in the compositor, instead of from a timer callback. This should make it more difficult for rogue UI animations to negatively impact the system too much. BUG=371071 R=ajuma@chromium.org, piman@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/291843012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/workspace_controller_unittest.cc')
-rw-r--r--ash/wm/workspace_controller_unittest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc
index fcfa414..0504a4b 100644
--- a/ash/wm/workspace_controller_unittest.cc
+++ b/ash/wm/workspace_controller_unittest.cc
@@ -31,6 +31,7 @@
#include "ui/base/ui_base_types.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
+#include "ui/compositor/test/draw_waiter_for_test.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"
@@ -1236,6 +1237,12 @@ TEST_F(WorkspaceControllerTest, AnimatedNormToMaxToNormRepositionsRemaining) {
desktop_area.width() - window1->bounds().width()) +
",32 640x320", window1->bounds().ToString());
EXPECT_EQ("0,48 256x512", window2->bounds().ToString());
+
+ // Wait for the compositor to draw, which would terminate the pending
+ // animations.
+ ui::Compositor* compositor = window2->layer()->GetCompositor();
+ while (compositor->layer_animator_collection()->HasActiveAnimators())
+ ui::DrawWaiterForTest::Wait(compositor);
}
// This tests simulates a browser and an app and verifies the ordering of the