Backed out changeset e26fcd9ef4ae (bug 1318724)

MozReview-Commit-ID: 52YjOhlrk6o
This commit is contained in:
Sebastian Hengst 2017-04-14 17:18:30 +02:00
parent ea52a8fdb9
commit d4c6fc8e0a
2 changed files with 5 additions and 8 deletions

View File

@ -336,7 +336,8 @@ class UserPrompt(object):
class Session(object):
def __init__(self, host, port, url_prefix="/", desired_capabilities=None,
required_capabilities=None, extension=None, timeout=None):
required_capabilities=None, timeout=transport.HTTP_TIMEOUT,
extension=None):
self.transport = transport.HTTPWireProtocol(
host, port, url_prefix, timeout=timeout)
self.desired_capabilities = desired_capabilities

View File

@ -6,6 +6,7 @@ import httplib
import json
import urlparse
HTTP_TIMEOUT = 5
class Response(object):
"""Describes an HTTP response received from a remote en"Describes an HTTP
@ -46,13 +47,12 @@ class Response(object):
return cls(status, body)
class HTTPWireProtocol(object):
"""Transports messages (commands and responses) over the WebDriver
wire protocol.
"""
def __init__(self, host, port, url_prefix="/", timeout=None):
def __init__(self, host, port, url_prefix="/", timeout=HTTP_TIMEOUT):
"""Construct interface for communicating with the remote server.
:param url: URL of remote WebDriver server.
@ -94,12 +94,8 @@ class HTTPWireProtocol(object):
url = self.url_prefix + url
kwargs = {}
if self._timeout is not None:
kwargs["timeout"] = self._timeout
conn = httplib.HTTPConnection(
self.host, self.port, strict=True, **kwargs)
self.host, self.port, strict=True, timeout=self._timeout)
conn.request(method, url, body, headers)
try: