Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/quota/test/xpcshell/xpcshell.toml
/**
* Any copyright is dedicated to the Public Domain.
*/
const { IndexedDBUtils } = ChromeUtils.importESModule(
);
const { LocalStorageUtils } = ChromeUtils.importESModule(
);
const { PrincipalUtils } = ChromeUtils.importESModule(
);
const { QuotaUtils } = ChromeUtils.importESModule(
);
async function testNonExistentOriginDirectory() {
const name = "test_quotaClientInteractions.js";
const objectStoreName = "foo";
info("Opening LocalStorage database");
{
const storage = LocalStorageUtils.createStorage(principal);
storage.open();
}
info("Opening IndexedDB database");
{
const request = indexedDB.openForPrincipal(principal, name);
request.onupgradeneeded = function (event) {
const database = event.target.result;
database.createObjectStore(objectStoreName);
};
const database = await IndexedDBUtils.requestFinished(request);
database.close();
}
info("Resetting storage");
{
const request = Services.qms.reset();
await QuotaUtils.requestFinished(request);
}
info("Opening LocalStorage database");
{
const storage = LocalStorageUtils.createStorage(principal);
storage.open();
}
info("Deleting IndexedDB database");
{
const request = indexedDB.deleteForPrincipal(principal, name);
await IndexedDBUtils.requestFinished(request);
}
}
/* exported testSteps */
async function testSteps() {
add_task(
{
pref_set: [
["dom.storage.testing", true],
["dom.storage.client_validation", false],
],
},
testNonExistentOriginDirectory
);
}