Consider platform-specific expected .png files.
authorTom Sepez <tsepez@chromium.org>
Thu, 9 Apr 2015 19:35:01 +0000 (12:35 -0700)
committerTom Sepez <tsepez@chromium.org>
Thu, 9 Apr 2015 19:35:01 +0000 (12:35 -0700)
Rolls DEPS to pull in the first windows-specific .png files, and
unsupresses the corresponding tests.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1072613003

DEPS
testing/SUPPRESSIONS_win
testing/tools/pngdiffer.py

diff --git a/DEPS b/DEPS
index 485460c..f75e983 100644 (file)
--- a/DEPS
+++ b/DEPS
@@ -5,7 +5,7 @@ deps = {
     "https://chromium.googlesource.com/external/gyp",
 
   "testing/corpus":
-     "https://pdfium.googlesource.com/pdfium_tests@2a28930b52cc8a01cc84c21e8c81a80d028e5548",
+     "https://pdfium.googlesource.com/pdfium_tests@e733fe1d98fad50c9b5f4023f08db429143b1291",
 
   "testing/gmock":
      "https://chromium.googlesource.com/external/googlemock.git@29763965ab52f24565299976b936d1265cb6a271",
index 084c22c..00687fa 100644 (file)
@@ -23,7 +23,5 @@ example_055.pdf
 example_065.pdf
 font_1_embedded_font_en_feature.pdf
 font_2_embedded_font_en_size14.pdf
-form_combobox_num.pdf
-form_combobox_per.pdf
 path_5_pattern.pdf
 test_m.pdf
index dc65b47..7a7e8dd 100755 (executable)
@@ -10,9 +10,11 @@ import sys
 class PNGDiffer():
   ACTUAL_TEMPLATE = '.pdf.%d.png'
   EXPECTED_TEMPLATE = '_expected' + ACTUAL_TEMPLATE
+  PLATFORM_EXPECTED_TEMPLATE = '_expected_%s' + ACTUAL_TEMPLATE
 
   def __init__(self, finder):
     self.pdfium_diff_path = finder.ExecutablePath('pdfium_diff')
+    self.os_name = finder.os_name
 
   def HasDifferences(self, input_filename, source_dir, working_dir):
     input_root, _ = os.path.splitext(input_filename)
@@ -20,12 +22,18 @@ class PNGDiffer():
         working_dir, input_root + self.ACTUAL_TEMPLATE)
     expected_path_template = os.path.join(
         source_dir, input_root + self.EXPECTED_TEMPLATE)
+    platform_expected_path_template = os.path.join(
+        source_dir, input_root + self.PLATFORM_EXPECTED_TEMPLATE)
     i = 0
     try:
       while True:
-        actual_path = actual_path_template % i;
-        expected_path = expected_path_template % i;
-        if not os.path.exists(expected_path):
+        actual_path = actual_path_template % i
+        expected_path = expected_path_template % i
+        platform_expected_path = (
+            platform_expected_path_template % (self.os_name, i))
+        if os.path.exists(platform_expected_path):
+          expected_path = platform_expected_path
+        elif not os.path.exists(expected_path):
           if i == 0:
             print "WARNING: no expected results files for " + input_filename
           break