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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py

Issue 2174073002: Adds functionality to update-w3c-test-expectations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor change Created 4 years, 5 months 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/w3c/update_w3c_test_expectations_unittest.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/w3c/update_w3c_test_expectations.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
index 8852701176a63cce0b171c8a58d11455c05990e1..f74cfec2b08689fa8df3ffc05eaaa330ce405045 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py
@@ -230,11 +230,12 @@ class W3CExpectationsLineAdder(object):
to LayoutTest/TestExpectations. Checks the file for the string
'# Tests added from W3C auto import bot' and writes expectation
lines directly under it. If not found, it writes to the end of
- the file.
+ the file. If the test name is already in LayoutTests/TestExpectations,
+ the line will be skipped.
Args:
host: A Host object.
- path: The path to the file LayoutTest/TestExpectations.
+ path: The path to the file LayoutTests/TestExpectations.
line_list: A list of w3c test expectations lines.
Returns:
@@ -245,6 +246,10 @@ class W3CExpectationsLineAdder(object):
w3c_comment_line_index = file_contents.find(comment_line)
all_lines = ''
for line in line_list:
+ end_bracket_index = line.split().index(']')
+ test_name = line.split()[end_bracket_index + 1]
+ if test_name in file_contents:
+ continue
all_lines += str(line) + '\n'
all_lines = all_lines[:-1]
if w3c_comment_line_index == -1:
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698