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.w3c.chromium_wpt import ChromiumWPT | |
| 7 from webkitpy.common.host_mock import MockHost | |
| 8 from webkitpy.common.system.executive_mock import MockExecutive2 | |
| 9 from webkitpy.common.system.filesystem_mock import MockFileSystem | |
| 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 '\n'.join([ | |
|
foolip
2016/11/02 13:15:32
Did some lint script complain about """ without a
jeffcarp
2016/11/03 22:33:00
No, it was has_changes_in_wpt that couldn't handle
| |
| 19 'something/something.html', | |
| 20 'third_party/WebKit/LayoutTests/imported/wpt/something.html', | |
| 21 ]) | |
| 22 | |
| 23 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 24 host.filesystem = MockFileSystem() | |
| 25 local_wpt = ChromiumWPT(host) | |
| 26 | |
| 27 self.assertTrue(local_wpt.has_changes_in_wpt('sha')) | |
| 28 | |
| 29 def test_has_changes_in_wpt_looks_at_start_of_string(self): | |
| 30 host = MockHost() | |
| 31 | |
| 32 def run_command_fn(_): | |
| 33 return """ | |
|
foolip
2016/11/02 13:15:33
These and the following in the same style as the f
foolip
2016/11/03 23:40:31
Wait, now missing newlines? (On phone, can't seem
jeffcarp
2016/11/03 23:54:07
Yes, sorry maybe I'm confused. I thought you said
| |
| 34 something/something.html | |
| 35 something/third_party/WebKit/LayoutTests/imported/wpt/something. html | |
| 36 """ | |
| 37 | |
| 38 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 39 host.filesystem = MockFileSystem() | |
| 40 local_wpt = ChromiumWPT(host) | |
| 41 | |
| 42 self.assertFalse(local_wpt.has_changes_in_wpt('sha')) | |
| 43 | |
| 44 def test_has_changes_in_wpt_does_not_count_expectation_files(self): | |
| 45 host = MockHost() | |
| 46 | |
| 47 def run_command_fn(_): | |
| 48 return """ | |
| 49 something/something.html | |
| 50 third_party/WebKit/LayoutTests/imported/wpt/something-expected.h tml | |
| 51 -expected.html | |
|
foolip
2016/11/02 13:15:32
Copypasta, should have been like above but with .t
jeffcarp
2016/11/03 22:33:00
Oops thanks for catching this!
| |
| 52 """ | |
| 53 | |
| 54 host.executive = MockExecutive2(run_command_fn=run_command_fn) | |
| 55 host.filesystem = MockFileSystem() | |
| 56 local_wpt = ChromiumWPT(host) | |
| 57 | |
| 58 self.assertFalse(local_wpt.has_changes_in_wpt('sha')) | |
| OLD | NEW |