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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py

Issue 2878873002: webkitpy: Rename WebKitFinder to PathFinder (Closed)
Patch Set: Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 12 matching lines...) Expand all
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 from webkitpy.common.config.builders import BUILDERS 29 from webkitpy.common.config.builders import BUILDERS
30 from webkitpy.common.checkout.git_mock import MockGit 30 from webkitpy.common.checkout.git_mock import MockGit
31 from webkitpy.common.net.buildbot_mock import MockBuildBot 31 from webkitpy.common.net.buildbot_mock import MockBuildBot
32 from webkitpy.common.net.web_mock import MockWeb 32 from webkitpy.common.net.web_mock import MockWeb
33 from webkitpy.common.path_finder import PathFinder
33 from webkitpy.common.system.system_host_mock import MockSystemHost 34 from webkitpy.common.system.system_host_mock import MockSystemHost
34 from webkitpy.common.webkit_finder import WebKitFinder
35 35
36 # New-style ports need to move down into webkitpy.common. 36 # New-style ports need to move down into webkitpy.common.
37 from webkitpy.layout_tests.builder_list import BuilderList 37 from webkitpy.layout_tests.builder_list import BuilderList
38 from webkitpy.layout_tests.port.factory import PortFactory 38 from webkitpy.layout_tests.port.factory import PortFactory
39 from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem 39 from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem
40 40
41 41
42 class MockHost(MockSystemHost): 42 class MockHost(MockSystemHost):
43 43
44 def __init__(self, 44 def __init__(self,
(...skipping 26 matching lines...) Expand all
71 if path: 71 if path:
72 return MockGit(cwd=path, filesystem=self.filesystem, executive=self. executive, platform=self.platform) 72 return MockGit(cwd=path, filesystem=self.filesystem, executive=self. executive, platform=self.platform)
73 if not self._git: 73 if not self._git:
74 self._git = MockGit(filesystem=self.filesystem, executive=self.execu tive, platform=self.platform) 74 self._git = MockGit(filesystem=self.filesystem, executive=self.execu tive, platform=self.platform)
75 # Various pieces of code (wrongly) call filesystem.chdir(checkout_root). 75 # Various pieces of code (wrongly) call filesystem.chdir(checkout_root).
76 # Making the checkout_root exist in the mock filesystem makes that chdir not raise. 76 # Making the checkout_root exist in the mock filesystem makes that chdir not raise.
77 self.filesystem.maybe_make_directory(self._git.checkout_root) 77 self.filesystem.maybe_make_directory(self._git.checkout_root)
78 return self._git 78 return self._git
79 79
80 def _add_base_manifest_to_mock_filesystem(self, filesystem): 80 def _add_base_manifest_to_mock_filesystem(self, filesystem):
81 webkit_finder = WebKitFinder(filesystem) 81 path_finder = PathFinder(filesystem)
82 82
83 external_dir = webkit_finder.path_from_layout_tests('external') 83 external_dir = path_finder.path_from_layout_tests('external')
84 filesystem.maybe_make_directory(filesystem.join(external_dir, 'wpt')) 84 filesystem.maybe_make_directory(filesystem.join(external_dir, 'wpt'))
85 85
86 manifest_base_path = filesystem.join(external_dir, 'WPT_BASE_MANIFEST.js on') 86 manifest_base_path = filesystem.join(external_dir, 'WPT_BASE_MANIFEST.js on')
87 filesystem.files[manifest_base_path] = '{}' 87 filesystem.files[manifest_base_path] = '{}'
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698