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 os as os | 4 import os as os |
5 import subprocess as subprocess | 5 import subprocess as subprocess |
6 import shutil | 6 import shutil |
7 import tempfile | 7 import tempfile |
8 | 8 |
9 from telemetry import browser_backend | 9 from telemetry.core import util |
10 from telemetry import util | 10 from telemetry.core.chrome import browser_backend |
11 | 11 |
12 class DesktopBrowserBackend(browser_backend.BrowserBackend): | 12 class DesktopBrowserBackend(browser_backend.BrowserBackend): |
13 """The backend for controlling a locally-executed browser instance, on Linux, | 13 """The backend for controlling a locally-executed browser instance, on Linux, |
14 Mac or Windows. | 14 Mac or Windows. |
15 """ | 15 """ |
16 def __init__(self, options, executable, is_content_shell): | 16 def __init__(self, options, executable, is_content_shell): |
17 super(DesktopBrowserBackend, self).__init__( | 17 super(DesktopBrowserBackend, self).__init__( |
18 is_content_shell=is_content_shell, | 18 is_content_shell=is_content_shell, |
19 supports_extensions=not is_content_shell, options=options) | 19 supports_extensions=not is_content_shell, options=options) |
20 | 20 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 def __init__(self, *port_pairs): | 117 def __init__(self, *port_pairs): |
118 self._host_port = port_pairs[0].local_port | 118 self._host_port = port_pairs[0].local_port |
119 | 119 |
120 @property | 120 @property |
121 def url(self): | 121 def url(self): |
122 assert self._host_port | 122 assert self._host_port |
123 return 'http://localhost:%i' % self._host_port | 123 return 'http://localhost:%i' % self._host_port |
124 | 124 |
125 def Close(self): | 125 def Close(self): |
126 self._host_port = None | 126 self._host_port = None |
OLD | NEW |