OLD | NEW |
---|---|
(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 InspectorStorage(object): | |
9 def __init__(self, inspector_websocket): | |
10 self._websocket = inspector_websocket | |
11 self._websocket.RegisterDomain('Storage', self._OnNotification) | |
12 | |
13 def _OnNotification(self, msg): | |
14 # TODO: track storage events | |
15 # (https://chromedevtools.github.io/devtools-protocol/tot/Storage/) | |
16 pass | |
17 | |
18 def ClearDataForOrigin(self, url, timeout): | |
19 res = self._websocket.SyncRequest( | |
20 {'method': 'Storage.clearDataForOrigin', | |
21 'params': { | |
22 'origin': url, | |
23 'storageTypes': 'all', | |
24 }}, timeout) | |
25 if 'error' in res: | |
perezju
2017/09/22 12:59:19
for a follow up, but maybe something like this sho
nednguyen
2017/09/22 13:02:40
Yeah, I was thinking the same too.
| |
26 raise exceptions.StoryActionError(res['error']['message']) | |
OLD | NEW |