summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/SUPPRESSIONS11
-rw-r--r--testing/embedder_test.cpp22
-rw-r--r--testing/embedder_test.h12
3 files changed, 43 insertions, 2 deletions
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index fd228f1b17..82b4af28aa 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -21,11 +21,22 @@
#
# Pixel tests
#
+# TODO(npm): Unsupress mac pixel tests
+bug_524043_1.in mac * *
+bug_524043_2.in mac * *
+bug_524043_3.in mac * *
+bug_524043_4.in mac * *
+bug_524043_5.in mac * *
+bug_524043_7.in mac * *
+bug_543018_1.in mac * *
+bug_543018_2.in mac * *
+bug_551258_1.in mac * *
font_size.in mac * *
#
# Corpus tests
#
+# TODO(npm): remove mac unexpected successes from suppressions
050_extra_m.pdf mac,win * *
12.pdf mac * *
1_10_watermark.pdf * * *
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 79074153fb..5d906fe503 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -355,6 +355,28 @@ void EmbedderTest::CompareBitmap(FPDF_BITMAP bitmap,
EXPECT_EQ(expected_md5sum, CRYPT_ToBase16(digest));
}
+// static
+void EmbedderTest::CompareBitmap2Options(FPDF_BITMAP bitmap,
+ int expected_width,
+ int expected_height,
+ const char* option1_md5sum,
+ const char* option2_md5sum) {
+ ASSERT_EQ(expected_width, FPDFBitmap_GetWidth(bitmap));
+ ASSERT_EQ(expected_height, FPDFBitmap_GetHeight(bitmap));
+ const int expected_stride = expected_width * 4;
+ ASSERT_EQ(expected_stride, FPDFBitmap_GetStride(bitmap));
+
+ if (!option1_md5sum || !option2_md5sum)
+ return;
+
+ uint8_t digest[16];
+ CRYPT_MD5Generate(static_cast<uint8_t*>(FPDFBitmap_GetBuffer(bitmap)),
+ expected_stride * expected_height, digest);
+ std::string digest_string = CRYPT_ToBase16(digest);
+ EXPECT_TRUE(digest_string == option1_md5sum ||
+ digest_string == option2_md5sum);
+}
+
// Can't use gtest-provided main since we need to stash the path to the
// executable in order to find the external V8 binary data files.
int main(int argc, char** argv) {
diff --git a/testing/embedder_test.h b/testing/embedder_test.h
index cc0caec8f6..f341acf688 100644
--- a/testing/embedder_test.h
+++ b/testing/embedder_test.h
@@ -105,14 +105,22 @@ class EmbedderTest : public ::testing::Test,
// is prohibited after this call is made.
virtual void UnloadPage(FPDF_PAGE page);
+ protected:
+ void SetupFormFillEnvironment();
+
// Check |bitmap| to make sure it has the right dimensions and content.
static void CompareBitmap(FPDF_BITMAP bitmap,
int expected_width,
int expected_height,
const char* expected_md5sum);
- protected:
- void SetupFormFillEnvironment();
+ // Check |bitmap| to make sure it has the right dimensions and content.
+ // Have two options for the expected md5 sum.
+ static void CompareBitmap2Options(FPDF_BITMAP bitmap,
+ int expected_width,
+ int expected_height,
+ const char* option1_md5sum,
+ const char* option2_md5sum);
Delegate* delegate_;
std::unique_ptr<Delegate> default_delegate_;