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

Side by Side Diff: ui/base/animation/animation_container_test_helper.h

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 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 #ifndef UI_BASE_ANIMATION_ANIMATION_CONTAINER_TEST_HELPER_H_
6 #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_TEST_HELPER_H_
7
8 #include "base/test/scoped_time_controller.h"
9 #include "base/time.h"
10 #include "ui/base/animation/animation_container.h"
11 #include "ui/base/ui_export.h"
12
13 namespace ui {
14 namespace test {
15
16 // This class can be used in tests for fine control over animations.
17
18 class AnimationContainerTestHelper {
19 public:
20 // Creates helper for given container. Container is now driven by this
21 // helper rather than by internal timer.
22 explicit AnimationContainerTestHelper(AnimationContainer* container);
23
24 ~AnimationContainerTestHelper();
25
26 // Advances AnimationContainer for |delta|.
27 void Advance(base::TimeDelta delta);
28
29 // Returns if AnimationContainer is animating.
30 bool IsAnimating();
31
32 // Forwards in large steps (1 second) while there are any animations running.
33 // Use it before deleting Helper to avoid negative time delta in animations
34 // once timer gets cleaned up.
35 void AdvanceUntilDone();
36
37 private:
38 AnimationContainer* container_;
39
40 base::test::ScopedTimeController time_controller_;
41
42 DISALLOW_COPY_AND_ASSIGN(AnimationContainerTestHelper);
43 };
44
45 } // namespace test
46 } // namespace ui
47
48 #endif // UI_BASE_ANIMATION_ANIMATION_CONTAINER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698