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 import browser_backend | 8 from telemetry.core import util |
9 from telemetry import util | 9 from telemetry.core.chrome import browser_backend |
10 | 10 |
11 class CrOSBrowserBackend(browser_backend.BrowserBackend): | 11 class CrOSBrowserBackend(browser_backend.BrowserBackend): |
12 def __init__(self, browser_type, options, cri): | 12 def __init__(self, browser_type, options, cri): |
13 super(CrOSBrowserBackend, self).__init__(is_content_shell=False, | 13 super(CrOSBrowserBackend, self).__init__(is_content_shell=False, |
14 supports_extensions=True, options=options) | 14 supports_extensions=True, options=options) |
15 # Initialize fields so that an explosion during init doesn't break in Close. | 15 # Initialize fields so that an explosion during init doesn't break in Close. |
16 self._options = options | 16 self._options = options |
17 self._cri = cri | 17 self._cri = cri |
18 self._browser_type = browser_type | 18 self._browser_type = browser_type |
19 | 19 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 @property | 216 @property |
217 def url(self): | 217 def url(self): |
218 assert self._proc | 218 assert self._proc |
219 return 'http://localhost:%i' % self._host_port | 219 return 'http://localhost:%i' % self._host_port |
220 | 220 |
221 def Close(self): | 221 def Close(self): |
222 if self._proc: | 222 if self._proc: |
223 self._proc.kill() | 223 self._proc.kill() |
224 self._proc = None | 224 self._proc = None |
OLD | NEW |