OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from telemetry.internal.actions import action_runner | 5 from telemetry.internal.actions import action_runner |
6 from telemetry.internal.browser import web_contents | 6 from telemetry.internal.browser import web_contents |
7 from telemetry.internal.image_processing import video | 7 from telemetry.internal.image_processing import video |
8 from telemetry.core import exceptions | |
9 | 8 |
10 DEFAULT_TAB_TIMEOUT = 60 | 9 DEFAULT_TAB_TIMEOUT = 60 |
11 | 10 |
12 | 11 |
13 class Tab(web_contents.WebContents): | 12 class Tab(web_contents.WebContents): |
14 """Represents a tab in the browser | 13 """Represents a tab in the browser |
15 | 14 |
16 The important parts of the Tab object are in the runtime and page objects. | 15 The important parts of the Tab object are in the runtime and page objects. |
17 E.g.: | 16 E.g.: |
18 # Navigates the tab to a given url. | 17 # Navigates the tab to a given url. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 """Clears storage data for the origin of url. | 277 """Clears storage data for the origin of url. |
279 | 278 |
280 With assigning 'all' to params.storageTypes, Storage.clearDataForOrigin | 279 With assigning 'all' to params.storageTypes, Storage.clearDataForOrigin |
281 clears all storage of app cache, cookies, file systems, indexed db, | 280 clears all storage of app cache, cookies, file systems, indexed db, |
282 local storage, shader cache, web sql, service workers and cache storage. | 281 local storage, shader cache, web sql, service workers and cache storage. |
283 See StorageHandler::ClearDataForOrigin() for more details. | 282 See StorageHandler::ClearDataForOrigin() for more details. |
284 | 283 |
285 Raises: | 284 Raises: |
286 exceptions.StoryActionError | 285 exceptions.StoryActionError |
287 """ | 286 """ |
288 res = self._inspector_backend._websocket.SyncRequest({ | 287 return self._inspector_backend.ClearDataForOrigin(url, timeout) |
289 'method': 'Storage.clearDataForOrigin', | |
290 'params': { | |
291 'origin': url, | |
292 'storageTypes': 'all' | |
293 } | |
294 }, timeout) | |
295 if 'error' in res: | |
296 raise exceptions.StoryActionError(res['error']['message']) | |
OLD | NEW |