Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: tools/android/loading/devtools_monitor.py

Issue 1707363002: sandwich: Implements network condition on WPR server and browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i00
Patch Set: Renames WEBSOCKET_TIMEOUT constants Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/android/loading/devtools_monitor.py
diff --git a/tools/android/loading/devtools_monitor.py b/tools/android/loading/devtools_monitor.py
index 5279e4f6d327a73e6de03d40d84a48088697f4f1..5e69d7a101b319ab4572b8eb3d5c3b7f1a9f33dc 100644
--- a/tools/android/loading/devtools_monitor.py
+++ b/tools/android/loading/devtools_monitor.py
@@ -20,6 +20,9 @@ from telemetry.internal.backends.chrome_inspector import inspector_websocket
from telemetry.internal.backends.chrome_inspector import websocket
+DEFAULT_TIMEOUT = 10 # seconds
+
+
class DevToolsConnectionException(Exception):
def __init__(self, message):
super(DevToolsConnectionException, self).__init__(message)
@@ -189,20 +192,21 @@ class DevToolsConnection(object):
self._tearing_down_tracing = False
self._set_up = True
- def StartMonitoring(self):
+ def StartMonitoring(self, timeout=DEFAULT_TIMEOUT):
"""Starts monitoring.
DevToolsConnection.SetUpMonitoring() has to be called first.
"""
assert self._set_up, 'DevToolsConnection.SetUpMonitoring not called.'
- self._Dispatch()
+ self._Dispatch(timeout=timeout)
self._TearDownMonitoring()
def StopMonitoring(self):
"""Stops the monitoring."""
self._please_stop = True
- def _Dispatch(self, kind='Monitoring', timeout=10):
+ def _Dispatch(self, kind='Monitoring',
+ timeout=DEFAULT_TIMEOUT):
mattcary 2016/02/19 15:40:17 this timeout should be configured as part of the d
gabadie 2016/02/22 10:05:00 Agreed. But to me only few dispatch calls needed a
self._please_stop = False
while not self._please_stop:
try:

Powered by Google App Engine
This is Rietveld 408576698