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

Unified Diff: ash/rotator/test/screen_rotation_animator_test_api.cc

Issue 2728803002: Handles users rotating screen too early (Closed)
Patch Set: Add MultiLayerAnimatorTestController to controll test animation. Created 3 years, 9 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
Index: ash/rotator/test/screen_rotation_animator_test_api.cc
diff --git a/ash/rotator/test/screen_rotation_animator_test_api.cc b/ash/rotator/test/screen_rotation_animator_test_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fb3dbe323e041476bdab56a978269fdd940de52f
--- /dev/null
+++ b/ash/rotator/test/screen_rotation_animator_test_api.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/rotator/test/screen_rotation_animator_test_api.h"
+
+#include "ash/rotator/screen_rotation_animator.h"
+#include "ui/compositor/layer.h"
+
+namespace ash {
+namespace test {
+
+ScreenRotationAnimatorTestApi::ScreenRotationAnimatorTestApi(
+ ScreenRotationAnimator* animator)
+ : ui::test::MultiLayerAnimatorTestController(this), animator_(animator) {}
+
+ScreenRotationAnimatorTestApi::~ScreenRotationAnimatorTestApi() {}
+
+void ScreenRotationAnimatorTestApi::SetDisableAnimationTimers(
+ bool disable_timers) {
+ animator_->set_disable_animation_timers_for_test(disable_timers);
+}
+
+std::vector<ui::LayerAnimator*>
+ScreenRotationAnimatorTestApi::GetLayerAnimators() {
+ std::vector<ui::LayerAnimator*> animators;
+ if (animator_->old_layer_tree_owner_) {
+ animators.insert(animators.end(),
+ animator_->GetOldLayerTreeRootLayer()->GetAnimator());
+ }
+ return animators;
+}
+
+} // namespace test
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698