OLD | NEW |
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 import logging | 5 import logging |
6 import os | 6 import os |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 import time | 9 import time |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 self._adb = backend_settings.adb | 157 self._adb = backend_settings.adb |
158 self._backend_settings = backend_settings | 158 self._backend_settings = backend_settings |
159 self._saved_cmdline = None | 159 self._saved_cmdline = None |
160 if not options.keep_test_server_ports: | 160 if not options.keep_test_server_ports: |
161 adb_commands.ResetTestServerPortAllocation() | 161 adb_commands.ResetTestServerPortAllocation() |
162 self._port = adb_commands.AllocateTestServerPort() | 162 self._port = adb_commands.AllocateTestServerPort() |
163 | 163 |
164 # Kill old browser. | 164 # Kill old browser. |
165 self._adb.CloseApplication(self._backend_settings.package) | 165 self._adb.CloseApplication(self._backend_settings.package) |
166 | 166 |
167 adb_commands.Forwarder.KillDevice(self._adb) | |
168 if not options.keep_test_server_ports: | |
169 adb_commands.Forwarder.KillHost() | |
170 | |
171 if self._adb.Adb().CanAccessProtectedFileContents(): | 167 if self._adb.Adb().CanAccessProtectedFileContents(): |
172 if not options.dont_override_profile: | 168 if not options.dont_override_profile: |
173 self._backend_settings.RemoveProfile() | 169 self._backend_settings.RemoveProfile() |
174 if options.profile_dir: | 170 if options.profile_dir: |
175 self._backend_settings.PushProfile(options.profile_dir) | 171 self._backend_settings.PushProfile(options.profile_dir) |
176 | 172 |
177 # Set up the command line. | 173 # Set up the command line. |
178 self._saved_cmdline = ''.join(self._adb.Adb().GetProtectedFileContents( | 174 self._saved_cmdline = ''.join(self._adb.Adb().GetProtectedFileContents( |
179 self._backend_settings.cmdline_file) or []) | 175 self._backend_settings.cmdline_file) or []) |
180 args = [backend_settings.pseudo_exec_name] | 176 args = [backend_settings.pseudo_exec_name] |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 'tombstones.py') | 278 'tombstones.py') |
283 if os.path.exists(tombstones): | 279 if os.path.exists(tombstones): |
284 ret += Decorate('Tombstones', | 280 ret += Decorate('Tombstones', |
285 subprocess.Popen([tombstones, '-w', '--device', | 281 subprocess.Popen([tombstones, '-w', '--device', |
286 self._adb.device()], | 282 self._adb.device()], |
287 stdout=subprocess.PIPE).communicate()[0]) | 283 stdout=subprocess.PIPE).communicate()[0]) |
288 return ret | 284 return ret |
289 | 285 |
290 def CreateForwarder(self, *port_pairs): | 286 def CreateForwarder(self, *port_pairs): |
291 return adb_commands.Forwarder(self._adb, *port_pairs) | 287 return adb_commands.Forwarder(self._adb, *port_pairs) |
OLD | NEW |