Commit b62f6346 authored by qyearsley's avatar qyearsley Committed by Commit bot

In update_w3c_test_expectations, do nothing when there are no new lines to add.

BUG=647395

Review-Url: https://codereview.chromium.org/2338293004
Cr-Commit-Position: refs/heads/master@{#419257}
parent a62168c5
...@@ -271,6 +271,8 @@ class W3CExpectationsLineAdder(object): ...@@ -271,6 +271,8 @@ class W3CExpectationsLineAdder(object):
file_contents = self.host.filesystem.read_text_file(expectations_file_path) file_contents = self.host.filesystem.read_text_file(expectations_file_path)
marker_comment_index = file_contents.find(marker_comment) marker_comment_index = file_contents.find(marker_comment)
line_list = [line for line in line_list if self._test_name_from_expectation_string(line) not in file_contents] line_list = [line for line in line_list if self._test_name_from_expectation_string(line) not in file_contents]
if not line_list:
return
if marker_comment_index == -1: if marker_comment_index == -1:
file_contents += '\n%s\n' % marker_comment file_contents += '\n%s\n' % marker_comment
file_contents += '\n'.join(line_list) file_contents += '\n'.join(line_list)
......
...@@ -226,7 +226,6 @@ class UpdateW3CTestExpectationsTest(logtesting.LoggingTestCase): ...@@ -226,7 +226,6 @@ class UpdateW3CTestExpectationsTest(logtesting.LoggingTestCase):
self.assertMultiLineEqual( self.assertMultiLineEqual(
value, value,
('# Tests added from W3C auto import bot\n' ('# Tests added from W3C auto import bot\n'
'\n'
'crbug.com/123 [ FakePlatform ] fake/file/path.html [ Pass ]\n')) 'crbug.com/123 [ FakePlatform ] fake/file/path.html [ Pass ]\n'))
def test_is_js_test_true(self): def test_is_js_test_true(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment