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

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

Issue 638653003: Make ui::Compositor use ui::Scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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
« no previous file with comments | « ui/compositor/test/draw_waiter_for_test.h ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « ui/compositor/test/draw_waiter_for_test.h ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698