mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1191114 (Part 3) - Add flags to image test cases. r=tn
This commit is contained in:
parent
dc9d155e39
commit
15e076ac81
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user