Title: [93345] trunk/Tools
Revision
93345
Author
[email protected]
Date
2011-08-18 13:36:17 -0700 (Thu, 18 Aug 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=47240

Fixed a cygwin path problem in the chromium port of diff_image;
Also made the return values of the diff_image function more consistent.

Patch by Shawn Singh <[email protected]> on 2011-08-18
Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/chromium.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (93344 => 93345)


--- trunk/Tools/ChangeLog	2011-08-18 20:32:55 UTC (rev 93344)
+++ trunk/Tools/ChangeLog	2011-08-18 20:36:17 UTC (rev 93345)
@@ -1,3 +1,14 @@
+2011-08-18  Shawn Singh  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=47240
+
+        Fixed a cygwin path problem in the chromium port of diff_image;
+        Also made the return values of the diff_image function more consistent.
+
+        Reviewed by Dirk Pranke.
+
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+
 2011-08-17  Alejandro G. Castro  <[email protected]>
 
         [GTK] Fix compilation problems with deprecations in gtk+

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (93344 => 93345)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-08-18 20:32:55 UTC (rev 93344)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-08-18 20:36:17 UTC (rev 93345)
@@ -162,10 +162,14 @@
 
     def diff_image(self, expected_contents, actual_contents):
         # FIXME: need unit tests for this.
+
+        # If only one of them exists, return that one.
         if not actual_contents and not expected_contents:
-            return False
-        if not actual_contents or not expected_contents:
-            return True
+            return None
+        if not actual_contents:
+            return expected_contents
+        if not expected_contents:
+            return actual_contents
 
         tempdir = self._filesystem.mkdtemp()
 
@@ -177,8 +181,12 @@
 
         diff_filename = self._filesystem.join(str(tempdir), "diff.png")
 
+        native_expected_filename = self._convert_path(expected_filename)
+        native_actual_filename = self._convert_path(actual_filename)
+        native_diff_filename = self._convert_path(diff_filename)
+
         executable = self._path_to_image_diff()
-        comand = [executable, '--diff', expected_filename, actual_filename, diff_filename]
+        comand = [executable, '--diff', native_actual_filename, native_expected_filename, native_diff_filename]
 
         result = None
         try:
@@ -188,11 +196,10 @@
                 result = None
             elif exit_code != 1:
                 _log.error("image diff returned an exit code of %s" % exit_code)
-                # Returning False here causes the script to think that we
-                # successfully created the diff even though we didn't.  If
-                # we return True, we think that the images match but the hashes
-                # don't match.
-                # FIXME: Figure out why image_diff returns other values.
+                # Returning None here causes the script to think that we
+                # successfully created the diff even though we didn't.
+                # FIXME: Consider raising an exception here, so that the error
+                # is not accidentally overlooked while the test passes.
                 result = None
         except OSError, e:
             if e.errno == errno.ENOENT or e.errno == errno.EACCES:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to