Bug 1191114 (Part 3) - Add flags to image test cases. r=tn

This commit is contained in:
Seth Fowler 2015-08-12 10:41:08 -07:00
parent dc9d155e39
commit 15e076ac81
3 changed files with 14 additions and 5 deletions

View File

@ -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()

View File

@ -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

View File

@ -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: