| Index: cc/output/output_surface_unittest.cc
|
| diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
|
| index 54ad9acff90c8f873d49b1d6371d91df206c93ea..0a9c6b55e29939d8316a89a12842804e26989851 100644
|
| --- a/cc/output/output_surface_unittest.cc
|
| +++ b/cc/output/output_surface_unittest.cc
|
| @@ -20,15 +20,18 @@ namespace {
|
| class TestOutputSurface : public OutputSurface {
|
| public:
|
| explicit TestOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d)
|
| - : OutputSurface(context3d.Pass()) {}
|
| + : OutputSurface(context3d.Pass()),
|
| + retroactive_begin_frame_deadline_enabled_(false) {}
|
|
|
| explicit TestOutputSurface(
|
| scoped_ptr<cc::SoftwareOutputDevice> software_device)
|
| - : OutputSurface(software_device.Pass()) {}
|
| + : OutputSurface(software_device.Pass()),
|
| + retroactive_begin_frame_deadline_enabled_(false) {}
|
|
|
| TestOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
|
| scoped_ptr<cc::SoftwareOutputDevice> software_device)
|
| - : OutputSurface(context3d.Pass(), software_device.Pass()) {}
|
| + : OutputSurface(context3d.Pass(), software_device.Pass()),
|
| + retroactive_begin_frame_deadline_enabled_(false) {}
|
|
|
| bool InitializeNewContext3D(
|
| scoped_ptr<WebKit::WebGraphicsContext3D> new_context3d) {
|
| @@ -61,8 +64,8 @@ class TestOutputSurface : public OutputSurface {
|
| OnSwapBuffersComplete(NULL);
|
| }
|
|
|
| - void SetRetroactiveBeginFramePeriod(base::TimeDelta period) {
|
| - retroactive_begin_frame_period_ = period;
|
| + void EnableRetroactiveBeginFrameDeadline(bool enable) {
|
| + retroactive_begin_frame_deadline_enabled_ = enable;
|
| }
|
|
|
| protected:
|
| @@ -71,11 +74,13 @@ class TestOutputSurface : public OutputSurface {
|
| CheckForRetroactiveBeginFrame();
|
| }
|
|
|
| - virtual base::TimeDelta RetroactiveBeginFramePeriod() OVERRIDE {
|
| - return retroactive_begin_frame_period_;
|
| + virtual base::TimeTicks RetroactiveBeginFrameDeadline() OVERRIDE {
|
| + if (retroactive_begin_frame_deadline_enabled_)
|
| + return OutputSurface::RetroactiveBeginFrameDeadline();
|
| + return base::TimeTicks();
|
| }
|
|
|
| - base::TimeDelta retroactive_begin_frame_period_;
|
| + bool retroactive_begin_frame_deadline_enabled_;
|
| };
|
|
|
| class FakeOutputSurfaceClient : public OutputSurfaceClient {
|
| @@ -256,8 +261,7 @@ TEST(OutputSurfaceTest, BeginFrameEmulation) {
|
| display_refresh_interval);
|
|
|
| output_surface.SetMaxFramesPending(2);
|
| - output_surface.SetRetroactiveBeginFramePeriod(
|
| - base::TimeDelta::FromSeconds(-1));
|
| + output_surface.EnableRetroactiveBeginFrameDeadline(false);
|
|
|
| // We should start off with 0 BeginFrames
|
| EXPECT_EQ(client.begin_frame_count(), 0);
|
| @@ -331,10 +335,7 @@ TEST(OutputSurfaceTest, OptimisticAndRetroactiveBeginFrames) {
|
| EXPECT_FALSE(client.deferred_initialize_called());
|
|
|
| output_surface.SetMaxFramesPending(2);
|
| -
|
| - // Enable retroactive BeginFrames.
|
| - output_surface.SetRetroactiveBeginFramePeriod(
|
| - base::TimeDelta::FromSeconds(100000));
|
| + output_surface.EnableRetroactiveBeginFrameDeadline(true);
|
|
|
| // Optimistically injected BeginFrames should be throttled if
|
| // SetNeedsBeginFrame is false...
|
|
|