summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/tests/mochitest
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest')
-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
5 files changed, 48 insertions, 18 deletions
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");