OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot | 30 from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot |
31 from webkitpy.common.net.web_mock import MockWeb | 31 from webkitpy.common.net.web_mock import MockWeb |
32 from webkitpy.common.system.systemhost_mock import MockSystemHost | 32 from webkitpy.common.system.systemhost_mock import MockSystemHost |
33 | 33 |
34 # New-style ports need to move down into webkitpy.common. | 34 # New-style ports need to move down into webkitpy.common. |
35 from webkitpy.layout_tests.port.factory import PortFactory | 35 from webkitpy.layout_tests.port.factory import PortFactory |
36 from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem | 36 from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem |
37 | 37 |
38 | 38 |
39 class MockHost(MockSystemHost): | 39 class MockHost(MockSystemHost): |
| 40 |
40 def __init__(self, log_executive=False, executive_throws_when_run=None, init
ialize_scm_by_default=True, web=None, scm=None): | 41 def __init__(self, log_executive=False, executive_throws_when_run=None, init
ialize_scm_by_default=True, web=None, scm=None): |
41 MockSystemHost.__init__(self, log_executive, executive_throws_when_run) | 42 MockSystemHost.__init__(self, log_executive, executive_throws_when_run) |
42 add_unit_tests_to_mock_filesystem(self.filesystem) | 43 add_unit_tests_to_mock_filesystem(self.filesystem) |
43 self.web = web or MockWeb() | 44 self.web = web or MockWeb() |
44 | 45 |
45 self._scm = scm | 46 self._scm = scm |
46 # FIXME: we should never initialize the SCM by default, since the real | 47 # FIXME: we should never initialize the SCM by default, since the real |
47 # object doesn't either. This has caused at least one bug (see bug 89498
). | 48 # object doesn't either. This has caused at least one bug (see bug 89498
). |
48 if initialize_scm_by_default: | 49 if initialize_scm_by_default: |
49 self.initialize_scm() | 50 self.initialize_scm() |
(...skipping 13 matching lines...) Expand all Loading... |
63 def scm(self): | 64 def scm(self): |
64 return self._scm | 65 return self._scm |
65 | 66 |
66 def scm_for_path(self, path): | 67 def scm_for_path(self, path): |
67 # FIXME: consider supporting more than one SCM so that we can do more co
mprehensive testing. | 68 # FIXME: consider supporting more than one SCM so that we can do more co
mprehensive testing. |
68 self.initialize_scm() | 69 self.initialize_scm() |
69 return self._scm | 70 return self._scm |
70 | 71 |
71 def checkout(self): | 72 def checkout(self): |
72 return self._checkout | 73 return self._checkout |
OLD | NEW |