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']) |