Unbreak webkitpy unit tests by checking for the existence of the image diff template
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Aug 2014 01:14:52 +0000 (01:14 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Aug 2014 01:14:52 +0000 (01:14 +0000)
file before trying to open it (as the tests do for results.html).

* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(TestResultWriter.write_image_diff_files):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py

index 00a67a8..151b2cc 100644 (file)
@@ -1,5 +1,13 @@
 2014-08-08  Simon Fraser  <simon.fraser@apple.com>
 
+        Unbreak webkitpy unit tests by checking for the existence of the image diff template
+        file before trying to open it (as the tests do for results.html).
+
+        * Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
+        (TestResultWriter.write_image_diff_files):
+
+2014-08-08  Simon Fraser  <simon.fraser@apple.com>
+
         Load the layout test result image diff HTML from a file, rather than having it inline in webkitpy
         https://bugs.webkit.org/show_bug.cgi?id=135780
 
index b444def..8cb841a 100644 (file)
@@ -169,7 +169,11 @@ class TestResultWriter(object):
         self._write_binary_file(diff_filename, image_diff)
 
         base_dir = self._port.path_from_webkit_base('LayoutTests', 'fast', 'harness')
-        image_diff_file = self._filesystem.read_text_file(self._filesystem.join(base_dir, 'image-diff-template.html'))
+        
+        image_diff_template = self._filesystem.join(base_dir, 'image-diff-template.html');
+        image_diff_file = ""
+        if self._filesystem.exists(image_diff_template):
+            image_diff_file = self._filesystem.read_text_file(image_diff_template)
 
         # FIXME: old-run-webkit-tests shows the diff percentage as the text contents of the "diff" link.
         # FIXME: old-run-webkit-tests include a link to the test file.