Loading toolkit/components/search/tests/xpcshell/test_security_level.js 0 → 100644 +22 −0 Original line number Diff line number Diff line /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ /** * This tests that we use the HTML version of DuckDuckGo when in the safest * security level. */ "use strict"; const expectedURLs = { ddg: "https://html.duckduckgo.com/html?q=test", }; add_task(async function test_securityLevel() { await Services.search.init(); for (const [id, url] of Object.entries(expectedURLs)) { const engine = Services.search.getEngineById(id); const foundUrl = engine.getSubmission("test").uri.spec; Assert.equal(foundUrl, url, `${engine.name} is in HTML mode.`); } }); toolkit/components/search/tests/xpcshell/xpcshell.toml +3 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,9 @@ skip-if = [ ["test_searchUrlDomain.js"] ["test_security_level.js"] prefs = ["browser.security_level.security_slider=1"] ["test_selectedEngine.js"] ["test_sendSubmissionURL.js"] Loading Loading
toolkit/components/search/tests/xpcshell/test_security_level.js 0 → 100644 +22 −0 Original line number Diff line number Diff line /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ /** * This tests that we use the HTML version of DuckDuckGo when in the safest * security level. */ "use strict"; const expectedURLs = { ddg: "https://html.duckduckgo.com/html?q=test", }; add_task(async function test_securityLevel() { await Services.search.init(); for (const [id, url] of Object.entries(expectedURLs)) { const engine = Services.search.getEngineById(id); const foundUrl = engine.getSubmission("test").uri.spec; Assert.equal(foundUrl, url, `${engine.name} is in HTML mode.`); } });
toolkit/components/search/tests/xpcshell/xpcshell.toml +3 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,9 @@ skip-if = [ ["test_searchUrlDomain.js"] ["test_security_level.js"] prefs = ["browser.security_level.security_slider=1"] ["test_selectedEngine.js"] ["test_sendSubmissionURL.js"] Loading