summaryrefslogtreecommitdiffstats
path: root/dom/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/tests
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests')
-rw-r--r--dom/tests/browser/browser_windowProxy_transplant.js6
-rw-r--r--dom/tests/mochitest/general/test_bug861217.html29
-rw-r--r--dom/tests/mochitest/general/test_interfaces.js16
-rw-r--r--dom/tests/mochitest/localstorage/frameLocalStorageSessionOnly.html8
-rw-r--r--dom/tests/mochitest/localstorage/mochitest.toml1
-rw-r--r--dom/tests/mochitest/webcomponents/test_xul_custom_element.xhtml12
-rw-r--r--dom/tests/reftest/prettyprint-space-ref.xhtml67
-rw-r--r--dom/tests/reftest/prettyprint-space.xml1
-rw-r--r--dom/tests/reftest/reftest.list1
-rw-r--r--dom/tests/unit/test_PromiseDebugging.js1
-rw-r--r--dom/tests/unit/test_xhr_init.js8
11 files changed, 125 insertions, 25 deletions
diff --git a/dom/tests/browser/browser_windowProxy_transplant.js b/dom/tests/browser/browser_windowProxy_transplant.js
index 8e6e0f8413..10cd96c9ee 100644
--- a/dom/tests/browser/browser_windowProxy_transplant.js
+++ b/dom/tests/browser/browser_windowProxy_transplant.js
@@ -12,12 +12,6 @@ const URL3 = `http://example.org/${PATH}`;
// A bunch of boilerplate which needs to be dealt with.
add_task(async function () {
- // Turn on BC preservation and frameloader rebuilding to ensure that the
- // BrowsingContext is preserved.
- await SpecialPowers.pushPrefEnv({
- set: [["fission.preserve_browsing_contexts", true]],
- });
-
// Open a window with fission force-enabled in it.
let win = await BrowserTestUtils.openNewBrowserWindow({
fission: true,
diff --git a/dom/tests/mochitest/general/test_bug861217.html b/dom/tests/mochitest/general/test_bug861217.html
index 1af3f58ff6..b758fe53e4 100644
--- a/dom/tests/mochitest/general/test_bug861217.html
+++ b/dom/tests/mochitest/general/test_bug861217.html
@@ -48,7 +48,34 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=861217
SimpleTest.waitForExplicitFinish();
/** Test for Bug 861217 **/
-function runTest() {
+async function runTest() {
+ // This test needs to be run on environments where the zoom level == 1, but
+ // there are a couple of cases it's not run on such kind of environments.
+ // 1) run this test solely like mach mochitest dom/tests/mochitest/general/test_bug861217.html .
+ // In this case the zoom level is smaller than 1 since there's no meta viewport.
+ // 2) run test test along with other tests in the same directory.
+ // In this case this test runs inside an iframe in the mochitest harness'
+ // top level document which doesn't have any meta viewport either.
+ // To avoid these situations we forcibly set the zoom level 1 here.
+ const resolution = await SpecialPowers.spawn(window.top, [], () => {
+ return SpecialPowers.getDOMWindowUtils(content.window).getResolution();
+ });
+
+ SimpleTest.registerCleanupFunction(async () => {
+ await SpecialPowers.spawn(window.top, [resolution], (aResolution) => {
+ SpecialPowers.getDOMWindowUtils(content.window).setResolutionAndScaleTo(aResolution);
+ });
+ });
+ await SpecialPowers.spawn(window.top, [], () => {
+ SpecialPowers.getDOMWindowUtils(content.window).setResolutionAndScaleTo(1.0);
+ });
+ await SimpleTest.promiseWaitForCondition(async () => {
+ const resolution = await SpecialPowers.spawn(window.top, [], () => {
+ return SpecialPowers.getDOMWindowUtils(content.window).getResolution();
+ });
+ return resolution == 1.0;
+ }, "Waiting for zoom level 1.0");
+
var tableCell1 = document.getElementById("tableCell1"),
bcr1 = tableCell1.getBoundingClientRect(),
tableCell2 = document.getElementById("tableCell2"),
diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js
index fd15348532..e6ea910e14 100644
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -190,6 +190,8 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "AudioDestinationNode", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
+ { name: "AudioEncoder", nightly: true },
+ // IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "AudioListener", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "AudioNode", insecureContext: true },
@@ -326,6 +328,8 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "CSSRuleList", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
+ { name: "CSSStartingStyleRule", insecureContext: true, disabled: true },
+ // IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "CSSStyleDeclaration", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "CSSStyleRule", insecureContext: true },
@@ -340,6 +344,8 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "CustomEvent", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
+ { name: "CustomStateSet", insecureContext: true },
+ // IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "DecompressionStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "DataTransfer", insecureContext: true },
@@ -1370,6 +1376,12 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextEncoderStream", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
+ {
+ name: "TextEvent",
+ insecureContext: true,
+ disabled: !SpecialPowers.getBoolPref("dom.events.textevent.enabled"),
+ },
+ // IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextMetrics", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "TextTrack", insecureContext: true },
@@ -1977,9 +1989,9 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "visualViewport", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
- { name: "WakeLock", earlyBetaOrEarlier: true },
+ { name: "WakeLock" },
// IMPORTANT: Do not change this list without review from a DOM peer!
- { name: "WakeLockSentinel", earlyBetaOrEarlier: true },
+ { name: "WakeLockSentinel" },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "webkitURL", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
diff --git a/dom/tests/mochitest/localstorage/frameLocalStorageSessionOnly.html b/dom/tests/mochitest/localstorage/frameLocalStorageSessionOnly.html
deleted file mode 100644
index f6c7f0291f..0000000000
--- a/dom/tests/mochitest/localstorage/frameLocalStorageSessionOnly.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!doctype html>
-<html>
- <body>
- <script>
- parent.postMessage(SpecialPowers.wrap(localStorage).isSessionOnly, "*");
- </script>
- </body>
-</html>
diff --git a/dom/tests/mochitest/localstorage/mochitest.toml b/dom/tests/mochitest/localstorage/mochitest.toml
index 07b9eb313a..c4758a7356 100644
--- a/dom/tests/mochitest/localstorage/mochitest.toml
+++ b/dom/tests/mochitest/localstorage/mochitest.toml
@@ -15,7 +15,6 @@ support-files = [
"interOriginTest.js",
"interOriginTest2.js",
"localStorageCommon.js",
- "frameLocalStorageSessionOnly.html",
"file_tryAccessSessionStorage.html",
"windowProxy.html",
]
diff --git a/dom/tests/mochitest/webcomponents/test_xul_custom_element.xhtml b/dom/tests/mochitest/webcomponents/test_xul_custom_element.xhtml
index 0e172cb70d..7048163372 100644
--- a/dom/tests/mochitest/webcomponents/test_xul_custom_element.xhtml
+++ b/dom/tests/mochitest/webcomponents/test_xul_custom_element.xhtml
@@ -150,13 +150,13 @@
function basicElementCreateBuiltIn() {
let element = document.createElementNS(XUL_NS, "axulelement", { is: "test-built-in-element" });
ok(element instanceof TestCustomBuiltInElement, "Should be an instance of TestCustomBuiltInElement");
- is(element.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
document.querySelector("#content").appendChild(element);
is(element.textContent, "baz", "Should have set the textContent");
let element2 = element.cloneNode(false);
is(element2.localName, "axulelement", "Should see the right tag");
- is(element2.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element2.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
is(element2.textContent, "", "Shouldn't have cloned the textContent");
document.querySelector("#content").appendChild(element2);
is(element2.textContent, "baz", "Should have set the textContent");
@@ -188,13 +188,13 @@
function subclassElementCreateBuiltIn() {
let element = document.createElementNS(XUL_NS, "menupopup", { is: "test-popup-extend" });
ok(element instanceof TestPopupExtendElement, "Should be an instance of TestPopupExtendElement");
- is(element.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
document.querySelector("#content").appendChild(element);
is(element.textContent, "quuz", "Should have set the textContent");
let element2 = element.cloneNode(false);
is(element2.localName, "menupopup", "Should see the right tag");
- is(element2.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element2.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
is(element2.textContent, "", "Shouldn't have cloned the textContent");
document.querySelector("#content").appendChild(element2);
is(element2.textContent, "quuz", "Should have set the textContent");
@@ -268,13 +268,13 @@
let element = document.createElementNS(XUL_NS, "testwithoutdash", { is: "testwithoutdash-extended" });
ok(element instanceof TestWithoutDashExtended, "Should be an instance of TestWithoutDashExtended");
ok(element instanceof TestWithoutDash, "Should be an instance of TestWithoutDash");
- is(element.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
document.querySelector("#content").appendChild(element);
is(element.textContent, "quux", "Should have set the textContent");
let element2 = element.cloneNode(false);
is(element2.localName, "testwithoutdash", "Should see the right tag");
- is(element2.getAttribute("is"), "", "The |is| attribute of the created element should not be the extended type.");
+ is(element2.getAttribute("is"), null, "The |is| attribute of the created element should not be the extended type.");
is(element2.textContent, "", "Shouldn't have cloned the textContent");
document.querySelector("#content").appendChild(element2);
is(element2.textContent, "quux", "Should have set the textContent");
diff --git a/dom/tests/reftest/prettyprint-space-ref.xhtml b/dom/tests/reftest/prettyprint-space-ref.xhtml
new file mode 100644
index 0000000000..9169b9236e
--- /dev/null
+++ b/dom/tests/reftest/prettyprint-space-ref.xhtml
@@ -0,0 +1,67 @@
+<out>
+ <div id="top" xmlns="http://www.w3.org/1999/xhtml">
+ <link href="chrome://global/content/xml/XMLPrettyPrint.css" type="text/css" rel="stylesheet"/>
+ <div id="header">
+ <p>
+ This XML file does not appear to have any style information associated with it. The document tree is shown below.
+ </p>
+ </div>
+ <main id="tree" class="highlight">
+ <div>
+ <details open="" class="expandable-body">
+ <summary class="expandable-opening">
+ &lt;<span class="start-tag">out</span>&gt;
+ </summary>
+ <div class="expandable-children">
+ <span class="text">Here be sea hags. </span>
+ <div>
+ <details open="" class="expandable-body">
+ <summary class="expandable-opening">
+ &lt;<span class="start-tag">b</span> <span class="attribute-name">xml:space</span>=<span class="attribute-value">"preserve"</span>&gt;
+ </summary>
+ <div class="expandable-children">
+ <span class="text" style="white-space: pre-wrap">They need a lot of space, this much: .</span>
+ <div>
+ <details open="" class="expandable-body">
+ <summary class="expandable-opening">
+ &lt;<span class="start-tag">c</span>&gt;
+ </summary>
+ <div class="expandable-children">
+ <span class="text" style="white-space: pre-wrap">At least, most of them do: .</span>
+ <div>
+ <details open="" class="expandable-body">
+ <summary class="expandable-opening">
+ &lt;<span class="start-tag">d</span> <span class="attribute-name">xml:space</span>=<span class="attribute-value">"default"</span>&gt;
+ </summary>
+ <div class="expandable-children">
+ <span class="text" style="white-space: normal">But some of them don't, they only need one: . </span>
+ <div>
+ &lt;<span class="start-tag">e</span> <span class="attribute-name">xml:space</span>=<span class="attribute-value">"preserve"</span>&gt;<span class="text" style="white-space: pre-wrap">But their children might need more: .</span>&lt;/<span class="end-tag">e</span>&gt;
+ </div>
+ </div>
+ </details>
+ <span class="expandable-closing">
+ &lt;/<span class="end-tag">d</span>&gt;
+ </span>
+ </div>
+ </div>
+ </details>
+ <span class="expandable-closing">
+ &lt;/<span class="end-tag">c</span>&gt;
+ </span>
+ </div>
+ </div>
+ </details>
+ <span class="expandable-closing">
+ &lt;/<span class="end-tag">b</span>&gt;
+ </span>
+ </div>
+ </div>
+ </details>
+ <span class="expandable-closing">
+ &lt;/<span class="end-tag">out</span>&gt;
+ </span>
+ </div>
+ </main>
+ </div>
+</out>
diff --git a/dom/tests/reftest/prettyprint-space.xml b/dom/tests/reftest/prettyprint-space.xml
new file mode 100644
index 0000000000..4f995608f8
--- /dev/null
+++ b/dom/tests/reftest/prettyprint-space.xml
@@ -0,0 +1 @@
+<out>Here be sea hags. <b xml:space="preserve">They need a lot of space, this much: . <c>At least, most of them do: . <d xml:space="default">But some of them don't, they only need one: . <e xml:space="preserve">But their children might need more: .</e></d></c></b></out>
diff --git a/dom/tests/reftest/reftest.list b/dom/tests/reftest/reftest.list
index ee7069e2af..41f6ff6644 100644
--- a/dom/tests/reftest/reftest.list
+++ b/dom/tests/reftest/reftest.list
@@ -12,3 +12,4 @@ fuzzy(0-1,0-5) == bug559996.html bug559996-ref.html
== bug592366-2.xhtml bug592366-ref.xhtml
== bug798068.xhtml bug798068-ref.xhtml
== bug1389406.xml bug1389406-ref.xml
+== prettyprint-space.xml prettyprint-space-ref.xhtml
diff --git a/dom/tests/unit/test_PromiseDebugging.js b/dom/tests/unit/test_PromiseDebugging.js
index 6148b65c75..d8cd4209fa 100644
--- a/dom/tests/unit/test_PromiseDebugging.js
+++ b/dom/tests/unit/test_PromiseDebugging.js
@@ -1,5 +1,4 @@
function run_test() {
- // Hack around Promise.jsm being stuck on my global
Assert.equal(false, PromiseDebugging === undefined);
var res;
var p = new Promise(function (resolve) {
diff --git a/dom/tests/unit/test_xhr_init.js b/dom/tests/unit/test_xhr_init.js
index a2eaf2b4d7..0f7255806e 100644
--- a/dom/tests/unit/test_xhr_init.js
+++ b/dom/tests/unit/test_xhr_init.js
@@ -8,6 +8,14 @@ function run_test() {
Assert.ok(x.mozSystem);
x = new XMLHttpRequest();
+ Assert.ok(x.mozAnon);
+ Assert.ok(x.mozSystem);
+
+ Services.prefs.setBoolPref(
+ "network.fetch.systemDefaultsToOmittingCredentials",
+ false
+ );
+ x = new XMLHttpRequest();
Assert.ok(!x.mozAnon);
Assert.ok(x.mozSystem);
}