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

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: 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 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 container_->test_timing_enabled_ = true;
17 container_->test_time_ = TimeTicks::Now();
18 }
19
20 AnimationContainerTestHelper::~AnimationContainerTestHelper() {
21 container_->test_timing_enabled_ = false;
22 }
23
24 void AnimationContainerTestHelper::Forward(TimeDelta delta) {
25 container_->test_time_ += delta;
26 if (IsAnimating())
27 container_->Run();
28 }
29
30 void AnimationContainerTestHelper::Ping() {
31 if (IsAnimating())
32 container_->Run();
33 }
34
35 void AnimationContainerTestHelper::ForwardWhileRunning() {
36 while (IsAnimating())
37 Forward(TimeDelta::FromSeconds(1));
38 }
39
40 bool AnimationContainerTestHelper::IsAnimating() {
41 return container_->timer_.IsRunning();
42 }
43
44 } // namespace test
45 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698