| Index: cc/output/output_surface_unittest.cc
|
| diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
|
| index 38285da59c19d19ebba96ba22c8c1f098d2ba132..bebd2457275116d0fa4ae27025d84486118c9ea4 100644
|
| --- a/cc/output/output_surface_unittest.cc
|
| +++ b/cc/output/output_surface_unittest.cc
|
| @@ -23,23 +23,19 @@
|
| class TestOutputSurface : public OutputSurface {
|
| public:
|
| explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider)
|
| - : OutputSurface(std::move(context_provider), nullptr, nullptr) {}
|
| + : OutputSurface(context_provider) {}
|
|
|
| TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
|
| scoped_refptr<ContextProvider> worker_context_provider)
|
| - : OutputSurface(std::move(context_provider),
|
| - std::move(worker_context_provider),
|
| - nullptr) {}
|
| + : OutputSurface(worker_context_provider) {}
|
|
|
| explicit TestOutputSurface(
|
| std::unique_ptr<SoftwareOutputDevice> software_device)
|
| - : OutputSurface(nullptr, nullptr, std::move(software_device)) {}
|
| + : OutputSurface(std::move(software_device)) {}
|
|
|
| TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
|
| std::unique_ptr<SoftwareOutputDevice> software_device)
|
| - : OutputSurface(std::move(context_provider),
|
| - nullptr,
|
| - std::move(software_device)) {}
|
| + : OutputSurface(context_provider, std::move(software_device)) {}
|
|
|
| void SwapBuffers(CompositorFrame* frame) override {
|
| client_->DidSwapBuffers();
|
| @@ -121,8 +117,6 @@
|
| EXPECT_TRUE(client.did_lose_output_surface_called());
|
| }
|
|
|
| -// TODO(danakj): Add a test for worker context failure as well when
|
| -// OutputSurface creates/binds it.
|
| TEST(OutputSurfaceTest, ClientPointerIndicatesBindToClientFailure) {
|
| scoped_refptr<TestContextProvider> context_provider =
|
| TestContextProvider::Create();
|
| @@ -131,6 +125,23 @@
|
| context_provider->UnboundTestContext3d()->set_context_lost(true);
|
|
|
| TestOutputSurface output_surface(context_provider);
|
| + EXPECT_FALSE(output_surface.HasClient());
|
| +
|
| + FakeOutputSurfaceClient client;
|
| + EXPECT_FALSE(output_surface.BindToClient(&client));
|
| + EXPECT_FALSE(output_surface.HasClient());
|
| +}
|
| +
|
| +TEST(OutputSurfaceTest, ClientPointerIndicatesWorkerBindToClientFailure) {
|
| + scoped_refptr<TestContextProvider> context_provider =
|
| + TestContextProvider::Create();
|
| + scoped_refptr<TestContextProvider> worker_context_provider =
|
| + TestContextProvider::Create();
|
| +
|
| + // Lose the context so BindToClient fails.
|
| + worker_context_provider->UnboundTestContext3d()->set_context_lost(true);
|
| +
|
| + TestOutputSurface output_surface(context_provider, worker_context_provider);
|
| EXPECT_FALSE(output_surface.HasClient());
|
|
|
| FakeOutputSurfaceClient client;
|
|
|