Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'win' && socketprocess_networking && fission OR os == 'mac' && socketprocess_networking && fission OR os == 'mac' && debug OR os == 'linux' && socketprocess_networking OR appname == 'thunderbird' OR os == 'android' OR os == 'mac' && os_version == '10.15' && processor == 'x86_64' && debug OR os == 'mac' && os_version == '11.20' && arch == 'aarch64' && debug
- Manifest: toolkit/components/extensions/test/xpcshell/xpcshell-remote.toml includes toolkit/components/extensions/test/xpcshell/xpcshell-common.toml
- Manifest: toolkit/components/extensions/test/xpcshell/xpcshell.toml includes toolkit/components/extensions/test/xpcshell/xpcshell-common.toml
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(async function test_url_get_without_set() {
async function background() {
browser.captivePortal.canonicalURL.onChange.addListener(details => {
browser.test.sendMessage("url", details);
});
let url = await browser.captivePortal.canonicalURL.get({});
browser.test.sendMessage("url", url);
}
let extension = ExtensionTestUtils.loadExtension({
background,
manifest: {
permissions: ["captivePortal"],
},
});
let defaultURL = Services.prefs.getStringPref("captivedetect.canonicalURL");
await extension.startup();
let url = await extension.awaitMessage("url");
equal(
url.value,
defaultURL,
"The canonicalURL setting has the expected value."
);
equal(
url.levelOfControl,
"not_controllable",
"The canonicalURL setting has the expected levelOfControl."
);
Services.prefs.setStringPref(
"captivedetect.canonicalURL",
);
url = await extension.awaitMessage("url");
equal(
url.value,
"The canonicalURL setting has the expected value."
);
equal(
url.levelOfControl,
"not_controllable",
"The canonicalURL setting has the expected levelOfControl."
);
await extension.unload();
});