summaryrefslogtreecommitdiffstats
path: root/dom/base/test/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/test/chrome')
-rw-r--r--dom/base/test/chrome/bug418986-1.js3
-rw-r--r--dom/base/test/chrome/chrome.toml4
-rw-r--r--dom/base/test/chrome/file_bug549682.xhtml10
-rw-r--r--dom/base/test/chrome/file_bug616841.xhtml2
-rw-r--r--dom/base/test/chrome/test_bug1339722.html4
-rw-r--r--dom/base/test/chrome/test_bug339494.xhtml2
-rw-r--r--dom/base/test/chrome/test_bug429785.xhtml2
-rw-r--r--dom/base/test/chrome/test_bug430050.xhtml2
-rw-r--r--dom/base/test/chrome/test_chromeOuterWindowID.xhtml2
-rw-r--r--dom/base/test/chrome/test_swapFrameLoaders.xhtml25
-rw-r--r--dom/base/test/chrome/title_window.xhtml4
-rw-r--r--dom/base/test/chrome/window_nsITextInputProcessor.xhtml4
-rw-r--r--dom/base/test/chrome/window_swapFrameLoaders.xhtml223
13 files changed, 19 insertions, 268 deletions
diff --git a/dom/base/test/chrome/bug418986-1.js b/dom/base/test/chrome/bug418986-1.js
index 7c39df0c13..e7e3c63b5c 100644
--- a/dom/base/test/chrome/bug418986-1.js
+++ b/dom/base/test/chrome/bug418986-1.js
@@ -1,4 +1,7 @@
/* globals chromeWindow */
+
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
// The main test function.
var test = function (isContent) {
SimpleTest.waitForExplicitFinish();
diff --git a/dom/base/test/chrome/chrome.toml b/dom/base/test/chrome/chrome.toml
index b8439a2d2e..08265bcb97 100644
--- a/dom/base/test/chrome/chrome.toml
+++ b/dom/base/test/chrome/chrome.toml
@@ -18,7 +18,6 @@ support-files = [
"custom_element_ep.js",
"window_nsITextInputProcessor.xhtml",
"title_window.xhtml",
- "window_swapFrameLoaders.xhtml",
]
prefs = ["gfx.font_rendering.fallback.async=false"]
@@ -126,9 +125,6 @@ support-files = ["../dummy.html"]
["test_range_getClientRectsAndTexts.html"]
-["test_swapFrameLoaders.xhtml"]
-skip-if = ["os == 'mac'"] # bug 1674413
-
["test_title.xhtml"]
support-files = ["file_title.xhtml"]
diff --git a/dom/base/test/chrome/file_bug549682.xhtml b/dom/base/test/chrome/file_bug549682.xhtml
index 8ae05d38d8..0bb3080507 100644
--- a/dom/base/test/chrome/file_bug549682.xhtml
+++ b/dom/base/test/chrome/file_bug549682.xhtml
@@ -28,11 +28,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
}
var asyncPPML = false;
- function ppmASL(m) {
+ function ppmASL() {
asyncPPML = true;
}
var syncPPML = false;
- function ppmSL(m) {
+ function ppmSL() {
syncPPML = true;
}
ppm.addMessageListener("processmessageAsync", ppmASL);
@@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
cpm.sendSyncMessage("processmessageSync", "");
var asyncCPML = false;
- function cpmASL(m) {
+ function cpmASL() {
asyncCPML = true;
}
cpm.addMessageListener("childprocessmessage", cpmASL);
@@ -93,7 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var weakListener = {
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
- receiveMessage(msg) {
+ receiveMessage() {
if (weakMessageReceived) {
ok(false, 'Weak listener fired twice.');
return;
@@ -109,7 +109,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
var weakListener2 = {
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
- receiveMessage(msg) {
+ receiveMessage() {
ok(false, 'Should not have received a message.');
}
};
diff --git a/dom/base/test/chrome/file_bug616841.xhtml b/dom/base/test/chrome/file_bug616841.xhtml
index b0512d162c..3651a00226 100644
--- a/dom/base/test/chrome/file_bug616841.xhtml
+++ b/dom/base/test/chrome/file_bug616841.xhtml
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
[ "D", "\u010C" ] ];
var nCmps = 0;
- function recvContentReady(m) {
+ function recvContentReady() {
for (var i = 0; i < toCompare.length; ++i) {
var pair = toCompare[i];
messageManager.broadcastAsyncMessage("cmp",
diff --git a/dom/base/test/chrome/test_bug1339722.html b/dom/base/test/chrome/test_bug1339722.html
index d8d95f1faa..7655ff95fa 100644
--- a/dom/base/test/chrome/test_bug1339722.html
+++ b/dom/base/test/chrome/test_bug1339722.html
@@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
// behave similarly.
const TOPIC = "document-on-modify-request";
let win;
- const observe = (subject, topic, data) => {
+ const observe = (subject, topic) => {
info("Got " + topic);
Services.obs.removeObserver(observe, TOPIC);
@@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
// Remove the iframe to cause frameloader destroy.
iframe.remove();
- setTimeout($ => {
+ setTimeout(() => {
ok(!document.getElementById("testFrame"), "verify iframe removed");
SimpleTest.finish();
}, 0);
diff --git a/dom/base/test/chrome/test_bug339494.xhtml b/dom/base/test/chrome/test_bug339494.xhtml
index 203f6e644d..afab41b65c 100644
--- a/dom/base/test/chrome/test_bug339494.xhtml
+++ b/dom/base/test/chrome/test_bug339494.xhtml
@@ -55,7 +55,7 @@ SimpleTest.waitForExplicitFinish();
s.setAttribute("ggg", "testvalue");
await promiseFlushingMutationObserver();
- const observer = new MutationObserver((aMutationList, aObserver) => {
+ const observer = new MutationObserver(() => {
ok(s.hasAttribute("ggg"), "Value check 3. There should be a value");
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
diff --git a/dom/base/test/chrome/test_bug429785.xhtml b/dom/base/test/chrome/test_bug429785.xhtml
index fb51634fab..10c9977ccb 100644
--- a/dom/base/test/chrome/test_bug429785.xhtml
+++ b/dom/base/test/chrome/test_bug429785.xhtml
@@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
var errorLogged = false;
var listener = {
QueryInterface: ChromeUtils.generateQI(["nsIConsoleListener"]),
- observe(msg) { errorLogged = true; }
+ observe() { errorLogged = true; }
};
function step2() {
diff --git a/dom/base/test/chrome/test_bug430050.xhtml b/dom/base/test/chrome/test_bug430050.xhtml
index d7d6cf656c..dfe1e3c8ee 100644
--- a/dom/base/test/chrome/test_bug430050.xhtml
+++ b/dom/base/test/chrome/test_bug430050.xhtml
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430050
}
function startTest() {
- const observer = new MutationObserver((aMutationList, aObserver) => {
+ const observer = new MutationObserver(() => {
document.getElementById('b').setAttribute("src",
"data:text/plain,failed");
const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
diff --git a/dom/base/test/chrome/test_chromeOuterWindowID.xhtml b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml
index 1feb7c7c74..3aa482b636 100644
--- a/dom/base/test/chrome/test_chromeOuterWindowID.xhtml
+++ b/dom/base/test/chrome/test_chromeOuterWindowID.xhtml
@@ -42,7 +42,7 @@ windows.
"Both browsers should belong to the same document.");
let winID = getOuterWindowID(browser1.ownerGlobal);
- let getChildRootOuterId = browser => {
+ let getChildRootOuterId = () => {
try {
return docShell.browserChild?.chromeOuterWindowID;
} catch(ex) { }
diff --git a/dom/base/test/chrome/test_swapFrameLoaders.xhtml b/dom/base/test/chrome/test_swapFrameLoaders.xhtml
deleted file mode 100644
index 4ea11a1a62..0000000000
--- a/dom/base/test/chrome/test_swapFrameLoaders.xhtml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1242644
-Test swapFrameLoaders with different frame types and remoteness
--->
-<window title="Mozilla Bug 1242644"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1242644"
- target="_blank">Mozilla Bug 1242644</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
- SimpleTest.waitForExplicitFinish();
-
- window.openDialog("window_swapFrameLoaders.xhtml", "bug1242644",
- "chrome,width=600,height=600,noopener", window);
- ]]></script>
-</window>
diff --git a/dom/base/test/chrome/title_window.xhtml b/dom/base/test/chrome/title_window.xhtml
index f48cdaaaf1..5f9840c36c 100644
--- a/dom/base/test/chrome/title_window.xhtml
+++ b/dom/base/test/chrome/title_window.xhtml
@@ -63,10 +63,10 @@
}
}
- function listener2(ev) {
+ function listener2() {
inProgressDoc[description] = false;
}
- function listener3(ev) {
+ function listener3() {
inProgressWin[description] = false;
}
frame.addEventListener("DOMTitleChanged", listener);
diff --git a/dom/base/test/chrome/window_nsITextInputProcessor.xhtml b/dom/base/test/chrome/window_nsITextInputProcessor.xhtml
index c8ce6ee5e7..c62ba2ce47 100644
--- a/dom/base/test/chrome/window_nsITextInputProcessor.xhtml
+++ b/dom/base/test/chrome/window_nsITextInputProcessor.xhtml
@@ -4120,7 +4120,7 @@ function runUnloadTests1()
let oldSrc = iframe.src;
let parentWindow = window;
- iframe.addEventListener("load", function (aEvent) {
+ iframe.addEventListener("load", function () {
ok(true, description + "dummy page is loaded");
childWindow = iframe.contentWindow;
textareaInFrame = null;
@@ -4181,7 +4181,7 @@ function runUnloadTests2()
let oldSrc = iframe.src;
- iframe.addEventListener("load", function (aEvent) {
+ iframe.addEventListener("load", function () {
ok(true, description + "dummy page is loaded");
childWindow = iframe.contentWindow;
textareaInFrame = null;
diff --git a/dom/base/test/chrome/window_swapFrameLoaders.xhtml b/dom/base/test/chrome/window_swapFrameLoaders.xhtml
deleted file mode 100644
index 4a38bcc1fc..0000000000
--- a/dom/base/test/chrome/window_swapFrameLoaders.xhtml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1242644
-Test swapFrameLoaders with different frame types and remoteness
--->
-<window title="Mozilla Bug 1242644"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"><![CDATA[
- ["SimpleTest", "SpecialPowers", "info", "is", "ok", "add_task"].forEach(key => {
- window[key] = window.arguments[0][key];
- })
-
- const NS = {
- xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- html: "http://www.w3.org/1999/xhtml",
- }
-
- const TAG = {
- xul: "browser",
- html: "iframe", // mozbrowser
- }
-
- const SCENARIOS = [
- ["xul", "xul"],
- ["xul", "html"],
- ["html", "xul"],
- ["html", "html"],
- ["xul", "xul", { remote: true }],
- ["xul", "html", { remote: true }],
- ["html", "xul", { remote: true }],
- ["html", "html", { remote: true }],
- ["xul", "html", { userContextId: 2 }],
- ["xul", "html", { userContextId: 2, remote: true }],
- ];
-
- const HEIGHTS = [
- 200,
- 400
- ];
-
- function frameScript() {
- /* eslint-env mozilla/frame-script */
- addEventListener("load", function onLoad() {
- sendAsyncMessage("test:load");
- }, true);
- }
-
- // Watch for loads in new frames
- window.messageManager.loadFrameScript(`data:,(${frameScript})();`, true);
-
- function once(target, eventName, useCapture = false) {
- info("Waiting for event: '" + eventName + "' on " + target + ".");
-
- return new Promise(resolve => {
- for (let [add, remove] of [
- ["addEventListener", "removeEventListener"],
- ["addMessageListener", "removeMessageListener"],
- ]) {
- if ((add in target) && (remove in target)) {
- target[add](eventName, function onEvent(...aArgs) {
- info("Got event: '" + eventName + "' on " + target + ".");
- target[remove](eventName, onEvent, useCapture);
- resolve(aArgs);
- }, useCapture);
- break;
- }
- }
- });
- }
-
- async function addFrame(type, options, height) {
- let remote = options && options.remote;
- let userContextId = options && options.userContextId;
- let frame = document.createElementNS(NS[type], TAG[type]);
- frame.setAttribute("remote", remote);
- if (remote && type == "xul") {
- frame.setAttribute("style", "-moz-binding: none;");
- }
- if (userContextId) {
- frame.setAttribute("usercontextid", userContextId);
- }
- if (type == "html") {
- frame.setAttribute("mozbrowser", "true");
- frame.setAttribute("noisolation", "true");
- frame.setAttribute("allowfullscreen", "true");
- } else if (type == "xul") {
- frame.setAttribute("type", "content");
- }
- let src = `data:text/html,<!doctype html>` +
- `<body style="height:${height}px"/>`;
- frame.setAttribute("src", src);
- document.documentElement.appendChild(frame);
- let mm = frame.frameLoader.messageManager;
- await once(mm, "test:load");
- return frame;
- }
-
- add_task(async function() {
- for (let scenario of SCENARIOS) {
- let [ typeA, typeB, options ] = scenario;
- let heightA = HEIGHTS[0];
- info(`Adding frame A, type ${typeA}, options ${JSON.stringify(options)}, height ${heightA}`);
- let frameA = await addFrame(typeA, options, heightA);
-
- let heightB = HEIGHTS[1];
- info(`Adding frame B, type ${typeB}, options ${JSON.stringify(options)}, height ${heightB}`);
- let frameB = await addFrame(typeB, options, heightB);
-
- let frameScriptFactory = function(name) {
- /* eslint-env mozilla/frame-script */
- return `function() {
- addMessageListener("ping", function() {
- sendAsyncMessage("pong", "${name}");
- });
- addMessageListener("check-browser-api", function() {
- let exists = "api" in this;
- sendAsyncMessage("check-browser-api", {
- exists,
- running: exists && !this.api._shuttingDown,
- });
- });
- addEventListener("pagehide", function({ inFrameSwap }) {
- sendAsyncMessage("pagehide", inFrameSwap);
- }, {mozSystemGroup: true});
- }`;
- }
-
- // Load frame script into each frame
- {
- let mmA = frameA.frameLoader.messageManager;
- let mmB = frameB.frameLoader.messageManager;
-
- mmA.loadFrameScript("data:,(" + frameScriptFactory("A") + ")()", false);
- mmB.loadFrameScript("data:,(" + frameScriptFactory("B") + ")()", false);
- }
-
- // Ping before swap
- {
- let mmA = frameA.frameLoader.messageManager;
- let mmB = frameB.frameLoader.messageManager;
-
- let inflightA = once(mmA, "pong");
- let inflightB = once(mmB, "pong");
-
- info("Ping message manager for frame A");
- mmA.sendAsyncMessage("ping");
- let [ { data: pongA } ] = await inflightA;
- is(pongA, "A", "Frame A message manager gets reply A before swap");
-
- info("Ping message manager for frame B");
- mmB.sendAsyncMessage("ping");
- let [ { data: pongB } ] = await inflightB;
- is(pongB, "B", "Frame B message manager gets reply B before swap");
- }
-
- // Ping after swap using message managers acquired before
- {
- let mmA = frameA.frameLoader.messageManager;
- let mmB = frameB.frameLoader.messageManager;
-
- let pagehideA = once(mmA, "pagehide");
- let pagehideB = once(mmB, "pagehide");
-
- info("swapFrameLoaders");
- frameA.swapFrameLoaders(frameB);
-
- let [ { data: inFrameSwapA } ] = await pagehideA;
- ok(inFrameSwapA, "Frame A got pagehide with inFrameSwap: true");
- let [ { data: inFrameSwapB } ] = await pagehideB;
- ok(inFrameSwapB, "Frame B got pagehide with inFrameSwap: true");
-
- let inflightA = once(mmA, "pong");
- let inflightB = once(mmB, "pong");
-
- info("Ping message manager for frame A");
- mmA.sendAsyncMessage("ping");
- let [ { data: pongA } ] = await inflightA;
- is(pongA, "B", "Frame A message manager acquired before swap gets reply B after swap");
-
- info("Ping message manager for frame B");
- mmB.sendAsyncMessage("ping");
- let [ { data: pongB } ] = await inflightB;
- is(pongB, "A", "Frame B message manager acquired before swap gets reply A after swap");
- }
-
- // Check height after swap
- if (frameA.getContentDimensions) {
- let { height } = await frameA.getContentDimensions();
- is(height, heightB, "Frame A's content height is 400px after swap");
- }
- if (frameB.getContentDimensions) {
- let { height } = await frameB.getContentDimensions();
- is(height, heightA, "Frame B's content height is 200px after swap");
- }
-
- // Ping after swap using message managers acquired after
- {
- let mmA = frameA.frameLoader.messageManager;
- let mmB = frameB.frameLoader.messageManager;
-
- let inflightA = once(mmA, "pong");
- let inflightB = once(mmB, "pong");
-
- info("Ping message manager for frame A");
- mmA.sendAsyncMessage("ping");
- let [ { data: pongA } ] = await inflightA;
- is(pongA, "B", "Frame A message manager acquired after swap gets reply B after swap");
-
- info("Ping message manager for frame B");
- mmB.sendAsyncMessage("ping");
- let [ { data: pongB } ] = await inflightB;
- is(pongB, "A", "Frame B message manager acquired after swap gets reply A after swap");
- }
-
- frameA.remove();
- frameB.remove();
- }
- });
- ]]></script>
-</window>