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

Side by Side Diff: telemetry/telemetry/internal/backends/chrome_inspector/inspector_serviceworker.py

Issue 3018603002: Add tab.StopAllServiceWorkers() (Closed)
Patch Set: add comments Created 3 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from telemetry.core import exceptions
6
7
8 class InspectorServiceWorker(object):
9 def __init__(self, inspector_websocket):
10 self._websocket = inspector_websocket
11 self._websocket.RegisterDomain('ServiceWorker', self._OnNotification)
kouhei (in TOK) 2017/09/25 02:29:25 Should we just enable ServiceWorker here?
yukiy 2017/09/25 04:57:13 Done.
12
13 def _OnNotification(self, msg):
14 # TODO: track service worker events
15 # (https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/)
16 pass
17
18 def Enable(self, timeout):
19 # This method must be called before calling any other methods in
20 # InspectorServiceWorker.
21 res = self._websocket.SyncRequest(
22 {'method': 'ServiceWorker.enable'}, timeout)
23 if 'error' in res:
24 raise exceptions.StoryActionError(res['error']['message'])
25
26 def StopAllWorkers(self, timeout):
27 res = self._websocket.SyncRequest(
28 {'method': 'ServiceWorker.stopAllWorkers'}, timeout)
29 if 'error' in res:
30 raise exceptions.StoryActionError(res['error']['message'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698