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 |
17 // static | 22 // static |
18 void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { | 23 void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { |
19 DrawWaiterForTest waiter(WAIT_FOR_COMMIT); | 24 DrawWaiterForTest waiter(WAIT_FOR_COMMIT); |
20 waiter.WaitImpl(compositor); | 25 waiter.WaitImpl(compositor); |
21 } | 26 } |
22 | 27 |
23 DrawWaiterForTest::DrawWaiterForTest(WaitEvent wait_event) | 28 DrawWaiterForTest::DrawWaiterForTest(WaitEvent wait_event) |
24 : wait_event_(wait_event) { | 29 : wait_event_(wait_event) { |
25 } | 30 } |
26 | 31 |
(...skipping 10 matching lines...) Expand all Loading... |
37 if (wait_event_ == WAIT_FOR_COMMIT) | 42 if (wait_event_ == WAIT_FOR_COMMIT) |
38 wait_run_loop_->Quit(); | 43 wait_run_loop_->Quit(); |
39 } | 44 } |
40 | 45 |
41 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, | 46 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, |
42 base::TimeTicks start_time) { | 47 base::TimeTicks start_time) { |
43 if (wait_event_ == WAIT_FOR_COMPOSITING_STARTED) | 48 if (wait_event_ == WAIT_FOR_COMPOSITING_STARTED) |
44 wait_run_loop_->Quit(); | 49 wait_run_loop_->Quit(); |
45 } | 50 } |
46 | 51 |
| 52 void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { |
| 53 if (wait_event_ == WAIT_FOR_COMPOSITING_ENDED) |
| 54 wait_run_loop_->Quit(); |
| 55 } |
| 56 |
47 void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {} | 57 void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {} |
48 | 58 |
49 void DrawWaiterForTest::OnCompositingShuttingDown(Compositor* compositor) {} | 59 void DrawWaiterForTest::OnCompositingShuttingDown(Compositor* compositor) {} |
50 | 60 |
51 } // namespace ui | 61 } // namespace ui |
OLD | NEW |