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 logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 | 10 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 def SetUp(self): | 234 def SetUp(self): |
235 @local_device_test_run.handle_shard_failures_with( | 235 @local_device_test_run.handle_shard_failures_with( |
236 on_failure=self._env.BlacklistDevice) | 236 on_failure=self._env.BlacklistDevice) |
237 def individual_device_set_up(dev): | 237 def individual_device_set_up(dev): |
238 def install_apk(): | 238 def install_apk(): |
239 # Install test APK. | 239 # Install test APK. |
240 self._delegate.Install(dev) | 240 self._delegate.Install(dev) |
241 | 241 |
242 def push_test_data(): | 242 def push_test_data(): |
243 # Push data dependencies. | 243 # Push data dependencies. |
244 device_root = posixpath.join(dev.GetExternalStoragePath(), | 244 external_storage = dev.GetExternalStoragePath() |
245 'chromium_tests_root') | |
246 data_deps = self._test_instance.GetDataDependencies() | 245 data_deps = self._test_instance.GetDataDependencies() |
247 host_device_tuples = [ | 246 host_device_tuples = [ |
248 (h, d if d is not None else device_root) | 247 (h, d if d is not None else external_storage) |
249 for h, d in data_deps] | 248 for h, d in data_deps] |
250 dev.PushChangedFiles(host_device_tuples, delete_device_stale=True) | 249 dev.PushChangedFiles(host_device_tuples) |
251 if not host_device_tuples: | |
252 dev.RunShellCommand(['rm', '-rf', device_root], check_return=True) | |
253 dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True) | |
254 | 250 |
255 def init_tool_and_start_servers(): | 251 def init_tool_and_start_servers(): |
256 tool = self.GetTool(dev) | 252 tool = self.GetTool(dev) |
257 tool.CopyFiles(dev) | 253 tool.CopyFiles(dev) |
258 tool.SetupEnvironment() | 254 tool.SetupEnvironment() |
259 | 255 |
260 self._servers[str(dev)] = [] | 256 self._servers[str(dev)] = [] |
261 if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER: | 257 if self.TestPackage() in _SUITE_REQUIRES_TEST_SERVER_SPAWNER: |
262 self._servers[str(dev)].append( | 258 self._servers[str(dev)].append( |
263 local_test_server_spawner.LocalTestServerSpawner( | 259 local_test_server_spawner.LocalTestServerSpawner( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 def TearDown(self): | 361 def TearDown(self): |
366 @local_device_test_run.handle_shard_failures | 362 @local_device_test_run.handle_shard_failures |
367 def individual_device_tear_down(dev): | 363 def individual_device_tear_down(dev): |
368 for s in self._servers.get(str(dev), []): | 364 for s in self._servers.get(str(dev), []): |
369 s.TearDown() | 365 s.TearDown() |
370 | 366 |
371 tool = self.GetTool(dev) | 367 tool = self.GetTool(dev) |
372 tool.CleanUpEnvironment() | 368 tool.CleanUpEnvironment() |
373 | 369 |
374 self._env.parallel_devices.pMap(individual_device_tear_down) | 370 self._env.parallel_devices.pMap(individual_device_tear_down) |
OLD | NEW |