blob: 1725315f05fd143ce3d7e42f328bb559295f4353 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
* Because this is an xpcshell global, it does not have an associated client id.
* We turn on client validation for LocalStorage and ensure that we don't have
* access to LocalStorage.
*/
async function testSteps() {
const principal = getPrincipal("http://example.com");
info("Setting prefs");
Services.prefs.setBoolPref("dom.storage.next_gen", true);
Services.prefs.setBoolPref("dom.storage.client_validation", true);
info("Getting storage");
try {
getLocalStorage(principal);
ok(false, "Should have thrown");
} catch (ex) {
ok(true, "Did throw");
is(ex.name, "NS_ERROR_FAILURE", "Threw right Exception");
is(ex.result, Cr.NS_ERROR_FAILURE, "Threw with right result");
}
}
|