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

Unified Diff: ui/base/animation/animation_container_test_helper.cc

Issue 11453012: Fix black background when locking with fullscreen window: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add fix for shutdown cut-off timing Created 8 years 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: ui/base/animation/animation_container_test_helper.cc
diff --git a/ui/base/animation/animation_container_test_helper.cc b/ui/base/animation/animation_container_test_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..23f1e23180b155657c78fdc89bc1cb974be576fb
--- /dev/null
+++ b/ui/base/animation/animation_container_test_helper.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 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 "ui/base/animation/animation_container_test_helper.h"
+
+using base::TimeDelta;
+using base::TimeTicks;
+
+namespace ui {
+namespace test {
+
+AnimationContainerTestHelper::AnimationContainerTestHelper(
+ AnimationContainer* container)
+ : container_(container) {
+ container_->test_timing_enabled_ = true;
+ container_->test_time_ = TimeTicks::Now();
+}
+
+AnimationContainerTestHelper::~AnimationContainerTestHelper() {
+ container_->test_timing_enabled_ = false;
+}
+
+void AnimationContainerTestHelper::Forward(TimeDelta delta) {
+ container_->test_time_ += delta;
+ if (IsAnimating())
+ container_->Run();
+}
+
+void AnimationContainerTestHelper::Ping() {
+ if (IsAnimating())
+ container_->Run();
+}
+
+void AnimationContainerTestHelper::ForwardWhileRunning() {
+ while (IsAnimating())
+ Forward(TimeDelta::FromSeconds(1));
+}
+
+bool AnimationContainerTestHelper::IsAnimating() {
+ return container_->timer_.IsRunning();
+}
+
+} // namespace test
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698