| 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 import logging | 4 import logging |
| 5 import os | 5 import os |
| 6 import subprocess | 6 import subprocess |
| 7 | 7 |
| 8 from telemetry.core import exceptions | 8 from telemetry.core import exceptions |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry.core.chrome import browser_backend | 10 from telemetry.core.chrome import browser_backend |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return bool(self.pid) | 221 return bool(self.pid) |
| 222 | 222 |
| 223 def GetStandardOutput(self): | 223 def GetStandardOutput(self): |
| 224 return 'Cannot get standard output on CrOS' | 224 return 'Cannot get standard output on CrOS' |
| 225 | 225 |
| 226 def GetStackTrace(self): | 226 def GetStackTrace(self): |
| 227 return 'Cannot get stack trace on CrOS' | 227 return 'Cannot get stack trace on CrOS' |
| 228 | 228 |
| 229 def CreateForwarder(self, *port_pairs): | 229 def CreateForwarder(self, *port_pairs): |
| 230 assert self._cri | 230 assert self._cri |
| 231 return (browser_backend.DoNothingForwarder(*port_pairs) if self._cri.local | 231 return (util.DoNothingForwarder(*port_pairs) if self._cri.local |
| 232 else SSHForwarder(self._cri, 'R', *port_pairs)) | 232 else SSHForwarder(self._cri, 'R', *port_pairs)) |
| 233 | 233 |
| 234 def _RestartUI(self): | 234 def _RestartUI(self): |
| 235 if self._cri: | 235 if self._cri: |
| 236 logging.info('(Re)starting the ui (logs the user out)') | 236 logging.info('(Re)starting the ui (logs the user out)') |
| 237 if self._cri.IsServiceRunning('ui'): | 237 if self._cri.IsServiceRunning('ui'): |
| 238 self._cri.RunCmdOnDevice(['restart', 'ui']) | 238 self._cri.RunCmdOnDevice(['restart', 'ui']) |
| 239 else: | 239 else: |
| 240 self._cri.RunCmdOnDevice(['start', 'ui']) | 240 self._cri.RunCmdOnDevice(['start', 'ui']) |
| 241 | 241 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 @property | 374 @property |
| 375 def url(self): | 375 def url(self): |
| 376 assert self._proc | 376 assert self._proc |
| 377 return 'http://localhost:%i' % self._host_port | 377 return 'http://localhost:%i' % self._host_port |
| 378 | 378 |
| 379 def Close(self): | 379 def Close(self): |
| 380 if self._proc: | 380 if self._proc: |
| 381 self._proc.kill() | 381 self._proc.kill() |
| 382 self._proc = None | 382 self._proc = None |
| 383 | 383 |
| OLD | NEW |