| 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)
|
|
|