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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py

Issue 2644783003: Regenerate MANIFEST.json when WPT tests are run (Closed)
Patch Set: Regenerate MANIFEST.json from template in run-webkit-tests Created 3 years, 10 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
index 7803e5b233037e7f6f652ae0d10d1e82ec362da9..5dfffbfa6f0c77eb87d21fe29b32af03881505a9 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
@@ -178,3 +178,32 @@ class ManagerTest(unittest.TestCase):
if not port.host.filesystem.exists(dir_name):
deleted_dir_count = deleted_dir_count + 1
self.assertEqual(deleted_dir_count, 5)
+
qyearsley 2017/02/28 18:54:45 As a convention, when explicitly testing protected
jeffcarp 2017/02/28 21:57:39 That sounds good. I'm testing the private method i
+ def test_ensure_manifest_copies_new_manifest(self):
+ host = MockHost()
+ port = host.port_factory.get('test-mac-mac10.10')
qyearsley 2017/02/28 18:54:45 If the test is not asserting anything that's port-
jeffcarp 2017/02/28 21:57:39 Done
+
+ self.assertFalse(port.host.filesystem.exists('/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json'))
+ manager = Manager(port, options=optparse.Values({'max_locked_shards': 1}), printer=FakePrinter())
+ manager._ensure_manifest() # pylint: disable=protected-access
+ self.assertTrue(port.host.filesystem.exists('/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json'))
+ self.assertEqual(port.host.executive.calls, [
foolip 2017/02/28 04:49:17 I don't understand this assert, leaving it to qyea
qyearsley 2017/02/28 18:54:45 This is asserting that one subprocess was invoked,
+ ['python',
+ '/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/manifest',
+ '--work', '--tests-root', '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt']])
qyearsley 2017/02/28 18:54:45 Nit: Optionally, you could also format this as som
jeffcarp 2017/02/28 21:57:39 Done
+
+ def test_ensure_manifest_updates_manifest_if_it_exists(self):
+ host = MockHost()
+ port = host.port_factory.get('test-mac-mac10.10')
+ manifest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json'
+
+ host.filesystem.write_binary_file(manifest_path, '{}')
+ self.assertTrue(port.host.filesystem.exists(manifest_path))
+
+ manager = Manager(port, options=optparse.Values({'max_locked_shards': 1}), printer=FakePrinter())
+ manager._ensure_manifest() # pylint: disable=protected-access
+ self.assertTrue(port.host.filesystem.exists(manifest_path))
+ self.assertEqual(port.host.executive.calls, [
+ ['python',
+ '/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/manifest',
+ '--work', '--tests-root', '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt']])

Powered by Google App Engine
This is Rietveld 408576698