Index: ui/compositor/test/draw_waiter_for_test.cc |
diff --git a/ui/compositor/test/draw_waiter_for_test.cc b/ui/compositor/test/draw_waiter_for_test.cc |
index 5ccb090cbda86fb40fe3249f23e0b2b424965347..92f6698bf3dfa0ed9e5ebd465a39b8ad1aea7028 100644 |
--- a/ui/compositor/test/draw_waiter_for_test.cc |
+++ b/ui/compositor/test/draw_waiter_for_test.cc |
@@ -9,20 +9,24 @@ |
namespace ui { |
// static |
-void DrawWaiterForTest::Wait(Compositor* compositor) { |
- DrawWaiterForTest waiter; |
- waiter.wait_for_commit_ = false; |
+void DrawWaiterForTest::WaitForCompositingStarted(Compositor* compositor) { |
+ DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_STARTED); |
+ waiter.WaitImpl(compositor); |
+} |
+ |
+void DrawWaiterForTest::WaitForCompositingEnded(Compositor* compositor) { |
+ DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_ENDED); |
waiter.WaitImpl(compositor); |
} |
// static |
void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { |
- DrawWaiterForTest waiter; |
- waiter.wait_for_commit_ = true; |
+ DrawWaiterForTest waiter(WAIT_FOR_COMMIT); |
waiter.WaitImpl(compositor); |
} |
-DrawWaiterForTest::DrawWaiterForTest() { |
+DrawWaiterForTest::DrawWaiterForTest(WaitEvent wait_event) |
+ : wait_event_(wait_event) { |
} |
DrawWaiterForTest::~DrawWaiterForTest() {} |
@@ -35,16 +39,18 @@ void DrawWaiterForTest::WaitImpl(Compositor* compositor) { |
} |
void DrawWaiterForTest::OnCompositingDidCommit(Compositor* compositor) { |
- if (wait_for_commit_) |
+ if (wait_event_ == WAIT_FOR_COMMIT) |
wait_run_loop_->Quit(); |
} |
void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, |
base::TimeTicks start_time) { |
+ if (wait_event_ == WAIT_FOR_COMPOSITING_STARTED) |
+ wait_run_loop_->Quit(); |
} |
void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { |
- if (!wait_for_commit_) |
+ if (wait_event_ == WAIT_FOR_COMPOSITING_ENDED) |
wait_run_loop_->Quit(); |
} |