Chromium Code Reviews| 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..ee34e7e78039cc8470906a3bb434151f3c0514fa 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,47 @@ 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) |
|
foolip
2016/11/29 11:12:20
Also test a case with '> NOEXPORT=true' at the beg
jeffcarp
2016/11/29 19:00:48
Good catch thanks!
|
| + '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) |