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

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

Issue 2518313003: Refactor WPT Export to ensure only one PR in flight at a time (Closed)
Patch Set: Address CL feedback Created 4 years, 1 month 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/w3c/chromium_wpt_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py
index 0bc5361cc3d0766ab74a4fb4c140a33ca996dfb9..692a3658d05db3fd3db874abd0587f6a1f0cab4a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py
@@ -9,4 +9,61 @@ from webkitpy.w3c.chromium_wpt import ChromiumWPT
class ChromiumWPTTest(unittest.TestCase):
- pass
+
+ def test_exportable_commits_since(self):
+ host = MockHost()
+
+ def mock_command(args):
+ git_command = args[1]
+ if git_command == 'rev-list':
+ return 'badbeef8'
+ else:
+ return ''
+
+ host.executive = MockExecutive2(run_command_fn=mock_command)
+
+ chromium_wpt = ChromiumWPT(host)
+ commits = chromium_wpt.exportable_commits_since('3dadcafe')
+ self.assertEqual(len(commits), 1)
+
+ def test_ignores_commits_with_noexport_true(self):
+ host = MockHost()
+
+ return_vals = [
+ 'Commit message\nNOEXPORT=true', # show (message)
+ 'deadbeefcafe', # rev-list
+ 'third_party/WebKit/LayoutTests/imported/wpt', # rev-parse
+ ]
+ host.executive = MockExecutive2(run_command_fn=lambda _: return_vals.pop())
+
+ chromium_wpt = ChromiumWPT(host)
+ commits = chromium_wpt.exportable_commits_since('3dadcafe')
+ self.assertEqual(len(commits), 0)
+
+ def test_ignores_reverted_commits_with_noexport_true(self):
+ host = MockHost()
+
+ return_vals = [
+ 'Commit message\n> NOEXPORT=true', # show (message)
+ 'deadbeefcafe', # rev-list
+ 'third_party/WebKit/LayoutTests/imported/wpt', # rev-parse
+ ]
+ host.executive = MockExecutive2(run_command_fn=lambda _: return_vals.pop())
+
+ chromium_wpt = ChromiumWPT(host)
+ commits = chromium_wpt.exportable_commits_since('3dadcafe')
+ self.assertEqual(len(commits), 0)
+
+ def test_ignores_commits_that_start_with_import(self):
+ host = MockHost()
+
+ return_vals = [
+ 'Import rutabaga@deadbeef', # show (message)
+ 'deadbeefcafe', # rev-list
+ 'third_party/WebKit/LayoutTests/imported/wpt', # rev-parse
+ ]
+ host.executive = MockExecutive2(run_command_fn=lambda _: return_vals.pop())
+
+ chromium_wpt = ChromiumWPT(host)
+ commits = chromium_wpt.exportable_commits_since('3dadcafe')
+ self.assertEqual(len(commits), 0)
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt.py ('k') | third_party/WebKit/Tools/Scripts/webkitpy/w3c/github.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698