Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import collections | 5 import collections |
| 6 import itertools | 6 import itertools |
| 7 import os | 7 import os |
| 8 import posixpath | 8 import posixpath |
| 9 | 9 |
| 10 from devil.android import device_errors | 10 from devil.android import device_errors |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 def SetUp(self): | 233 def SetUp(self): |
| 234 @local_device_test_run.handle_shard_failures_with( | 234 @local_device_test_run.handle_shard_failures_with( |
| 235 on_failure=self._env.BlacklistDevice) | 235 on_failure=self._env.BlacklistDevice) |
| 236 def individual_device_set_up(dev): | 236 def individual_device_set_up(dev): |
| 237 def install_apk(): | 237 def install_apk(): |
| 238 # Install test APK. | 238 # Install test APK. |
| 239 self._delegate.Install(dev) | 239 self._delegate.Install(dev) |
| 240 | 240 |
| 241 def push_test_data(): | 241 def push_test_data(): |
| 242 # Push data dependencies. | 242 # Push data dependencies. |
| 243 external_storage = dev.GetExternalStoragePath() | 243 device_root = posixpath.join(dev.GetExternalStoragePath(), |
| 244 'chromium_tests_root') | |
|
jbudorick
2016/05/18 14:23:38
I still don't really like having this hard-coded b
agrieve
2016/05/19 02:11:53
I don't think manifest will work since tests can s
jbudorick
2016/05/24 19:13:52
I disagree, particularly with the regexp extractio
| |
| 244 data_deps = self._test_instance.GetDataDependencies() | 245 data_deps = self._test_instance.GetDataDependencies() |
| 245 host_device_tuples = [ | 246 host_device_tuples = [ |
| 246 (h, d if d is not None else external_storage) | 247 (h, d if d is not None else device_root) |
| 247 for h, d in data_deps] | 248 for h, d in data_deps] |
| 248 dev.PushChangedFiles(host_device_tuples) | 249 dev.PushChangedFiles(host_device_tuples, delete_device_stale=True) |
| 250 if not host_device_tuples: | |
| 251 dev.RunShellCommand(['rm', '-rf', device_root]) | |
|
jbudorick
2016/05/18 14:23:38
check_return=True here and below
agrieve
2016/05/19 02:11:53
Done.
| |
| 252 dev.RunShellCommand(['mkdir', '-p', device_root]) | |
| 249 | 253 |
| 250 def init_tool_and_start_servers(): | 254 def init_tool_and_start_servers(): |
| 251 tool = self.GetTool(dev) | 255 tool = self.GetTool(dev) |
| 252 tool.CopyFiles(dev) | 256 tool.CopyFiles(dev) |
| 253 tool.SetupEnvironment() | 257 tool.SetupEnvironment() |
| 254 | 258 |
| 255 self._servers[str(dev)] = [] | 259 self._servers[str(dev)] = [] |
| 256 if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER: | 260 if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER: |
| 257 self._servers[str(dev)].append( | 261 self._servers[str(dev)].append( |
| 258 local_test_server_spawner.LocalTestServerSpawner( | 262 local_test_server_spawner.LocalTestServerSpawner( |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 def TearDown(self): | 360 def TearDown(self): |
| 357 @local_device_test_run.handle_shard_failures | 361 @local_device_test_run.handle_shard_failures |
| 358 def individual_device_tear_down(dev): | 362 def individual_device_tear_down(dev): |
| 359 for s in self._servers.get(str(dev), []): | 363 for s in self._servers.get(str(dev), []): |
| 360 s.TearDown() | 364 s.TearDown() |
| 361 | 365 |
| 362 tool = self.GetTool(dev) | 366 tool = self.GetTool(dev) |
| 363 tool.CleanUpEnvironment() | 367 tool.CleanUpEnvironment() |
| 364 | 368 |
| 365 self._env.parallel_devices.pMap(individual_device_tear_down) | 369 self._env.parallel_devices.pMap(individual_device_tear_down) |
| OLD | NEW |