Index: cc/resources/resource_provider_unittest.cc |
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc |
index 7c65b73098b208ec4ed2916383c0deb148867ffc..12075b56c81b091d0dd5b45d772734489791de66 100644 |
--- a/cc/resources/resource_provider_unittest.cc |
+++ b/cc/resources/resource_provider_unittest.cc |
@@ -3231,25 +3231,6 @@ TEST_P(ResourceProviderTest, TextureAllocation) { |
resource_provider->DeleteResource(id); |
Mock::VerifyAndClearExpectations(context); |
- |
- // Same for async version. |
- id = resource_provider->CreateResource( |
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); |
- resource_provider->AcquirePixelBuffer(id); |
- |
- EXPECT_CALL(*context, NextTextureId()).WillOnce(Return(texture_id)); |
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(2); |
- EXPECT_CALL(*context, asyncTexImage2DCHROMIUM(_, _, _, 2, 2, _, _, _, _)) |
- .Times(1); |
- resource_provider->BeginSetPixels(id); |
- ASSERT_TRUE(resource_provider->DidSetPixelsComplete(id)); |
- |
- resource_provider->ReleasePixelBuffer(id); |
- |
- EXPECT_CALL(*context, RetireTextureId(texture_id)).Times(1); |
- resource_provider->DeleteResource(id); |
- |
- Mock::VerifyAndClearExpectations(context); |
} |
TEST_P(ResourceProviderTest, TextureAllocationHint) { |
@@ -3361,129 +3342,6 @@ TEST_P(ResourceProviderTest, TextureAllocationHint_BGRA) { |
} |
} |
-TEST_P(ResourceProviderTest, PixelBuffer_GLTexture) { |
- if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE) |
- return; |
- scoped_ptr<AllocationTrackingContext3D> context_owned( |
- new StrictMock<AllocationTrackingContext3D>); |
- AllocationTrackingContext3D* context = context_owned.get(); |
- |
- FakeOutputSurfaceClient output_surface_client; |
- scoped_ptr<OutputSurface> output_surface( |
- FakeOutputSurface::Create3d(context_owned.Pass())); |
- CHECK(output_surface->BindToClient(&output_surface_client)); |
- |
- gfx::Size size(2, 2); |
- ResourceFormat format = RGBA_8888; |
- ResourceId id = 0; |
- int texture_id = 123; |
- |
- scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
- output_surface.get(), shared_bitmap_manager_.get(), |
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, |
- use_image_texture_targets_)); |
- |
- id = resource_provider->CreateResource( |
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); |
- resource_provider->AcquirePixelBuffer(id); |
- |
- EXPECT_CALL(*context, NextTextureId()).WillOnce(Return(texture_id)); |
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(2); |
- EXPECT_CALL(*context, asyncTexImage2DCHROMIUM(_, _, _, 2, 2, _, _, _, _)) |
- .Times(1); |
- resource_provider->BeginSetPixels(id); |
- |
- EXPECT_TRUE(resource_provider->DidSetPixelsComplete(id)); |
- |
- resource_provider->ReleasePixelBuffer(id); |
- |
- EXPECT_CALL(*context, RetireTextureId(texture_id)).Times(1); |
- resource_provider->DeleteResource(id); |
- |
- Mock::VerifyAndClearExpectations(context); |
-} |
- |
-TEST_P(ResourceProviderTest, ForcingAsyncUploadToComplete) { |
- // Only for GL textures. |
- if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE) |
- return; |
- scoped_ptr<AllocationTrackingContext3D> context_owned( |
- new StrictMock<AllocationTrackingContext3D>); |
- AllocationTrackingContext3D* context = context_owned.get(); |
- |
- FakeOutputSurfaceClient output_surface_client; |
- scoped_ptr<OutputSurface> output_surface( |
- FakeOutputSurface::Create3d(context_owned.Pass())); |
- CHECK(output_surface->BindToClient(&output_surface_client)); |
- |
- gfx::Size size(2, 2); |
- ResourceFormat format = RGBA_8888; |
- ResourceId id = 0; |
- int texture_id = 123; |
- |
- scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
- output_surface.get(), shared_bitmap_manager_.get(), |
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, |
- use_image_texture_targets_)); |
- |
- id = resource_provider->CreateResource( |
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); |
- resource_provider->AcquirePixelBuffer(id); |
- |
- EXPECT_CALL(*context, NextTextureId()).WillOnce(Return(texture_id)); |
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(2); |
- EXPECT_CALL(*context, asyncTexImage2DCHROMIUM(_, _, _, 2, 2, _, _, _, _)) |
- .Times(1); |
- resource_provider->BeginSetPixels(id); |
- |
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)).Times(1); |
- EXPECT_CALL(*context, waitAsyncTexImage2DCHROMIUM(GL_TEXTURE_2D)).Times(1); |
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, 0)).Times(1); |
- resource_provider->ForceSetPixelsToComplete(id); |
- |
- resource_provider->ReleasePixelBuffer(id); |
- |
- EXPECT_CALL(*context, RetireTextureId(texture_id)).Times(1); |
- resource_provider->DeleteResource(id); |
- |
- Mock::VerifyAndClearExpectations(context); |
-} |
- |
-TEST_P(ResourceProviderTest, PixelBufferLostContext) { |
- scoped_ptr<AllocationTrackingContext3D> context_owned( |
- new NiceMock<AllocationTrackingContext3D>); |
- AllocationTrackingContext3D* context = context_owned.get(); |
- |
- FakeOutputSurfaceClient output_surface_client; |
- scoped_ptr<OutputSurface> output_surface( |
- FakeOutputSurface::Create3d(context_owned.Pass())); |
- CHECK(output_surface->BindToClient(&output_surface_client)); |
- |
- gfx::Size size(2, 2); |
- ResourceFormat format = RGBA_8888; |
- ResourceId id = 0; |
- int texture_id = 123; |
- |
- scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
- output_surface.get(), shared_bitmap_manager_.get(), |
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, |
- use_image_texture_targets_)); |
- |
- EXPECT_CALL(*context, NextTextureId()).WillRepeatedly(Return(texture_id)); |
- |
- id = resource_provider->CreateResource( |
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); |
- context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
- GL_INNOCENT_CONTEXT_RESET_ARB); |
- |
- resource_provider->AcquirePixelBuffer(id); |
- int stride; |
- void* buffer = resource_provider->MapPixelBuffer(id, &stride); |
- EXPECT_FALSE(buffer); |
- resource_provider->UnmapPixelBuffer(id); |
- Mock::VerifyAndClearExpectations(context); |
-} |
- |
TEST_P(ResourceProviderTest, Image_GLTexture) { |
// Only for GL textures. |
if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE) |