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

Unified Diff: ui/compositor/test/draw_waiter_for_test.cc

Issue 134623005: Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 months 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 side-by-side diff with in-line comments
Download patch
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 c471a6ff6b0a155c48ac78d201d8e4ff56dc6305..f256ecc075aff27ffdefcaa2c87447335dbbb723 100644
--- a/ui/compositor/test/draw_waiter_for_test.cc
+++ b/ui/compositor/test/draw_waiter_for_test.cc
@@ -9,20 +9,25 @@
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() {}
@@ -34,19 +39,23 @@ 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) {}
+ 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();
}
-void DrawWaiterForTest::OnCompositingAborted(Compositor* compositor) {}
+void DrawWaiterForTest::OnCompositingAborted(Compositor* compositor) {
+}
void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {}

Powered by Google App Engine
This is Rietveld 408576698