| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
|
| index 20fd78e95d0ca610e65321d6f5347196b99bc79d..724c3a23e6f2a22233e46a6d2363f4644aa42c47 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
|
| @@ -5,7 +5,7 @@
|
| import unittest
|
| from webkitpy.common.host_mock import MockHost
|
| from webkitpy.common.system.executive_mock import MockExecutive2
|
| -from webkitpy.w3c.chromium_commit import ChromiumCommit
|
| +from webkitpy.w3c.chromium_commit import ChromiumCommit, WPT_DIR
|
|
|
|
|
| class ChromiumCommitTest(unittest.TestCase):
|
| @@ -24,3 +24,31 @@ class ChromiumCommitTest(unittest.TestCase):
|
|
|
| self.assertEqual(chromium_commit.position, 'refs/heads/master@{#789}')
|
| self.assertEqual(chromium_commit.sha, 'deadbeefcafe')
|
| +
|
| + def test_filtered_changed_files_blacklist(self):
|
| + host = MockHost()
|
| +
|
| + fake_files = ['file1', 'MANIFEST.json', 'file3']
|
| + qualified_fake_files = [WPT_DIR + f for f in fake_files]
|
| +
|
| + stub_commands = {
|
| + 'diff-tree': '\n'.join(qualified_fake_files),
|
| + 'crrev-parse': 'fake rev',
|
| + }
|
| +
|
| + def mock_command(args):
|
| + if args[1] in stub_commands:
|
| + return stub_commands[args[1]]
|
| + else:
|
| + raise Exception('Unexpected command called: %s' % args)
|
| +
|
| + host.executive = MockExecutive2(run_command_fn=mock_command)
|
| + pos = 'Cr-Commit-Position: refs/heads/master@{#789}'
|
| + chromium_commit = ChromiumCommit(host, position=pos)
|
| +
|
| + files = chromium_commit.filtered_changed_files()
|
| +
|
| + expected_files = ['file1', 'file3']
|
| + qualified_expected_files = [WPT_DIR + f for f in expected_files]
|
| +
|
| + self.assertEqual(files, qualified_expected_files)
|
|
|