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

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: Simplify. Fix unit tests. 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
« no previous file with comments | « cc/output/output_surface.cc ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cad5e4eaf69866a1e00fe78b1a362544960c1d2b 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -210,8 +210,10 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
EXPECT_EQ(client.begin_frame_count(), 1);
EXPECT_EQ(output_surface.pending_swap_buffers(), 0);
- // DidSwapBuffers should clear the pending BeginFrame.
+ // SetNeedsBeginFrame should clear the pending BeginFrame after
+ // a SwapBuffers.
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 +222,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
// BeginFrame should be throttled by pending swap buffers.
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 +287,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();
« no previous file with comments | « cc/output/output_surface.cc ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698