Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: http3 OR http2
- Manifest: devtools/client/storage/test/browser.toml
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
// Test handling errors in CacheStorage
add_task(async function () {
// Open the URL in a private browsing window.
const win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
const tab = win.gBrowser.selectedBrowser;
const triggeringPrincipal =
Services.scriptSecurityManager.getSystemPrincipal();
tab.loadURI(
Services.io.newURI(ALT_DOMAIN_SECURED + "storage-cache-error.html"),
{ triggeringPrincipal }
);
await BrowserTestUtils.browserLoaded(tab);
// On enumerating cache storages, CacheStorage::Keys would throw a
// DOM security exception. We'd like to verify storage panel still work in
// this case.
await openStoragePanel({ tab: win.gBrowser.selectedTab });
await selectTreeItem(cacheItemId);
ok(
gUI.tree.isSelected(cacheItemId),
`The item ${cacheItemId.join(" > ")} is present in the tree`
);
await BrowserTestUtils.closeWindow(win);
});