| Index: cc/resources/scoped_resource_unittest.cc
|
| diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc
|
| index 4518a60beffa805dc16f8fa1f53c6d3001db6222..3fe2f326f6f16c0d33a6ba900fad98dd0f44e7b3 100644
|
| --- a/cc/resources/scoped_resource_unittest.cc
|
| +++ b/cc/resources/scoped_resource_unittest.cc
|
| @@ -6,9 +6,8 @@
|
|
|
| #include <stddef.h>
|
|
|
| -#include "cc/test/fake_output_surface.h"
|
| -#include "cc/test/fake_output_surface_client.h"
|
| #include "cc/test/fake_resource_provider.h"
|
| +#include "cc/test/test_context_provider.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -16,15 +15,14 @@ namespace cc {
|
| namespace {
|
|
|
| TEST(ScopedResourceTest, NewScopedResource) {
|
| - FakeOutputSurfaceClient output_surface_client;
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d());
|
| - CHECK(output_surface->BindToClient(&output_surface_client));
|
| + scoped_refptr<TestContextProvider> context_provider =
|
| + TestContextProvider::Create();
|
| + ASSERT_TRUE(context_provider->BindToCurrentThread());
|
|
|
| std::unique_ptr<SharedBitmapManager> shared_bitmap_manager(
|
| new TestSharedBitmapManager());
|
| std::unique_ptr<ResourceProvider> resource_provider =
|
| - FakeResourceProvider::Create(output_surface.get(),
|
| + FakeResourceProvider::Create(context_provider.get(),
|
| shared_bitmap_manager.get());
|
| std::unique_ptr<ScopedResource> texture =
|
| ScopedResource::Create(resource_provider.get());
|
| @@ -39,15 +37,14 @@ TEST(ScopedResourceTest, NewScopedResource) {
|
| }
|
|
|
| TEST(ScopedResourceTest, CreateScopedResource) {
|
| - FakeOutputSurfaceClient output_surface_client;
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d());
|
| - CHECK(output_surface->BindToClient(&output_surface_client));
|
| + scoped_refptr<TestContextProvider> context_provider =
|
| + TestContextProvider::Create();
|
| + ASSERT_TRUE(context_provider->BindToCurrentThread());
|
|
|
| std::unique_ptr<SharedBitmapManager> shared_bitmap_manager(
|
| new TestSharedBitmapManager());
|
| std::unique_ptr<ResourceProvider> resource_provider =
|
| - FakeResourceProvider::Create(output_surface.get(),
|
| + FakeResourceProvider::Create(context_provider.get(),
|
| shared_bitmap_manager.get());
|
| std::unique_ptr<ScopedResource> texture =
|
| ScopedResource::Create(resource_provider.get());
|
| @@ -65,15 +62,14 @@ TEST(ScopedResourceTest, CreateScopedResource) {
|
| }
|
|
|
| TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
|
| - FakeOutputSurfaceClient output_surface_client;
|
| - std::unique_ptr<OutputSurface> output_surface(
|
| - FakeOutputSurface::CreateDelegating3d());
|
| - CHECK(output_surface->BindToClient(&output_surface_client));
|
| + scoped_refptr<TestContextProvider> context_provider =
|
| + TestContextProvider::Create();
|
| + ASSERT_TRUE(context_provider->BindToCurrentThread());
|
|
|
| std::unique_ptr<SharedBitmapManager> shared_bitmap_manager(
|
| new TestSharedBitmapManager());
|
| std::unique_ptr<ResourceProvider> resource_provider =
|
| - FakeResourceProvider::Create(output_surface.get(),
|
| + FakeResourceProvider::Create(context_provider.get(),
|
| shared_bitmap_manager.get());
|
| {
|
| std::unique_ptr<ScopedResource> texture =
|
|
|