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

Side by Side Diff: build/android/pylib/base/base_test_runner.py

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/base/base_test_result.py ('k') | build/android/pylib/constants.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Base class for running tests on a single device.""" 5 """Base class for running tests on a single device."""
6 6
7 # TODO(jbudorick) Deprecate and remove this class and all subclasses after 7 # TODO(jbudorick) Deprecate and remove this class and all subclasses after
8 # any relevant parts have been ported to the new environment + test instance 8 # any relevant parts have been ported to the new environment + test instance
9 # model. 9 # model.
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 Returns: 63 Returns:
64 Tuple containing: 64 Tuple containing:
65 (base_test_result.TestRunResults, tests to rerun or None) 65 (base_test_result.TestRunResults, tests to rerun or None)
66 """ 66 """
67 raise NotImplementedError 67 raise NotImplementedError
68 68
69 def InstallTestPackage(self): 69 def InstallTestPackage(self):
70 """Installs the test package once before all tests are run.""" 70 """Installs the test package once before all tests are run."""
71 pass 71 pass
72 72
73 def PushDataDeps(self):
74 """Push all data deps to device once before all tests are run."""
75 pass
76
77 def SetUp(self): 73 def SetUp(self):
78 """Run once before all tests are run.""" 74 """Run once before all tests are run."""
79 self.InstallTestPackage() 75 self.InstallTestPackage()
80 self.PushDataDeps()
81 76
82 def TearDown(self): 77 def TearDown(self):
83 """Run once after all tests are run.""" 78 """Run once after all tests are run."""
84 self.ShutdownHelperToolsForTestSuite() 79 self.ShutdownHelperToolsForTestSuite()
85 if self._cleanup_test_files: 80 if self._cleanup_test_files:
86 self.device.old_interface.RemovePushedFiles() 81 self.device.old_interface.RemovePushedFiles()
87 82
88 def LaunchTestHttpServer(self, document_root, port=None, 83 def LaunchTestHttpServer(self, document_root, port=None,
89 extra_config_contents=None): 84 extra_config_contents=None):
90 """Launches an HTTP server to serve HTTP tests. 85 """Launches an HTTP server to serve HTTP tests.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 # will be left open even after the forwarder has been killed. 132 # will be left open even after the forwarder has been killed.
138 if not ports.IsDevicePortUsed(self.device, self._forwarder_device_port): 133 if not ports.IsDevicePortUsed(self.device, self._forwarder_device_port):
139 self._ForwardPortsForHttpServer() 134 self._ForwardPortsForHttpServer()
140 135
141 def ShutdownHelperToolsForTestSuite(self): 136 def ShutdownHelperToolsForTestSuite(self):
142 """Shuts down the server and the forwarder.""" 137 """Shuts down the server and the forwarder."""
143 if self._http_server: 138 if self._http_server:
144 self._UnmapPorts([(self._forwarder_device_port, self._http_server.port)]) 139 self._UnmapPorts([(self._forwarder_device_port, self._http_server.port)])
145 self._http_server.ShutdownHttpServer() 140 self._http_server.ShutdownHttpServer()
146 141
OLDNEW
« no previous file with comments | « build/android/pylib/base/base_test_result.py ('k') | build/android/pylib/constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698