summaryrefslogtreecommitdiffstats
path: root/dom/base/test
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/test')
-rw-r--r--dom/base/test/browser_page_load_event_telemetry.js10
-rw-r--r--dom/base/test/chrome/bug418986-1.js2
-rw-r--r--dom/base/test/fullscreen/browser.toml3
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1893164_module_1.mjs3
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1893164_module_2.mjs5
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1893164_module_3.mjs1
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1894631_module_1.mjs5
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1894631_module_2.mjs3
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1894631_module_3.mjs1
-rw-r--r--dom/base/test/jsmodules/importmaps/bug_1894631_module_4.mjs1
-rw-r--r--dom/base/test/jsmodules/importmaps/mochitest.toml10
-rw-r--r--dom/base/test/jsmodules/importmaps/test_bug_1893164.html20
-rw-r--r--dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html30
-rw-r--r--dom/base/test/test_anchor_target_blank_referrer.html3
-rw-r--r--dom/base/test/test_focus_radio.html69
15 files changed, 164 insertions, 2 deletions
diff --git a/dom/base/test/browser_page_load_event_telemetry.js b/dom/base/test/browser_page_load_event_telemetry.js
index 871e06026a..530d45db9a 100644
--- a/dom/base/test/browser_page_load_event_telemetry.js
+++ b/dom/base/test/browser_page_load_event_telemetry.js
@@ -34,6 +34,16 @@ add_task(async function () {
30,
"Should have at least 30 page load events"
);
+
+ // Ensure the events in the pageload ping are reasonable.
+ record.forEach(entry => {
+ Assert.equal(entry.name, "page_load");
+ Assert.greater(parseInt(entry.extra.load_time), 0);
+ Assert.ok(
+ entry.extra.using_webdriver,
+ "Webdriver field should be set to true."
+ );
+ });
});
// Perform page load 30 times to trigger the ping being sent
diff --git a/dom/base/test/chrome/bug418986-1.js b/dom/base/test/chrome/bug418986-1.js
index e7e3c63b5c..565ae418dd 100644
--- a/dom/base/test/chrome/bug418986-1.js
+++ b/dom/base/test/chrome/bug418986-1.js
@@ -35,7 +35,7 @@ var test = function (isContent) {
["screen.orientation.type", "'landscape-primary'"],
["screen.orientation.angle", 0],
["screen.mozOrientation", "'landscape-primary'"],
- ["devicePixelRatio", 1],
+ ["devicePixelRatio", 2],
];
// checkPair: tests if members of pair [a, b] are equal when evaluated.
diff --git a/dom/base/test/fullscreen/browser.toml b/dom/base/test/fullscreen/browser.toml
index dc883a4ac2..7c989bafcb 100644
--- a/dom/base/test/fullscreen/browser.toml
+++ b/dom/base/test/fullscreen/browser.toml
@@ -45,6 +45,9 @@ skip-if = [
["browser_fullscreen-sizemode.js"]
["browser_fullscreen-tab-close-race.js"]
+skip-if = [
+ "apple_silicon && !debug", # Bug 1877642
+]
["browser_fullscreen-tab-close.js"]
diff --git a/dom/base/test/jsmodules/importmaps/bug_1893164_module_1.mjs b/dom/base/test/jsmodules/importmaps/bug_1893164_module_1.mjs
new file mode 100644
index 0000000000..45894ce609
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1893164_module_1.mjs
@@ -0,0 +1,3 @@
+/* eslint-disable import/no-named-default, import/no-unresolved */
+import { default as default_non } from "./non_existing.mjs";
+import { default as default_3 } from "./bug_1893164_module_3.mjs";
diff --git a/dom/base/test/jsmodules/importmaps/bug_1893164_module_2.mjs b/dom/base/test/jsmodules/importmaps/bug_1893164_module_2.mjs
new file mode 100644
index 0000000000..e6f5e9f9f0
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1893164_module_2.mjs
@@ -0,0 +1,5 @@
+/* eslint-disable import/no-named-default */
+import { default as default_3 } from "./bug_1893164_module_3.mjs";
+
+module2_loaded = true;
+result = default_3;
diff --git a/dom/base/test/jsmodules/importmaps/bug_1893164_module_3.mjs b/dom/base/test/jsmodules/importmaps/bug_1893164_module_3.mjs
new file mode 100644
index 0000000000..dbb41f0e1f
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1893164_module_3.mjs
@@ -0,0 +1 @@
+export default 3;
diff --git a/dom/base/test/jsmodules/importmaps/bug_1894631_module_1.mjs b/dom/base/test/jsmodules/importmaps/bug_1894631_module_1.mjs
new file mode 100644
index 0000000000..b0c91fe0cf
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1894631_module_1.mjs
@@ -0,0 +1,5 @@
+/* eslint-disable import/no-named-default, import/no-unresolved, import/named */
+import { default as default_2 } from "./bug_1894631_module_2.mjs";
+import { default as default_non } from "./non_existing.mjs";
+
+module1_loaded = true;
diff --git a/dom/base/test/jsmodules/importmaps/bug_1894631_module_2.mjs b/dom/base/test/jsmodules/importmaps/bug_1894631_module_2.mjs
new file mode 100644
index 0000000000..dd17da2abc
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1894631_module_2.mjs
@@ -0,0 +1,3 @@
+/* eslint-disable import/no-named-default */
+import { default as default_3 } from "./bug_1894631_module_3.mjs";
+import { default as default_4 } from "./bug_1894631_module_4.mjs";
diff --git a/dom/base/test/jsmodules/importmaps/bug_1894631_module_3.mjs b/dom/base/test/jsmodules/importmaps/bug_1894631_module_3.mjs
new file mode 100644
index 0000000000..dbb41f0e1f
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1894631_module_3.mjs
@@ -0,0 +1 @@
+export default 3;
diff --git a/dom/base/test/jsmodules/importmaps/bug_1894631_module_4.mjs b/dom/base/test/jsmodules/importmaps/bug_1894631_module_4.mjs
new file mode 100644
index 0000000000..456ffaafac
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/bug_1894631_module_4.mjs
@@ -0,0 +1 @@
+export default 4;
diff --git a/dom/base/test/jsmodules/importmaps/mochitest.toml b/dom/base/test/jsmodules/importmaps/mochitest.toml
index 1f95b155ac..b71bf21def 100644
--- a/dom/base/test/jsmodules/importmaps/mochitest.toml
+++ b/dom/base/test/jsmodules/importmaps/mochitest.toml
@@ -3,6 +3,13 @@ support-files = [
"bug_1865410_module_a.mjs",
"bug_1865410_module_b.mjs",
"bug_1873417.mjs",
+ "bug_1893164_module_1.mjs",
+ "bug_1893164_module_2.mjs",
+ "bug_1893164_module_3.mjs",
+ "bug_1894631_module_1.mjs",
+ "bug_1894631_module_2.mjs",
+ "bug_1894631_module_3.mjs",
+ "bug_1894631_module_4.mjs",
"classic_script.js",
"module_chain_1.mjs",
"module_chain_2.mjs",
@@ -34,7 +41,10 @@ support-files = [
["test_bug_1873417.html"]
+["test_bug_1893164.html"]
+
["test_importMap_with_external_script.html"]
["test_importMap_with_nonexisting_module.html"]
["test_dynamic_importMap_with_external_script.html"]
["test_dynamic_importMap_load_completes.html"]
+["test_shared_submodules_with_modulepreload.html"]
diff --git a/dom/base/test/jsmodules/importmaps/test_bug_1893164.html b/dom/base/test/jsmodules/importmaps/test_bug_1893164.html
new file mode 100644
index 0000000000..6c5306b815
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/test_bug_1893164.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test module cancel</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script>
+ var module2_loaded = false, result;
+
+ SimpleTest.waitForExplicitFinish();
+
+ function testLoaded() {
+ ok(module2_loaded, 'module_2.mjs should be loaded');
+ ok(result == 3, "result should be 3 from module_3.mjs");
+ SimpleTest.finish();
+ }
+</script>
+
+<script src="./bug_1893164_module_1.mjs" type="module"></script>
+<script src="./bug_1893164_module_2.mjs" type="module"></script>
+
+<body onload='testLoaded()'></body>
diff --git a/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html b/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
new file mode 100644
index 0000000000..a99582f8d3
--- /dev/null
+++ b/dom/base/test/jsmodules/importmaps/test_shared_submodules_with_modulepreload.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test module cancel won't trigger an assert</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="modulepreload" href="./bug_1894631_module_2.mjs" />
+<link rel="modulepreload" href="./bug_1894631_module_3.mjs" />
+<link rel="modulepreload" href="./non_existing.mjs" />
+
+<script src="./bug_1894631_module_1.mjs" type="module" id="module_1"></script>
+<script>
+ var module1_loaded = false;
+ var module1_error = false;
+
+ SimpleTest.waitForExplicitFinish();
+
+ const module1 = document.getElementById("module_1");
+ module1.addEventListener("error", (event) => {
+ info("error event");
+ module1_error = true;
+ });
+
+ function testLoaded() {
+ ok(module1_error, "module_1.mjs should fire an error event");
+ ok(!module1_loaded, "module_1.mjs should not be loaded");
+ SimpleTest.finish();
+ }
+</script>
+
+<body onload='testLoaded()'>
+</body>
diff --git a/dom/base/test/test_anchor_target_blank_referrer.html b/dom/base/test/test_anchor_target_blank_referrer.html
index b494c28017..643cfd6c03 100644
--- a/dom/base/test/test_anchor_target_blank_referrer.html
+++ b/dom/base/test/test_anchor_target_blank_referrer.html
@@ -35,6 +35,9 @@
const testCases = [
{ACTION: ["generate-anchor-target-blank-policy-test"],
+ PREFS: [
+ ["dom.security.https_first", false], // need to test http and https
+ ],
TESTS: [
// Referrer policy is set in meta
{NAME: 'origin-in-meta-rel-noopener',
diff --git a/dom/base/test/test_focus_radio.html b/dom/base/test/test_focus_radio.html
index 8e97012745..9e14143143 100644
--- a/dom/base/test/test_focus_radio.html
+++ b/dom/base/test/test_focus_radio.html
@@ -2,7 +2,14 @@
<title>Test for input radio focus</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
-
+<style>
+.visHidden {
+ visibility: hidden;
+}
+.dispNone {
+ display: none;
+}
+</style>
<button id="before">before</button>
<fieldset>
<legend>a</legend>
@@ -26,6 +33,27 @@
<label><input id="d3" type="radio" name="d" disabled>d3</label>
<label><input id="d4" type="radio" name="d">d4</label>
</fieldset>
+<fieldset>
+ <legend>e</legend>
+ <label><input id="e1" type="radio" name="e" hidden>e1</label>
+ <label><input id="e2" type="radio" name="e">e2</label>
+ <label><input id="e3" type="radio" name="e" hidden>e3</label>
+ <label><input id="e4" type="radio" name="e">e4</label>
+</fieldset>
+<fieldset>
+ <legend>f</legend>
+ <label><input id="f1" type="radio" name="f" class="visHidden">f1</label>
+ <label><input id="f2" type="radio" name="f">f2</label>
+ <label><input id="f3" type="radio" name="f" class="visHidden">f3</label>
+ <label><input id="f4" type="radio" name="f">f4</label>
+</fieldset>
+<fieldset>
+ <legend>g</legend>
+ <label><input id="g1" type="radio" name="g" class="dispNone">g1</label>
+ <label><input id="g2" type="radio" name="g">g2</label>
+ <label><input id="g3" type="radio" name="g" class="dispNone">g3</label>
+ <label><input id="g4" type="radio" name="g">g4</label>
+</fieldset>
<button id="after">after</button>
<script>
@@ -51,8 +79,17 @@
expectFocusAfterKey("Tab", "c1");
// d1 is disabled, so d2 should get focus.
expectFocusAfterKey("Tab", "d2");
+ // e1 is hidden, so e2 should get focus.
+ expectFocusAfterKey("Tab", "e2");
+ // f1 is hidden, so f2 should get focus.
+ expectFocusAfterKey("Tab", "f2");
+ // g1 is hidden, so g2 should get focus.
+ expectFocusAfterKey("Tab", "g2");
expectFocusAfterKey("Tab", "after");
+ expectFocusAfterKey("Shift+Tab", "g2");
+ expectFocusAfterKey("Shift+Tab", "f2");
+ expectFocusAfterKey("Shift+Tab", "e2");
expectFocusAfterKey("Shift+Tab", "d2");
expectFocusAfterKey("Shift+Tab", "c1");
expectFocusAfterKey("Shift+Tab", "b2");
@@ -85,6 +122,36 @@
// Up arrow should wrap at the top.
expectFocusAfterKey("ArrowUp", "d4");
+ expectFocusAfterKey("Tab", "e2");
+ // e3 is hidden, so down arrow should focus e4.
+ expectFocusAfterKey("ArrowDown", "e4");
+ expectFocusAfterKey("ArrowUp", "e2");
+ expectFocusAfterKey("ArrowDown", "e4");
+ // Down arrow should wrap at the bottom, skipping hidden.
+ expectFocusAfterKey("ArrowDown", "e2");
+ // Up arrow should wrap at the top.
+ expectFocusAfterKey("ArrowUp", "e4");
+
+ expectFocusAfterKey("Tab", "f2");
+ // f3 is hidden, so down arrow should focus f4.
+ expectFocusAfterKey("ArrowDown", "f4");
+ expectFocusAfterKey("ArrowUp", "f2");
+ expectFocusAfterKey("ArrowDown", "f4");
+ // Down arrow should wrap at the bottom, skipping hidden.
+ expectFocusAfterKey("ArrowDown", "f2");
+ // Up arrow should wrap at the top.
+ expectFocusAfterKey("ArrowUp", "f4");
+
+ expectFocusAfterKey("Tab", "g2");
+ // g3 is hidden, so down arrow should focus g4.
+ expectFocusAfterKey("ArrowDown", "g4");
+ expectFocusAfterKey("ArrowUp", "g2");
+ expectFocusAfterKey("ArrowDown", "g4");
+ // Down arrow should wrap at the bottom, skipping hidden.
+ expectFocusAfterKey("ArrowDown", "g2");
+ // Up arrow should wrap at the top.
+ expectFocusAfterKey("ArrowUp", "g4");
+
SimpleTest.finish();
});
</script>