diff --git a/browser/components/preferences/tests/browser_bug731866.js b/browser/components/preferences/tests/browser_bug731866.js index 5036718cd078..c1eba138f5c4 100644 --- a/browser/components/preferences/tests/browser_bug731866.js +++ b/browser/components/preferences/tests/browser_bug731866.js @@ -5,6 +5,10 @@ const browserContainersGroupDisabled = !SpecialPowers.getBoolPref( "privacy.userContext.ui.enabled" ); +const httpsOnlyVisible = SpecialPowers.getBoolPref( + "browser.preferences.exposeHTTPSOnly" +); + function test() { waitForExplicitFinish(); open_preferences(runTest); @@ -32,6 +36,12 @@ function checkElements(expectedPane) { continue; } + // HTTPS-Only Mode is exposed depending on the preference. + if (element.id == "httpsOnlyBox" && !httpsOnlyVisible) { + is_element_hidden(element, "Disabled httpsOnlyBox should be hidden"); + continue; + } + let attributeValue = element.getAttribute("data-category"); let suffix = " (id=" + element.id + ")"; if (attributeValue == "pane" + expectedPane) { diff --git a/browser/components/preferences/tests/browser_bug795764_cachedisabled.js b/browser/components/preferences/tests/browser_bug795764_cachedisabled.js index 1890e0e97ced..c454454df638 100644 --- a/browser/components/preferences/tests/browser_bug795764_cachedisabled.js +++ b/browser/components/preferences/tests/browser_bug795764_cachedisabled.js @@ -1,6 +1,10 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ +const httpsOnlyVisible = SpecialPowers.getBoolPref( + "browser.preferences.exposeHTTPSOnly" +); + function test() { waitForExplicitFinish(); @@ -34,6 +38,16 @@ async function runTest(win) { for (let element of elements) { let attributeValue = element.getAttribute("data-category"); if (attributeValue == "panePrivacy") { + // HTTPS-Only Mode is exposed depending on the preference. + if (element.id == "httpsOnlyBox") { + if (httpsOnlyVisible) { + is_element_visible(element, "HTTPSOnly should be visible"); + } else { + is_element_hidden(element, "HTTPSOnly should not be visible"); + } + continue; + } + is_element_visible( element, `Privacy element of id=${element.id} should be visible`