diff options
author | erikchen <erikchen@chromium.org> | 2015-04-13 20:42:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-14 03:42:37 +0000 |
commit | edc7470c621aaa20901efc29aa0fb961cc524da1 (patch) | |
tree | 0e2b24ef76864b334559a668bfb322ce10c110fc /tools | |
parent | 3b996212fa3c92af3233246ae54af728eb7c3591 (diff) | |
download | chromium_src-edc7470c621aaa20901efc29aa0fb961cc524da1.zip chromium_src-edc7470c621aaa20901efc29aa0fb961cc524da1.tar.gz chromium_src-edc7470c621aaa20901efc29aa0fb961cc524da1.tar.bz2 |
Telemetry: All devtools http requests should have a finite timeout.
Previously, the default timeout was infinite. That means that actions such as
making a new tab would stall forever if the connection was broken.
BUG=
Review URL: https://codereview.chromium.org/1080213003
Cr-Commit-Position: refs/heads/master@{#324997}
Diffstat (limited to 'tools')
3 files changed, 5 insertions, 3 deletions
diff --git a/tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py b/tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py index 0e97113..480b6e7 100644 --- a/tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py +++ b/tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py @@ -28,7 +28,7 @@ class TabListBackend(inspector_backend_list.InspectorBackendList): self._browser_backend.devtools_client.CreateNewTab(timeout) return self[-1] - def CloseTab(self, tab_id, timeout=None): + def CloseTab(self, tab_id, timeout=30): """Closes the tab with the given debugger_url. Raises: @@ -50,7 +50,7 @@ class TabListBackend(inspector_backend_list.InspectorBackendList): util.WaitFor(lambda: tab_id not in self, timeout=5) - def ActivateTab(self, tab_id, timeout=None): + def ActivateTab(self, tab_id, timeout=30): """Activates the tab with the given debugger_url. Raises: diff --git a/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py b/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py index 006d4e87..fecd768 100644 --- a/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py +++ b/tools/telemetry/telemetry/core/backends/chrome_inspector/devtools_http.py @@ -69,6 +69,8 @@ class DevToolsHttp(object): Raises: DevToolsClientConnectionError: If the connection fails. """ + assert timeout + if not self._conn: self._Connect(timeout) diff --git a/tools/telemetry/telemetry/core/tab_list.py b/tools/telemetry/telemetry/core/tab_list.py index da83d69..e692723 100644 --- a/tools/telemetry/telemetry/core/tab_list.py +++ b/tools/telemetry/telemetry/core/tab_list.py @@ -5,7 +5,7 @@ class TabList(object): def __init__(self, tab_list_backend): self._tab_list_backend = tab_list_backend - def New(self, timeout=None): + def New(self, timeout=30): return self._tab_list_backend.New(timeout) def __iter__(self): |