OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import unittest | 5 import unittest |
6 from webkitpy.common.host_mock import MockHost | 6 from webkitpy.common.host_mock import MockHost |
7 from webkitpy.common.system.executive_mock import MockExecutive2 | 7 from webkitpy.common.system.executive_mock import MockExecutive2 |
8 from webkitpy.w3c.chromium_commit import ChromiumCommit | 8 from webkitpy.w3c.chromium_commit import ChromiumCommit |
9 from webkitpy.w3c.test_exporter import CHROMIUM_WPT_DIR | |
10 from webkitpy.w3c.test_exporter_unittest import mock_command_exec | 9 from webkitpy.w3c.test_exporter_unittest import mock_command_exec |
11 | 10 |
| 11 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/imported/wpt/' |
| 12 |
12 | 13 |
13 class ChromiumCommitTest(unittest.TestCase): | 14 class ChromiumCommitTest(unittest.TestCase): |
14 | 15 |
15 def test_accepts_sha(self): | 16 def test_accepts_sha(self): |
16 chromium_commit = ChromiumCommit(MockHost(), sha='deadbeefcafe') | 17 chromium_commit = ChromiumCommit(MockHost(), sha='deadbeefcafe') |
17 | 18 |
18 self.assertEqual(chromium_commit.sha, 'deadbeefcafe') | 19 self.assertEqual(chromium_commit.sha, 'deadbeefcafe') |
19 self.assertIsNone(chromium_commit.position) | 20 self.assertIsNone(chromium_commit.position) |
20 | 21 |
21 def test_derives_sha_from_position(self): | 22 def test_derives_sha_from_position(self): |
(...skipping 18 matching lines...) Expand all Loading... |
40 | 41 |
41 position_footer = 'Cr-Commit-Position: refs/heads/master@{#789}' | 42 position_footer = 'Cr-Commit-Position: refs/heads/master@{#789}' |
42 chromium_commit = ChromiumCommit(host, position=position_footer) | 43 chromium_commit = ChromiumCommit(host, position=position_footer) |
43 | 44 |
44 files = chromium_commit.filtered_changed_files() | 45 files = chromium_commit.filtered_changed_files() |
45 | 46 |
46 expected_files = ['file1', 'file3'] | 47 expected_files = ['file1', 'file3'] |
47 qualified_expected_files = [CHROMIUM_WPT_DIR + f for f in expected_files
] | 48 qualified_expected_files = [CHROMIUM_WPT_DIR + f for f in expected_files
] |
48 | 49 |
49 self.assertEqual(files, qualified_expected_files) | 50 self.assertEqual(files, qualified_expected_files) |
OLD | NEW |