summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/browser_test_uir_optional_clicks.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/security/test/csp/browser_test_uir_optional_clicks.js')
-rw-r--r--dom/security/test/csp/browser_test_uir_optional_clicks.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/dom/security/test/csp/browser_test_uir_optional_clicks.js b/dom/security/test/csp/browser_test_uir_optional_clicks.js
new file mode 100644
index 0000000000..57e1f64f1a
--- /dev/null
+++ b/dom/security/test/csp/browser_test_uir_optional_clicks.js
@@ -0,0 +1,36 @@
+"use strict";
+
+const TEST_PATH_HTTP = getRootDirectory(gTestPath).replace(
+ "chrome://mochitests/content",
+ "http://example.com"
+);
+const TEST_PATH_HTTPS = getRootDirectory(gTestPath).replace(
+ "chrome://mochitests/content",
+ "https://example.com"
+);
+
+add_task(async function () {
+ await SpecialPowers.pushPrefEnv({
+ set: [["dom.security.https_first", false]],
+ });
+ await BrowserTestUtils.withNewTab(
+ TEST_PATH_HTTPS + "file_csp_meta_uir.html",
+ async function (browser) {
+ let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
+ BrowserTestUtils.synthesizeMouse(
+ "#mylink",
+ 2,
+ 2,
+ { accelKey: true },
+ browser
+ );
+ let tab = await newTabPromise;
+ is(
+ tab.linkedBrowser.currentURI.scheme,
+ "https",
+ "Should have opened https page."
+ );
+ BrowserTestUtils.removeTab(tab);
+ }
+ );
+});