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

Unified Diff: cc/output/output_surface_unittest.cc

Issue 23767011: cc: Always use SetNeedsBeginFrame to request the next BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@pollForDrawTriggers
Patch Set: Created 7 years, 3 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/output/output_surface_unittest.cc
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
index 54fd3a1adc5cacf2dca5aea0ff9a3cb336ec4d7f..048ba5e4571f28669b2d4764ac6d71804006ec37 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -212,6 +212,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
// DidSwapBuffers should clear the pending BeginFrame.
danakj 2013/09/12 16:53:59 comment should be replaced?
brianderson 2013/09/12 18:46:44 Yes. I will comb the code for similar comments to
output_surface.DidSwapBuffersForTesting();
+ output_surface.SetNeedsBeginFrame(true);
EXPECT_EQ(client.begin_frame_count(), 1);
EXPECT_EQ(output_surface.pending_swap_buffers(), 1);
task_runner->RunPendingTasks();
@@ -220,6 +221,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
// BeginFrame should be throttled by pending swap buffers.
danakj 2013/09/12 16:53:59 So if it's not tied to swap, what will throttle be
brianderson 2013/09/12 18:46:44 The OutputSurface will throttle sending the next B
output_surface.DidSwapBuffersForTesting();
+ output_surface.SetNeedsBeginFrame(true);
EXPECT_EQ(client.begin_frame_count(), 2);
EXPECT_EQ(output_surface.pending_swap_buffers(), 2);
task_runner->RunPendingTasks();
@@ -284,12 +286,14 @@ TEST(OutputSurfaceTest, OptimisticAndRetroactiveBeginFrames) {
output_surface.BeginFrameForTesting();
EXPECT_EQ(client.begin_frame_count(), 2);
output_surface.DidSwapBuffersForTesting();
+ output_surface.SetNeedsBeginFrame(true);
EXPECT_EQ(client.begin_frame_count(), 3);
EXPECT_EQ(output_surface.pending_swap_buffers(), 1);
// Optimistically injected BeginFrames should be by throttled by pending
// swap buffers...
output_surface.DidSwapBuffersForTesting();
+ output_surface.SetNeedsBeginFrame(true);
EXPECT_EQ(client.begin_frame_count(), 3);
EXPECT_EQ(output_surface.pending_swap_buffers(), 2);
output_surface.BeginFrameForTesting();

Powered by Google App Engine
This is Rietveld 408576698