Index: ui/gl/gl_image_io_surface_unittest.cc |
diff --git a/ui/gl/gl_image_io_surface_unittest.cc b/ui/gl/gl_image_io_surface_unittest.cc |
index 487366fd8a1930d680455b319e89a7d5871d8952..2c14b2bce2428254498597a0a0a23484f3afcd00 100644 |
--- a/ui/gl/gl_image_io_surface_unittest.cc |
+++ b/ui/gl/gl_image_io_surface_unittest.cc |
@@ -14,10 +14,10 @@ |
namespace gl { |
namespace { |
-template <gfx::BufferFormat format> |
class GLImageIOSurfaceTestDelegate { |
public: |
scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, |
+ gfx::BufferFormat format, |
const uint8_t color[4]) const { |
scoped_refptr<GLImageIOSurface> image(new GLImageIOSurface( |
size, GLImageIOSurface::GetInternalFormatForTesting(format))); |
@@ -40,19 +40,42 @@ class GLImageIOSurfaceTestDelegate { |
return image; |
} |
+ |
+ static bool IsSupported(gfx::BufferFormat format) { |
+ switch (format) { |
+ case gfx::BufferFormat::RGBA_8888: |
+ case gfx::BufferFormat::BGRA_8888: |
+ case gfx::BufferFormat::YUV_420_BIPLANAR: |
+ return true; |
+ default: |
+ return false; |
+ } |
+ NOTREACHED(); |
+ return false; |
+ } |
}; |
-using GLImageTestTypes = testing::Types< |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; |
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
+ GLImageTest, |
+ GLImageIOSurfaceTestDelegate); |
-INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); |
+class GLImageIOSurfaceCopyTestDelegate : public GLImageIOSurfaceTestDelegate { |
+ public: |
+ static bool IsSupported(gfx::BufferFormat format) { |
+ switch (format) { |
+ case gfx::BufferFormat::YUV_420_BIPLANAR: |
+ return true; |
+ default: |
+ return false; |
+ } |
+ NOTREACHED(); |
+ return false; |
+ } |
+}; |
-INSTANTIATE_TYPED_TEST_CASE_P( |
- GLImageIOSurface, |
- GLImageCopyTest, |
- GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); |
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
+ GLImageCopyTest, |
+ GLImageIOSurfaceCopyTestDelegate); |
} // namespace |
} // namespace gl |