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

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

Issue 294113003: [Android] Convert to DeviceUtils versions of WaitUntilFullyBooted and GetExternalStoragePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | build/android/pylib/device/decorators.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 import logging 7 import logging
8 import time 8 import time
9 9
10 from pylib import ports 10 from pylib import ports
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 # LaunchChromeTestServerSpawner and allocate port for test server when 45 # LaunchChromeTestServerSpawner and allocate port for test server when
46 # starting it in TestServerThread. 46 # starting it in TestServerThread.
47 self.test_server_spawner_port = 0 47 self.test_server_spawner_port = 0
48 self.test_server_port = 0 48 self.test_server_port = 0
49 self._push_deps = push_deps 49 self._push_deps = push_deps
50 self._cleanup_test_files = cleanup_test_files 50 self._cleanup_test_files = cleanup_test_files
51 51
52 def _PushTestServerPortInfoToDevice(self): 52 def _PushTestServerPortInfoToDevice(self):
53 """Pushes the latest port information to device.""" 53 """Pushes the latest port information to device."""
54 self.device.old_interface.SetFileContents( 54 self.device.old_interface.SetFileContents(
55 self.device.old_interface.GetExternalStorage() + '/' + 55 self.device.GetExternalStoragePath() + '/' +
56 NET_TEST_SERVER_PORT_INFO_FILE, 56 NET_TEST_SERVER_PORT_INFO_FILE,
57 '%d:%d' % (self.test_server_spawner_port, self.test_server_port)) 57 '%d:%d' % (self.test_server_spawner_port, self.test_server_port))
58 58
59 def RunTest(self, test): 59 def RunTest(self, test):
60 """Runs a test. Needs to be overridden. 60 """Runs a test. Needs to be overridden.
61 61
62 Args: 62 Args:
63 test: A test to run. 63 test: A test to run.
64 64
65 Returns: 65 Returns:
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 break 192 break
193 else: 193 else:
194 error_msgs.append(error_msg) 194 error_msgs.append(error_msg)
195 self._spawning_server.Stop() 195 self._spawning_server.Stop()
196 # Wait for 2 seconds then restart. 196 # Wait for 2 seconds then restart.
197 time.sleep(2) 197 time.sleep(2)
198 if not server_ready: 198 if not server_ready:
199 logging.error(';'.join(error_msgs)) 199 logging.error(';'.join(error_msgs))
200 raise Exception('Can not start the test spawner server.') 200 raise Exception('Can not start the test spawner server.')
201 self._PushTestServerPortInfoToDevice() 201 self._PushTestServerPortInfoToDevice()
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/device/decorators.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698