1
0
Fork 0
firefox/dom/localstorage/test/unit/slowRequestFinalization_child.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

26 lines
787 B
JavaScript

/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const { PrincipalUtils } = ChromeUtils.importESModule(
"resource://testing-common/dom/quota/test/modules/PrincipalUtils.sys.mjs"
);
const { LocalStorageUtils } = ChromeUtils.importESModule(
"resource://testing-common/dom/localstorage/test/modules/LocalStorageUtils.sys.mjs"
);
add_task(async function testSteps() {
const principal = PrincipalUtils.createPrincipal("https://example.com");
const storage = LocalStorageUtils.createStorage(principal);
try {
storage.getItem("foo");
ok(false, "Should have thrown");
} catch (e) {
ok(true, "Should have thrown");
Assert.strictEqual(e.result, Cr.NS_ERROR_ABORT, "Threw right result code");
}
});