Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py

Issue 2439153002: Script for exporting WPT (Closed)
Patch Set: Address most of CL feedback Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3cd69fa395f069c2a8f3af86a6bfd24a6dd87d37
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_wpt_unittest.py
@@ -0,0 +1,58 @@
+# 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.w3c.chromium_wpt import ChromiumWPT
+from webkitpy.common.host_mock import MockHost
+from webkitpy.common.system.executive_mock import MockExecutive2
+from webkitpy.common.system.filesystem_mock import MockFileSystem
+
+
+class ChromiumWPTTest(unittest.TestCase):
+
+ def test_has_changes_in_wpt(self):
+ host = MockHost()
+
+ def run_command_fn(_):
+ 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
+ 'something/something.html',
+ '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.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 """
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
+ 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.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!
+ """
+
+ 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'))

Powered by Google App Engine
This is Rietveld 408576698