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

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

Issue 2360893002: Update TestExpectations for removed/renamed tests when updating w3c tests. (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
index 0924e7160b144be5de351b3df7e0464c92746039..7609c46a83b8acd1253c58844f85409288b4b769 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py
@@ -12,6 +12,7 @@ from webkitpy.common.system.filesystem_mock import MockFileSystem
class DepsUpdaterTest(unittest.TestCase):
def test_is_manual_test_regular_test(self):
+ # TODO(qyearsley): Refactor these tests to re-use the MockFileSystem from the MockHost.
updater = DepsUpdater(MockHost())
fs = MockFileSystem()
dirname = '/mock-checkout/third_party/WebKit/LayoutTests/imported/wpt/a'
@@ -65,3 +66,24 @@ class DepsUpdaterTest(unittest.TestCase):
self.assertEqual(
updater.parse_directory_owners(data_file),
{'foo/bar': 'charizard@gmail.com', 'foo/baz': 'blastoise@gmail.com'})
+
+ def test_update_test_expectations(self):
+ host = MockHost()
+ host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations'] = (
+ 'Bug(test) some/test/a.html [ Failure ]\n'
+ 'Bug(test) some/test/b.html [ Failure ]\n'
+ 'Bug(test) some/test/c.html [ Failure ]\n')
+ host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests/VirtualTestSuites'] = '[]'
+ host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests/new/a.html'] = ''
+ host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests/new/b.html'] = ''
+ updater = DepsUpdater(host)
+ deleted_tests = ['some/test/b.html']
+ renamed_test_pairs = {
+ 'some/test/a.html': 'new/a.html',
+ 'some/test/c.html': 'new/c.html',
+ }
+ updater.update_test_expectations(deleted_tests, renamed_test_pairs)
+ self.assertMultiLineEqual(
+ host.filesystem.read_text_file('/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations'),
+ ('Bug(test) new/a.html [ Failure ]\n'
+ 'Bug(test) new/c.html [ Failure ]\n'))
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698