Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py |
index 8a211699dcb9fff6fd932666e19fd336a43042c2..8455ba5155cc205801c226f16688fd6865cf21c1 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py |
@@ -517,36 +517,6 @@ class Port(object): |
return (result, err_str or None) |
- def diff_text(self, expected_text, actual_text, expected_filename, actual_filename): |
- """Returns a string containing the diff of the two text strings |
- in 'unified diff' format. |
- """ |
- |
- # The filenames show up in the diff output, make sure they're |
- # raw bytes and not unicode, so that they don't trigger join() |
- # trying to decode the input. |
- def to_raw_bytes(string_value): |
- if isinstance(string_value, unicode): |
- return string_value.encode('utf-8') |
- return string_value |
- expected_filename = to_raw_bytes(expected_filename) |
- actual_filename = to_raw_bytes(actual_filename) |
- diff = difflib.unified_diff(expected_text.splitlines(True), |
- actual_text.splitlines(True), |
- expected_filename, |
- actual_filename) |
- |
- # The diff generated by the difflib is incorrect if one of the files |
- # does not have a newline at the end of the file and it is present in |
- # the diff. Relevant Python issue: http://bugs.python.org/issue2142 |
- def diff_fixup(diff): |
- for line in diff: |
- yield line |
- if not line.endswith('\n'): |
- yield '\n\\ No newline at end of file\n' |
- |
- return ''.join(diff_fixup(diff)) |
- |
def driver_name(self): |
if self.get_option('driver_name'): |
return self.get_option('driver_name') |