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

Unified Diff: ash/desktop_background/desktop_background_controller_unittest.cc

Issue 11896017: Thread ui opacity animations (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix ash_unittests Created 7 years, 10 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/ash.gyp ('k') | ash/rotator/screen_rotation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_controller_unittest.cc
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc
index 7857231e8da8da5df2454dc0fe92e51ce9925731..237126ee0c93c74b5b11248a0a462b99c23c271f 100644
--- a/ash/desktop_background/desktop_background_controller_unittest.cc
+++ b/ash/desktop_background/desktop_background_controller_unittest.cc
@@ -9,6 +9,7 @@
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ui/aura/root_window.h"
+#include "ui/compositor/test/layer_animator_test_controller.h"
using aura::RootWindow;
using aura::Window;
@@ -35,12 +36,13 @@ void RunAnimationForWidget(views::Widget* widget) {
DCHECK(!ui::LayerAnimator::disable_animations_for_test());
ui::Layer* layer = widget->GetNativeView()->layer();
- ui::LayerAnimator* animator = layer->GetAnimator();
+ ui::LayerAnimatorTestController controller(layer->GetAnimator());
ui::AnimationContainerElement* element = layer->GetAnimator();
// Multiple steps are required to complete complex animations.
// TODO(vollick): This should not be necessary. crbug.com/154017
- while (animator->is_animating()) {
- base::TimeTicks step_time = animator->last_step_time();
+ while (controller.animator()->is_animating()) {
+ controller.StartThreadedAnimationsIfNeeded();
+ base::TimeTicks step_time = controller.animator()->last_step_time();
element->Step(step_time + base::TimeDelta::FromMilliseconds(1000));
}
}
« no previous file with comments | « ash/ash.gyp ('k') | ash/rotator/screen_rotation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698