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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..af9be8dd3a99156aedf13003e723c708e2091e50 |
| --- /dev/null |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py |
| @@ -0,0 +1,52 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import unittest |
| +from webkitpy.common.host_mock import MockHost |
| +from webkitpy.common.system.executive_mock import MockExecutive2 |
| +from webkitpy.common.system.filesystem_mock import MockFileSystem |
| +from webkitpy.w3c.chromium_wpt import ChromiumWPT |
| + |
| + |
| +class ChromiumWPTTest(unittest.TestCase): |
| + |
| + def test_has_changes_in_wpt(self): |
| + host = MockHost() |
| + |
| + def run_command_fn(_): |
| + return ("something/something.html\n" |
| + "third_party/WebKit/LayoutTests/imported/wpt/something.html\n") |
| + |
| + host.executive = MockExecutive2(run_command_fn=run_command_fn) |
| + host.filesystem = MockFileSystem() |
|
qyearsley
2016/11/04 17:40:32
In these three tests, I would expect that they wor
|
| + local_wpt = ChromiumWPT(host) |
|
qyearsley
2016/11/04 17:40:32
I think I'd expect this variable be called chromiu
|
| + |
| + self.assertTrue(local_wpt.has_changes_in_wpt('sha')) |
| + |
| + def test_has_changes_in_wpt_looks_at_start_of_string(self): |
| + host = MockHost() |
| + |
| + def run_command_fn(_): |
| + return ("something/something.html" |
| + "something/third_party/WebKit/LayoutTests/imported/wpt/something.html") |
| + |
| + host.executive = MockExecutive2(run_command_fn=run_command_fn) |
| + host.filesystem = MockFileSystem() |
| + local_wpt = ChromiumWPT(host) |
| + |
| + self.assertFalse(local_wpt.has_changes_in_wpt('sha')) |
| + |
| + def test_has_changes_in_wpt_does_not_count_expectation_files(self): |
| + host = MockHost() |
| + |
| + def run_command_fn(_): |
| + return ("something/something.html" |
| + "third_party/WebKit/LayoutTests/imported/wpt/something-expected.html" |
| + "-expected.txt") |
| + |
| + host.executive = MockExecutive2(run_command_fn=run_command_fn) |
| + host.filesystem = MockFileSystem() |
| + local_wpt = ChromiumWPT(host) |
| + |
| + self.assertFalse(local_wpt.has_changes_in_wpt('sha')) |