Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import unittest | |
| 6 from webkitpy.common.host_mock import MockHost | |
| 7 from webkitpy.common.system.executive_mock import MockExecutive2 | |
| 8 from webkitpy.common.system.filesystem_mock import MockFileSystem | |
| 9 from webkitpy.w3c.chromium_wpt import ChromiumWPT | |
| 10 | |
| 11 | |
| 12 class ChromiumWPTTest(unittest.TestCase): | |
| 13 | |
| 14 def test_has_changes_in_wpt(self): | |
| 15 host = MockHost() | |
| 16 | |
| 17 def run_command_fn(_): | |
| 18 return ("something/something.html\n" | |
| 19 "third_party/WebKit/LayoutTests/imported/wpt/something.html\ n") | |
| 20 | |
| 21 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 22 host.filesystem = MockFileSystem() | |
|
qyearsley
2016/11/04 17:40:32
In these three tests, I would expect that they wor
| |
| 23 local_wpt = ChromiumWPT(host) | |
|
qyearsley
2016/11/04 17:40:32
I think I'd expect this variable be called chromiu
| |
| 24 | |
| 25 self.assertTrue(local_wpt.has_changes_in_wpt('sha')) | |
| 26 | |
| 27 def test_has_changes_in_wpt_looks_at_start_of_string(self): | |
| 28 host = MockHost() | |
| 29 | |
| 30 def run_command_fn(_): | |
| 31 return ("something/something.html" | |
| 32 "something/third_party/WebKit/LayoutTests/imported/wpt/somet hing.html") | |
| 33 | |
| 34 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 35 host.filesystem = MockFileSystem() | |
| 36 local_wpt = ChromiumWPT(host) | |
| 37 | |
| 38 self.assertFalse(local_wpt.has_changes_in_wpt('sha')) | |
| 39 | |
| 40 def test_has_changes_in_wpt_does_not_count_expectation_files(self): | |
| 41 host = MockHost() | |
| 42 | |
| 43 def run_command_fn(_): | |
| 44 return ("something/something.html" | |
| 45 "third_party/WebKit/LayoutTests/imported/wpt/something-expec ted.html" | |
| 46 "-expected.txt") | |
| 47 | |
| 48 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 49 host.filesystem = MockFileSystem() | |
| 50 local_wpt = ChromiumWPT(host) | |
| 51 | |
| 52 self.assertFalse(local_wpt.has_changes_in_wpt('sha')) | |
| OLD | NEW |