Index: cc/test/fake_output_surface.cc |
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc |
index 920b68940c7aea80b23534c60436050206a5b537..1cae6eeb4dbcf3c589017a1e23f7e44f902c1c7b 100644 |
--- a/cc/test/fake_output_surface.cc |
+++ b/cc/test/fake_output_surface.cc |
@@ -63,6 +63,9 @@ FakeOutputSurface::FakeOutputSurface( |
FakeOutputSurface::~FakeOutputSurface() {} |
void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) { |
+ if (is_lost_) |
+ return; |
+ |
if (frame->software_frame_data || frame->delegated_frame_data || |
!context_provider()) { |
frame->AssignTo(&last_sent_frame_); |
@@ -76,7 +79,7 @@ void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) { |
++num_sent_frames_; |
PostSwapBuffersComplete(); |
- DidSwapBuffers(); |
+ client_->DidSwapBuffers(); |
} else { |
OutputSurface::SwapBuffers(frame); |
frame->AssignTo(&last_sent_frame_); |
@@ -88,9 +91,7 @@ void FakeOutputSurface::SetNeedsBeginFrame(bool enable) { |
needs_begin_frame_ = enable; |
OutputSurface::SetNeedsBeginFrame(enable); |
- // If there is not BeginFrame emulation from the FrameRateController, |
- // then we just post a BeginFrame to emulate it as part of the test. |
- if (enable && !frame_rate_controller_) { |
+ if (enable) { |
base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
base::Bind(&FakeOutputSurface::OnBeginFrame, |
@@ -100,7 +101,7 @@ void FakeOutputSurface::SetNeedsBeginFrame(bool enable) { |
} |
void FakeOutputSurface::OnBeginFrame() { |
- OutputSurface::BeginFrame(BeginFrameArgs::CreateForTesting()); |
+ client_->BeginFrame(BeginFrameArgs::CreateForTesting()); |
} |