Skip to content

Commit

Permalink
Update SyncRequest calls to add timeout in every case.
Browse files Browse the repository at this point in the history
SyncRequest no longer has a default value for timeout, and is now a required field, which is breaking are tests when we start/stop monitoring.  Adding a timeout should unbreak the tests.

BUG=604522

Review URL: https://codereview.chromium.org/1898743003

Cr-Commit-Position: refs/heads/master@{#388062}
  • Loading branch information
bustamante authored and Commit bot committed Apr 18, 2016
1 parent 97c4403 commit 0222847
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/chrome_proxy/common/inspector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def ClearCache(self, timeout=60):
'method': 'Network.clearBrowserCache'
}, timeout)

def StartMonitoringNetwork(self):
def StartMonitoringNetwork(self, timeout=60):
"""Starts monitoring network notifications and recording HTTP responses."""
self.ClearResponseData()
self._inspector_websocket.RegisterDomain(
Expand All @@ -167,14 +167,14 @@ def StartMonitoringNetwork(self):
request = {
'method': 'Network.enable'
}
self._inspector_websocket.SyncRequest(request)
self._inspector_websocket.SyncRequest(request, timeout)

def StopMonitoringNetwork(self):
def StopMonitoringNetwork(self, timeout=60):
"""Stops monitoring network notifications and recording HTTP responses."""
request = {
'method': 'Network.disable'
}
self._inspector_websocket.SyncRequest(request)
self._inspector_websocket.SyncRequest(request, timeout)
# There may be queued messages that don't appear until the SyncRequest
# happens. Wait to unregister until after sending the disable command.
self._inspector_websocket.UnregisterDomain('Network')
Expand Down

0 comments on commit 0222847

Please sign in to comment.