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

Unified Diff: cc/output/output_surface_unittest.cc

Issue 16863005: cc: Add BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc12
Patch Set: Rebase Created 7 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
« no previous file with comments | « cc/output/output_surface_client.h ('k') | cc/scheduler/frame_rate_controller.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 e42777aeca5174138bab8a88cc9d1a43857595da..68053e80ff8e9244356e5e290072c1476fb4e97d 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -42,8 +42,8 @@ class TestOutputSurface : public OutputSurface {
OnVSyncParametersChanged(timebase, interval);
}
- void BeginFrameForTesting(base::TimeTicks frame_time) {
- BeginFrame(frame_time);
+ void BeginFrameForTesting() {
+ BeginFrame(BeginFrameArgs::CreateForTesting());
}
void DidSwapBuffersForTesting() {
@@ -73,7 +73,7 @@ class FakeOutputSurfaceClient : public OutputSurfaceClient {
return deferred_initialize_result_;
}
virtual void SetNeedsRedrawRect(gfx::Rect damage_rect) OVERRIDE {}
- virtual void BeginFrame(base::TimeTicks frame_time) OVERRIDE {
+ virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE {
begin_frame_count_++;
}
virtual void OnSwapBuffersComplete(const CompositorFrameAck* ack) OVERRIDE {}
@@ -213,7 +213,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
new base::TestSimpleTaskRunner;
bool throttle_frame_production = true;
const base::TimeDelta display_refresh_interval =
- base::TimeDelta::FromMicroseconds(16666);
+ BeginFrameArgs::DefaultInterval();
output_surface.InitializeBeginFrameEmulation(
task_runner.get(),
@@ -281,13 +281,13 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
// Optimistically injected BeginFrames without a SetNeedsBeginFrame should be
// allowed.
- output_surface.BeginFrameForTesting(base::TimeTicks::Now());
+ output_surface.BeginFrameForTesting();
EXPECT_EQ(client.begin_frame_count(), 5);
EXPECT_EQ(output_surface.pending_swap_buffers(), 1);
// Optimistically injected BeginFrames without a SetNeedsBeginFrame should
// still be throttled by pending begin frames however.
- output_surface.BeginFrameForTesting(base::TimeTicks::Now());
+ output_surface.BeginFrameForTesting();
EXPECT_EQ(client.begin_frame_count(), 5);
EXPECT_EQ(output_surface.pending_swap_buffers(), 1);
@@ -296,7 +296,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
output_surface.DidSwapBuffersForTesting();
EXPECT_EQ(client.begin_frame_count(), 5);
EXPECT_EQ(output_surface.pending_swap_buffers(), 2);
- output_surface.BeginFrameForTesting(base::TimeTicks::Now());
+ output_surface.BeginFrameForTesting();
EXPECT_EQ(client.begin_frame_count(), 5);
EXPECT_EQ(output_surface.pending_swap_buffers(), 2);
}
« no previous file with comments | « cc/output/output_surface_client.h ('k') | cc/scheduler/frame_rate_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698