Index: chrome/browser/web_dev_style/test_util.py |
diff --git a/chrome/browser/web_dev_style/test_util.py b/chrome/browser/web_dev_style/test_util.py |
index a613d75d8e8e0af57a78334303fc3b33a4b842bf..503db37fe730a536b622373a73ca153873ff178b 100644 |
--- a/chrome/browser/web_dev_style/test_util.py |
+++ b/chrome/browser/web_dev_style/test_util.py |
@@ -6,5 +6,10 @@ |
def GetHighlight(line, error): |
"""Returns the substring of |line| that is highlighted in |error|.""" |
error_lines = error.split('\n') |
+ # TODO(dschuyler): Splitting the error on \n will prevent index(line) |
+ # from finding the line. As a workaround, return the whole, unfiltered |
+ # line. |
+ if line not in error_lines: |
+ return line |
highlight = error_lines[error_lines.index(line) + 1] |
return ''.join(ch1 for (ch1, ch2) in zip(line, highlight) if ch2 == '^') |