Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
dtu
2013/07/31 01:34:49
I think the right thing to do is create another fo
chrisgao (Use stgao instead)
2013/07/31 19:05:41
Thanks, Dave. Will do it in next upload and a sepa
dtu
2013/08/01 00:11:13
Yep.
| |
| 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 urllib2 | 5 import urllib2 |
| 6 import httplib | 6 import httplib |
| 7 import socket | 7 import socket |
| 8 import json | 8 import json |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| 11 | 11 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 25 pass | 25 pass |
| 26 | 26 |
| 27 class BrowserBackend(object): | 27 class BrowserBackend(object): |
| 28 """A base class for browser backends. Provides basic functionality | 28 """A base class for browser backends. Provides basic functionality |
| 29 once a remote-debugger port has been established.""" | 29 once a remote-debugger port has been established.""" |
| 30 | 30 |
| 31 WEBPAGEREPLAY_HOST = '127.0.0.1' | 31 WEBPAGEREPLAY_HOST = '127.0.0.1' |
| 32 | 32 |
| 33 def __init__(self, is_content_shell, supports_extensions, options): | 33 def __init__(self, is_content_shell, supports_extensions, options): |
| 34 self.browser_type = options.browser_type | 34 self.browser_type = options.browser_type |
| 35 self.webdriver_based = False | |
|
nduca
2013/07/30 06:49:45
why is this needed? This is like having a isCrOS o
chrisgao (Use stgao instead)
2013/07/31 19:05:41
Removed.
| |
| 35 self.is_content_shell = is_content_shell | 36 self.is_content_shell = is_content_shell |
| 36 self._supports_extensions = supports_extensions | 37 self._supports_extensions = supports_extensions |
| 37 self.options = options | 38 self.options = options |
| 38 self._browser = None | 39 self._browser = None |
| 39 self._port = None | 40 self._port = None |
| 40 | 41 |
| 41 self._inspector_protocol_version = 0 | 42 self._inspector_protocol_version = 0 |
| 42 self._chrome_branch_number = 0 | 43 self._chrome_branch_number = 0 |
| 43 self._tracing_backend = None | 44 self._tracing_backend = None |
| 44 | 45 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 raise NotImplementedError() | 244 raise NotImplementedError() |
| 244 | 245 |
| 245 def IsBrowserRunning(self): | 246 def IsBrowserRunning(self): |
| 246 raise NotImplementedError() | 247 raise NotImplementedError() |
| 247 | 248 |
| 248 def GetStandardOutput(self): | 249 def GetStandardOutput(self): |
| 249 raise NotImplementedError() | 250 raise NotImplementedError() |
| 250 | 251 |
| 251 def GetStackTrace(self): | 252 def GetStackTrace(self): |
| 252 raise NotImplementedError() | 253 raise NotImplementedError() |
| 253 | |
| 254 class DoNothingForwarder(object): | |
| 255 def __init__(self, *port_pairs): | |
| 256 self._host_port = port_pairs[0].local_port | |
| 257 | |
| 258 @property | |
| 259 def url(self): | |
| 260 assert self._host_port | |
| 261 return 'http://127.0.0.1:%i' % self._host_port | |
| 262 | |
| 263 def Close(self): | |
| 264 self._host_port = None | |
| OLD | NEW |