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

Side by Side 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: Mock TimeTicks::Now() 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/animation/animation_container_test_helper.h"
6
7 using base::TimeDelta;
8 using base::TimeTicks;
9
10 namespace ui {
11 namespace test {
12
13 AnimationContainerTestHelper::AnimationContainerTestHelper(
14 AnimationContainer* container)
15 : container_(container),
16 time_controller_(new base::test::ScopedTimeController()) {
17 }
18
19 void AnimationContainerTestHelper::Advance(TimeDelta delta) {
20 time_controller_->Advance(delta);
21 if (IsAnimating())
22 container_->Run();
23 }
24
25 void AnimationContainerTestHelper::Ping() {
26 if (IsAnimating())
27 container_->Run();
28 }
29
30 void AnimationContainerTestHelper::AdvanceWhileRunning() {
31 while (IsAnimating())
32 Advance(TimeDelta::FromSeconds(1));
33 }
34
35 bool AnimationContainerTestHelper::IsAnimating() {
36 return container_->timer_.IsRunning();
37 }
38
39 } // namespace test
40 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698