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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: WIP: pulling FRC out of OS Created 6 years, 9 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: cc/scheduler/scheduler_unittest.cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index fcd73a86d295b71012d34263b54bd03624e16c4e..c2b8ef9a067371b774e704b47a38ec36e0ac1218 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -1256,13 +1256,21 @@ TEST(SchedulerTest, PollForCommitCompletion) {
impl_frame_args.interval = base::TimeDelta::FromMilliseconds(interval);
scheduler->BeginImplFrame(impl_frame_args);
scheduler->OnBeginImplFrameDeadline();
+ scheduler->DidSwapBuffers();
+ scheduler->OnSwapBuffersComplete();
// At this point, we've drawn a frame. Start another commit, but hold off on
// the NotifyReadyToCommit for now.
EXPECT_FALSE(scheduler->CommitPending());
+ scheduler->BeginImplFrame(impl_frame_args);
scheduler->SetNeedsCommit();
EXPECT_TRUE(scheduler->CommitPending());
+ // Draw and swap the frame, but don't ack the swap to simulate the Browser
+ // blocking on the renderer.
+ scheduler->OnBeginImplFrameDeadline();
+ scheduler->DidSwapBuffers();
+
// Spin the event loop a few times and make sure we get more
// DidAnticipateDrawTimeChange calls every time.
int actions_so_far = client.num_actions_();

Powered by Google App Engine
This is Rietveld 408576698