diff --git a/image/test/gtest/Common.cpp b/image/test/gtest/Common.cpp index 0cd30c61ce8..c310493c479 100644 --- a/image/test/gtest/Common.cpp +++ b/image/test/gtest/Common.cpp @@ -126,7 +126,7 @@ ImageTestCase GreenGIFTestCase() ImageTestCase GreenJPGTestCase() { return ImageTestCase("green.jpg", "image/jpeg", IntSize(100, 100), - /* aFuzzy = */ true); + TEST_CASE_IS_FUZZY); } ImageTestCase GreenBMPTestCase() diff --git a/image/test/gtest/Common.h b/image/test/gtest/Common.h index b9d8efa8142..b70a3e6aac3 100644 --- a/image/test/gtest/Common.h +++ b/image/test/gtest/Common.h @@ -17,22 +17,30 @@ namespace mozilla { // Types /////////////////////////////////////////////////////////////////////////////// +enum TestCaseFlags +{ + TEST_CASE_DEFAULT_FLAGS = 0, + TEST_CASE_IS_FUZZY = 1 << 0, + TEST_CASE_IS_TRANSPARENT = 1 << 1, + TEST_CASE_HAS_ERROR = 1 << 2 +}; + struct ImageTestCase { ImageTestCase(const char* aPath, const char* aMimeType, gfx::IntSize aSize, - bool aFuzzy = false) + uint32_t aFlags = TEST_CASE_DEFAULT_FLAGS) : mPath(aPath) , mMimeType(aMimeType) , mSize(aSize) - , mFuzzy(aFuzzy) + , mFlags(aFlags) { } const char* mPath; const char* mMimeType; gfx::IntSize mSize; - bool mFuzzy; + uint32_t mFlags; }; struct BGRAColor diff --git a/image/test/gtest/TestDecodeToSurface.cpp b/image/test/gtest/TestDecodeToSurface.cpp index 5a4696f8cdb..f48cff6906e 100644 --- a/image/test/gtest/TestDecodeToSurface.cpp +++ b/image/test/gtest/TestDecodeToSurface.cpp @@ -61,7 +61,8 @@ public: surface->GetFormat() == SurfaceFormat::B8G8R8A8); EXPECT_EQ(mTestCase.mSize, surface->GetSize()); - EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green(), mTestCase.mFuzzy)); + EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green(), + mTestCase.mFlags & TEST_CASE_IS_FUZZY)); } private: