| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2017 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 |
| 7 from webkitpy.common.host_mock import MockHost |
| 8 from webkitpy.w3c.wpt_manifest import WPTManifest |
| 9 |
| 10 |
| 11 class WPTManifestUnitTest(unittest.TestCase): |
| 12 |
| 13 def test_ensure_manifest_copies_new_manifest(self): |
| 14 host = MockHost() |
| 15 manifest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/
wpt/MANIFEST.json' |
| 16 |
| 17 self.assertFalse(host.filesystem.exists(manifest_path)) |
| 18 WPTManifest.ensure_manifest(host) |
| 19 self.assertTrue(host.filesystem.exists(manifest_path)) |
| 20 |
| 21 webkit_base = '/mock-checkout/third_party/WebKit' |
| 22 self.assertEqual( |
| 23 host.executive.calls, |
| 24 [ |
| 25 [ |
| 26 'python', |
| 27 webkit_base + '/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/ma
nifest', |
| 28 '--work', |
| 29 '--tests-root', |
| 30 webkit_base + '/LayoutTests/external/wpt', |
| 31 ] |
| 32 ] |
| 33 ) |
| 34 |
| 35 def test_ensure_manifest_updates_manifest_if_it_exists(self): |
| 36 host = MockHost() |
| 37 manifest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/
wpt/MANIFEST.json' |
| 38 |
| 39 host.filesystem.write_binary_file(manifest_path, '{}') |
| 40 self.assertTrue(host.filesystem.exists(manifest_path)) |
| 41 |
| 42 WPTManifest.ensure_manifest(host) |
| 43 self.assertTrue(host.filesystem.exists(manifest_path)) |
| 44 |
| 45 webkit_base = '/mock-checkout/third_party/WebKit' |
| 46 self.assertEqual( |
| 47 host.executive.calls, |
| 48 [ |
| 49 [ |
| 50 'python', |
| 51 webkit_base + '/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/ma
nifest', |
| 52 '--work', |
| 53 '--tests-root', |
| 54 webkit_base + '/LayoutTests/external/wpt', |
| 55 ] |
| 56 ] |
| 57 ) |
| OLD | NEW |