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

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: Rename undo/stop to cancel 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..b695bd1e955d0220ec3d1a30893ea4e0df6a3088
--- /dev/null
+++ b/ui/base/animation/animation_container_test_helper.cc
@@ -0,0 +1,37 @@
+// 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) {
+}
+
+AnimationContainerTestHelper::~AnimationContainerTestHelper() {
+}
+
+void AnimationContainerTestHelper::Advance(TimeDelta delta) {
+ time_controller_.Advance(delta);
+ if (IsAnimating())
+ container_->Run();
+}
+
+void AnimationContainerTestHelper::AdvanceUntilDone() {
+ while (IsAnimating())
+ Advance(TimeDelta::FromSeconds(1));
+}
+
+bool AnimationContainerTestHelper::IsAnimating() {
+ return container_->timer_.IsRunning();
+}
+
+} // namespace test
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698