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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py

Issue 2580343003: Always use html_diff to generate -pretty-diff.html files. (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
index fece01aa563ccec68fa3c4600c98a280cd5398e8..fc70eec5f2f3f53fe7d4d5c937ef69eb0bb1873f 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
@@ -29,6 +29,7 @@
import logging
+from webkitpy.common.html_diff import html_diff
from webkitpy.layout_tests.controllers import repaint_overlay
from webkitpy.layout_tests.models import test_failures
@@ -113,7 +114,7 @@ class TestResultWriter(object):
FILENAME_SUFFIX_SAMPLE = "-sample"
FILENAME_SUFFIX_LEAK_LOG = "-leak-log"
FILENAME_SUFFIX_WDIFF = "-wdiff.html"
- FILENAME_SUFFIX_PRETTY_PATCH = "-pretty-diff.html"
+ FILENAME_SUFFIX_HTML_DIFF = "-pretty-diff.html"
FILENAME_SUFFIX_IMAGE_DIFF = "-diff.png"
FILENAME_SUFFIX_IMAGE_DIFFS_HTML = "-diffs.html"
FILENAME_SUFFIX_OVERLAY = "-overlay.html"
@@ -199,11 +200,10 @@ class TestResultWriter(object):
if not actual_text or not expected_text:
return
+ # Output a plain-text diff file.
file_type = '.txt'
actual_filename = self.output_filename(self.FILENAME_SUFFIX_ACTUAL + file_type)
expected_filename = self.output_filename(self.FILENAME_SUFFIX_EXPECTED + file_type)
- # We treat diff output as binary. Diff output may contain multiple files
- # in conflicting encodings.
diff = self._port.diff_text(expected_text, actual_text, expected_filename, actual_filename)
diff_filename = self.output_filename(self.FILENAME_SUFFIX_DIFF + file_type)
self._write_file(diff_filename, diff)
@@ -214,11 +214,10 @@ class TestResultWriter(object):
wdiff_filename = self.output_filename(self.FILENAME_SUFFIX_WDIFF)
self._write_file(wdiff_filename, wdiff)
- # Use WebKit's PrettyPatch.rb to get an HTML diff.
- if self._port.pretty_patch_available():
- pretty_patch = self._port.pretty_patch_text(diff_filename)
- pretty_patch_filename = self.output_filename(self.FILENAME_SUFFIX_PRETTY_PATCH)
- self._write_file(pretty_patch_filename, pretty_patch)
+ # Output a HTML diff file.
+ html_diff_filename = self.output_filename(self.FILENAME_SUFFIX_HTML_DIFF)
+ html_diff_contents = html_diff(expected_text, actual_text)
+ self._write_file(html_diff_filename, html_diff_contents)
def create_repaint_overlay_result(self, actual_text, expected_text):
html = repaint_overlay.generate_repaint_overlay_html(self._test_name, actual_text, expected_text)
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698