summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-05-12 04:58:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-12 04:58:47 +0000
commit82cb80962bc6bf4450561e185f37eb133bc9d8e0 (patch)
tree5430902601e50fc2b9d2980fb48eaa380c21d699
parent47a4f418a86b67532efd483eeac3ba5f066b754c (diff)
downloadpdfium-chromium/3429.tar.xz
Prepare image comparison in safetynet_compare.py to work in nightly run.chromium/3429
Do not open the html in a browser automatically. Change-Id: I7394b86f4a46a701dedb4fa0887515211561aee7 Reviewed-on: https://pdfium-review.googlesource.com/32315 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
-rwxr-xr-xtesting/tools/safetynet_compare.py2
-rw-r--r--testing/tools/safetynet_image.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/testing/tools/safetynet_compare.py b/testing/tools/safetynet_compare.py
index 3c5cff86be..966910967e 100755
--- a/testing/tools/safetynet_compare.py
+++ b/testing/tools/safetynet_compare.py
@@ -116,7 +116,7 @@ class CompareRun(object):
('before', 'after'),
self.args.num_workers,
self.args.png_threshold)
- image_comparison.Run()
+ image_comparison.Run(open_in_browser=not self.args.machine_readable)
return 0
diff --git a/testing/tools/safetynet_image.py b/testing/tools/safetynet_image.py
index 28df3c582a..319eeb96be 100644
--- a/testing/tools/safetynet_image.py
+++ b/testing/tools/safetynet_image.py
@@ -52,7 +52,7 @@ class ImageComparison(object):
self.num_workers = num_workers
self.threshold = threshold_fraction * 100
- def Run(self):
+ def Run(self, open_in_browser):
"""Runs the comparison and generates an HTML with the results.
Returns:
@@ -94,7 +94,9 @@ class ImageComparison(object):
f.write('</table>')
f.write('</body></html>')
- webbrowser.open(html_path)
+ if open_in_browser:
+ webbrowser.open(html_path)
+
return 0
def _GenerateDiffs(self):