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

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

Issue 358993003: [Android] Switch to DeviceUtils versions of file functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « build/android/pylib/android_commands.py ('k') | build/android/pylib/device/device_utils.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 # We will allocate port for test server spawner when calling method 44 # We will allocate port for test server spawner when calling method
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.WriteFile(
55 self.device.GetExternalStoragePath() + '/' + 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
(...skipping 127 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 | « build/android/pylib/android_commands.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698