Chromium Code Reviews| Index: cc/trees/layer_tree_host_unittest.cc |
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc |
| index dd9af8d18f5440d958a335d21f2d10ac681f066f..d9294079d961d831d15fdc659887466b28edfef5 100644 |
| --- a/cc/trees/layer_tree_host_unittest.cc |
| +++ b/cc/trees/layer_tree_host_unittest.cc |
| @@ -471,9 +471,10 @@ class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { |
| ~MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface() {} |
| explicit MockSetWorkerContextShouldAggressivelyFreeResourcesOutputSurface( |
| bool delegated_rendering) |
| - : FakeOutputSurface(TestContextProvider::Create(), |
| - TestContextProvider::CreateWorker(), |
| - delegated_rendering) {} |
| + : FakeOutputSurface( |
| + base::MakeUnique<TestContextProvider::DeferredCreate>(), |
| + TestContextProvider::Create(), |
| + delegated_rendering) {} |
| MOCK_METHOD1(SetWorkerContextShouldAggressivelyFreeResources, |
| void(bool is_visible)); |
| }; |
| @@ -4144,30 +4145,24 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll); |
| class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface |
| : public LayerTreeHostTest { |
| protected: |
| - LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface() |
| - : first_output_surface_memory_limit_(4321234), |
| - second_output_surface_memory_limit_(1234321) {} |
| - |
| std::unique_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |
| - if (!first_context_provider_.get()) { |
| - first_context_provider_ = TestContextProvider::Create(); |
| - } else { |
| - EXPECT_FALSE(second_context_provider_.get()); |
| - second_context_provider_ = TestContextProvider::Create(); |
| - } |
| + std::unique_ptr<TestContextProvider::DeferredCreate> create( |
| + new TestContextProvider::DeferredCreate); |
| + bool first = !first_context_provider_; |
| + if (first) |
| + create->created_context = &first_context_provider_; |
| + else |
| + create->created_context = &second_context_provider_; |
| - scoped_refptr<TestContextProvider> provider(second_context_provider_.get() |
| - ? second_context_provider_ |
| - : first_context_provider_); |
| std::unique_ptr<FakeOutputSurface> output_surface; |
| if (delegating_renderer()) |
| - output_surface = FakeOutputSurface::CreateDelegating3d(provider); |
| + output_surface = FakeOutputSurface::CreateDelegating3d(std::move(create)); |
| else |
| - output_surface = FakeOutputSurface::Create3d(provider); |
| + output_surface = FakeOutputSurface::Create3d(std::move(create)); |
| output_surface->SetMemoryPolicyToSetAtBind( |
| base::WrapUnique(new ManagedMemoryPolicy( |
| - second_context_provider_.get() ? second_output_surface_memory_limit_ |
| - : first_output_surface_memory_limit_, |
| + first ? first_output_surface_memory_limit_ |
| + : second_output_surface_memory_limit_, |
| gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, |
| ManagedMemoryPolicy::kDefaultNumResourcesLimit))); |
| return output_surface; |
| @@ -4212,10 +4207,10 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface |
| void AfterTest() override {} |
| - scoped_refptr<TestContextProvider> first_context_provider_; |
| - scoped_refptr<TestContextProvider> second_context_provider_; |
| - size_t first_output_surface_memory_limit_; |
| - size_t second_output_surface_memory_limit_; |
| + TestContextProvider* first_context_provider_ = nullptr; |
|
piman
2016/05/17 03:41:41
This one is only used to get the TestWGC3D, so may
danakj
2016/05/17 19:53:33
I don't want to build things about the TestWGC3D c
|
| + TestContextProvider* second_context_provider_ = nullptr; |
|
piman
2016/05/17 03:41:41
this one is not used any more.
danakj
2016/05/17 19:53:35
Done.
|
| + size_t first_output_surface_memory_limit_ = 4321234; |
| + size_t second_output_surface_memory_limit_ = 1234321; |
| FakeContentLayerClient client_; |
| scoped_refptr<Layer> root_; |
| }; |
| @@ -5472,7 +5467,6 @@ class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy |
| std::unique_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |
| std::unique_ptr<TestWebGraphicsContext3D> context3d = |
| TestWebGraphicsContext3D::Create(); |
| - context3d->set_support_image(true); |
| context3d->set_support_sync_query(true); |
| #if defined(OS_MACOSX) |
| context3d->set_support_texture_rectangle(true); |