Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: testing/tools/pngdiffer.py

Issue 1072613003: Consider platform-specific expected .png files. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/SUPPRESSIONS_win ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/pngdiffer.py
diff --git a/testing/tools/pngdiffer.py b/testing/tools/pngdiffer.py
index dc65b4717f428a12f204d69afb3dd98cd3b1f915..7a7e8ddbc63f4590aacc7f18d7a0fb6af37226ff 100755
--- a/testing/tools/pngdiffer.py
+++ b/testing/tools/pngdiffer.py
@@ -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
« no previous file with comments | « testing/SUPPRESSIONS_win ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698