OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/compositor/test/draw_waiter_for_test.h" | 5 #include "ui/compositor/test/draw_waiter_for_test.h" |
6 | 6 |
7 #include "ui/compositor/compositor.h" | 7 #include "ui/compositor/compositor.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
11 // static | 11 // static |
12 void DrawWaiterForTest::WaitForCompositingStarted(Compositor* compositor) { | 12 void DrawWaiterForTest::WaitForCompositingStarted(Compositor* compositor) { |
13 DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_STARTED); | 13 DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_STARTED); |
14 waiter.WaitImpl(compositor); | 14 waiter.WaitImpl(compositor); |
15 } | 15 } |
16 | 16 |
17 void DrawWaiterForTest::WaitForCompositingEnded(Compositor* compositor) { | |
18 DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_ENDED); | |
19 waiter.WaitImpl(compositor); | |
20 } | |
21 | |
22 // static | 17 // static |
23 void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { | 18 void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { |
24 DrawWaiterForTest waiter(WAIT_FOR_COMMIT); | 19 DrawWaiterForTest waiter(WAIT_FOR_COMMIT); |
25 waiter.WaitImpl(compositor); | 20 waiter.WaitImpl(compositor); |
26 } | 21 } |
27 | 22 |
28 DrawWaiterForTest::DrawWaiterForTest(WaitEvent wait_event) | 23 DrawWaiterForTest::DrawWaiterForTest(WaitEvent wait_event) |
29 : wait_event_(wait_event) { | 24 : wait_event_(wait_event) { |
30 } | 25 } |
31 | 26 |
(...skipping 10 matching lines...) Expand all Loading... |
42 if (wait_event_ == WAIT_FOR_COMMIT) | 37 if (wait_event_ == WAIT_FOR_COMMIT) |
43 wait_run_loop_->Quit(); | 38 wait_run_loop_->Quit(); |
44 } | 39 } |
45 | 40 |
46 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, | 41 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, |
47 base::TimeTicks start_time) { | 42 base::TimeTicks start_time) { |
48 if (wait_event_ == WAIT_FOR_COMPOSITING_STARTED) | 43 if (wait_event_ == WAIT_FOR_COMPOSITING_STARTED) |
49 wait_run_loop_->Quit(); | 44 wait_run_loop_->Quit(); |
50 } | 45 } |
51 | 46 |
52 void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { | |
53 if (wait_event_ == WAIT_FOR_COMPOSITING_ENDED) | |
54 wait_run_loop_->Quit(); | |
55 } | |
56 | |
57 void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {} | 47 void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {} |
58 | 48 |
59 void DrawWaiterForTest::OnCompositingShuttingDown(Compositor* compositor) {} | 49 void DrawWaiterForTest::OnCompositingShuttingDown(Compositor* compositor) {} |
60 | 50 |
61 } // namespace ui | 51 } // namespace ui |
OLD | NEW |