2010-09-22 Dirk Pranke <dpranke@chromium.org>
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2010 21:56:20 +0000 (21:56 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2010 21:56:20 +0000 (21:56 +0000)
        Unreviewed, build fix.

        Fix bustage of rebaseline-chromium-webkit-tests resulting from
        r67974. Really need better unit tests for this tool :(

        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:

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

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py

index eaf3890..adb6109 100644 (file)
@@ -1,3 +1,12 @@
+2010-09-22  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        Fix bustage of rebaseline-chromium-webkit-tests resulting from
+        r67974. Really need better unit tests for this tool :(
+
+        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
 2010-09-22  Adam Roben  <aroben@apple.com>
 
         Unbreak test-webkitpy
index cdf3bca..e57ceb2 100644 (file)
@@ -518,12 +518,15 @@ class Rebaseliner(object):
                 fallback_fullpath = os.path.normpath(
                     os.path.join(fallback_dir, fallback_file))
                 if fallback_fullpath.lower() != baseline_path.lower():
-                    with codecs.open(file1, "r", "utf8") as file_handle1:
-                        output1 = file_handle1.read()
-                    with codecs.open(file2, "r", "utf8") as file_handle2:
-                        output2 = file_handle2.read()
-                    if not self._diff_baselines(new_baseline,
-                                                fallback_fullpath):
+                    with codecs.open(new_baseline, "r",
+                                     None) as file_handle1:
+                        new_output = file_handle1.read()
+                    with codecs.open(fallback_fullpath, "r",
+                                     None) as file_handle2:
+                        fallback_output = file_handle2.read()
+                    is_image = baseline_path.lower().endswith('.png')
+                    if not self._diff_baselines(new_output, fallback_output,
+                                                is_image):
                         _log.info('  Found same baseline at %s',
                                   fallback_fullpath)
                         return True
@@ -586,7 +589,7 @@ class Rebaseliner(object):
             # Or is new_expectations always a byte array?
             with open(path, "w") as file:
                 file.write(new_expectations)
-            self._scm.add(path)
+            self._scm.add(path)
         else:
             _log.info('No test was rebaselined so nothing to remove.')
 
@@ -730,7 +733,7 @@ class HtmlGenerator(object):
         """Launch the rebaselining html in brwoser."""
 
         _log.info('Launching html: "%s"', self._html_file)
-        user.open_url(self._html_file)
+        user.User().open_url(self._html_file)
         _log.info('Html launched.')
 
     def _generate_baseline_links(self, test_basename, suffix, platform):