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

Unified Diff: telemetry/telemetry/internal/browser/tab.py

Issue 3018603002: Add tab.StopAllServiceWorkers() (Closed)
Patch Set: add comments Created 3 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/browser/tab.py
diff --git a/telemetry/telemetry/internal/browser/tab.py b/telemetry/telemetry/internal/browser/tab.py
index f67b9939f56be73ef3b86400c254bf2e09836f11..01ed335b0053448c8d304c9333abe8b316ec5114 100644
--- a/telemetry/telemetry/internal/browser/tab.py
+++ b/telemetry/telemetry/internal/browser/tab.py
@@ -294,3 +294,27 @@ class Tab(web_contents.WebContents):
}, timeout)
if 'error' in res:
raise exceptions.StoryActionError(res['error']['message'])
+
+ def EnableServiceWorker(self, timeout=DEFAULT_TAB_TIMEOUT):
nednguyen 2017/09/22 11:07:34 Can you move these to inspector_backend? Then thes
yukiy 2017/09/25 01:23:13 Done.
+ """Enables devtools for ServiceWorker domain.
+
+ Raises:
+ exceptions.StoryActionError
+ """
+ res = self._inspector_backend._websocket.SyncRequest({
+ 'method': 'ServiceWorker.enable'
+ }, timeout)
+ if 'error' in res:
+ raise exceptions.StoryActionError(res['error']['message'])
+
+ def StopServiceWorker(self, timeout=DEFAULT_TAB_TIMEOUT):
+ """Stops all service workers.
+
+ Raises:
+ exceptions.StoryActionError
+ """
+ res = self._inspector_backend._websocket.SyncRequest({
+ 'method': 'ServiceWorker.stopAllWorkers'
+ }, timeout)
+ if 'error' in res:
+ raise exceptions.StoryActionError(res['error']['message'])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698