Bug 1864896: Autofix unused function arguments (dom). r=emilio,media-playback-reviewers,dom-storage-reviewers,padenot,janv
Differential Revision: https://phabricator.services.mozilla.com/D202962
This commit is contained in:
@@ -9,7 +9,7 @@ if (DEBUG) {
|
|||||||
dump("-*- IndexedDBHelper: " + s + "\n");
|
dump("-*- IndexedDBHelper: " + s + "\n");
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
debug = function (s) {};
|
debug = function () {};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getErrorName(err) {
|
function getErrorName(err) {
|
||||||
@@ -70,7 +70,7 @@ IndexedDBHelper.prototype = {
|
|||||||
debug("Opened database:" + self.dbName + " " + self.dbVersion);
|
debug("Opened database:" + self.dbName + " " + self.dbVersion);
|
||||||
}
|
}
|
||||||
self._db = event.target.result;
|
self._db = event.target.result;
|
||||||
self._db.onversionchange = function (event) {
|
self._db.onversionchange = function () {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
debug("WARNING: DB modified from a different window.");
|
debug("WARNING: DB modified from a different window.");
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ IndexedDBHelper.prototype = {
|
|||||||
}
|
}
|
||||||
invokeCallbacks(getErrorName(aEvent.target.error));
|
invokeCallbacks(getErrorName(aEvent.target.error));
|
||||||
};
|
};
|
||||||
req.onblocked = function (aEvent) {
|
req.onblocked = function () {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
debug("Opening database request is blocked.");
|
debug("Opening database request is blocked.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||||||
}
|
}
|
||||||
|
|
||||||
var asyncPPML = false;
|
var asyncPPML = false;
|
||||||
function ppmASL(m) {
|
function ppmASL() {
|
||||||
asyncPPML = true;
|
asyncPPML = true;
|
||||||
}
|
}
|
||||||
var syncPPML = false;
|
var syncPPML = false;
|
||||||
function ppmSL(m) {
|
function ppmSL() {
|
||||||
syncPPML = true;
|
syncPPML = true;
|
||||||
}
|
}
|
||||||
ppm.addMessageListener("processmessageAsync", ppmASL);
|
ppm.addMessageListener("processmessageAsync", ppmASL);
|
||||||
@@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||||||
cpm.sendSyncMessage("processmessageSync", "");
|
cpm.sendSyncMessage("processmessageSync", "");
|
||||||
|
|
||||||
var asyncCPML = false;
|
var asyncCPML = false;
|
||||||
function cpmASL(m) {
|
function cpmASL() {
|
||||||
asyncCPML = true;
|
asyncCPML = true;
|
||||||
}
|
}
|
||||||
cpm.addMessageListener("childprocessmessage", cpmASL);
|
cpm.addMessageListener("childprocessmessage", cpmASL);
|
||||||
@@ -93,7 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||||||
var weakListener = {
|
var weakListener = {
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
|
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
|
||||||
|
|
||||||
receiveMessage(msg) {
|
receiveMessage() {
|
||||||
if (weakMessageReceived) {
|
if (weakMessageReceived) {
|
||||||
ok(false, 'Weak listener fired twice.');
|
ok(false, 'Weak listener fired twice.');
|
||||||
return;
|
return;
|
||||||
@@ -109,7 +109,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||||||
var weakListener2 = {
|
var weakListener2 = {
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
|
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
|
||||||
|
|
||||||
receiveMessage(msg) {
|
receiveMessage() {
|
||||||
ok(false, 'Should not have received a message.');
|
ok(false, 'Should not have received a message.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||||||
[ "D", "\u010C" ] ];
|
[ "D", "\u010C" ] ];
|
||||||
var nCmps = 0;
|
var nCmps = 0;
|
||||||
|
|
||||||
function recvContentReady(m) {
|
function recvContentReady() {
|
||||||
for (var i = 0; i < toCompare.length; ++i) {
|
for (var i = 0; i < toCompare.length; ++i) {
|
||||||
var pair = toCompare[i];
|
var pair = toCompare[i];
|
||||||
messageManager.broadcastAsyncMessage("cmp",
|
messageManager.broadcastAsyncMessage("cmp",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
|
|||||||
// behave similarly.
|
// behave similarly.
|
||||||
const TOPIC = "document-on-modify-request";
|
const TOPIC = "document-on-modify-request";
|
||||||
let win;
|
let win;
|
||||||
const observe = (subject, topic, data) => {
|
const observe = (subject, topic) => {
|
||||||
info("Got " + topic);
|
info("Got " + topic);
|
||||||
Services.obs.removeObserver(observe, 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.
|
// Remove the iframe to cause frameloader destroy.
|
||||||
iframe.remove();
|
iframe.remove();
|
||||||
setTimeout($ => {
|
setTimeout(() => {
|
||||||
ok(!document.getElementById("testFrame"), "verify iframe removed");
|
ok(!document.getElementById("testFrame"), "verify iframe removed");
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ SimpleTest.waitForExplicitFinish();
|
|||||||
s.setAttribute("ggg", "testvalue");
|
s.setAttribute("ggg", "testvalue");
|
||||||
await promiseFlushingMutationObserver();
|
await promiseFlushingMutationObserver();
|
||||||
|
|
||||||
const observer = new MutationObserver((aMutationList, aObserver) => {
|
const observer = new MutationObserver(() => {
|
||||||
ok(s.hasAttribute("ggg"), "Value check 3. There should be a value");
|
ok(s.hasAttribute("ggg"), "Value check 3. There should be a value");
|
||||||
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
|
isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
|
||||||
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
|
is(s.getAttribute("ggg"), "othervalue", "Value check 5");
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
|
|||||||
var errorLogged = false;
|
var errorLogged = false;
|
||||||
var listener = {
|
var listener = {
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsIConsoleListener"]),
|
QueryInterface: ChromeUtils.generateQI(["nsIConsoleListener"]),
|
||||||
observe(msg) { errorLogged = true; }
|
observe() { errorLogged = true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
function step2() {
|
function step2() {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430050
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startTest() {
|
function startTest() {
|
||||||
const observer = new MutationObserver((aMutationList, aObserver) => {
|
const observer = new MutationObserver(() => {
|
||||||
document.getElementById('b').setAttribute("src",
|
document.getElementById('b').setAttribute("src",
|
||||||
"data:text/plain,failed");
|
"data:text/plain,failed");
|
||||||
const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
const systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ windows.
|
|||||||
"Both browsers should belong to the same document.");
|
"Both browsers should belong to the same document.");
|
||||||
let winID = getOuterWindowID(browser1.ownerGlobal);
|
let winID = getOuterWindowID(browser1.ownerGlobal);
|
||||||
|
|
||||||
let getChildRootOuterId = browser => {
|
let getChildRootOuterId = () => {
|
||||||
try {
|
try {
|
||||||
return docShell.browserChild?.chromeOuterWindowID;
|
return docShell.browserChild?.chromeOuterWindowID;
|
||||||
} catch(ex) { }
|
} catch(ex) { }
|
||||||
|
|||||||
@@ -63,10 +63,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function listener2(ev) {
|
function listener2() {
|
||||||
inProgressDoc[description] = false;
|
inProgressDoc[description] = false;
|
||||||
}
|
}
|
||||||
function listener3(ev) {
|
function listener3() {
|
||||||
inProgressWin[description] = false;
|
inProgressWin[description] = false;
|
||||||
}
|
}
|
||||||
frame.addEventListener("DOMTitleChanged", listener);
|
frame.addEventListener("DOMTitleChanged", listener);
|
||||||
|
|||||||
@@ -4120,7 +4120,7 @@ function runUnloadTests1()
|
|||||||
let oldSrc = iframe.src;
|
let oldSrc = iframe.src;
|
||||||
let parentWindow = window;
|
let parentWindow = window;
|
||||||
|
|
||||||
iframe.addEventListener("load", function (aEvent) {
|
iframe.addEventListener("load", function () {
|
||||||
ok(true, description + "dummy page is loaded");
|
ok(true, description + "dummy page is loaded");
|
||||||
childWindow = iframe.contentWindow;
|
childWindow = iframe.contentWindow;
|
||||||
textareaInFrame = null;
|
textareaInFrame = null;
|
||||||
@@ -4181,7 +4181,7 @@ function runUnloadTests2()
|
|||||||
|
|
||||||
let oldSrc = iframe.src;
|
let oldSrc = iframe.src;
|
||||||
|
|
||||||
iframe.addEventListener("load", function (aEvent) {
|
iframe.addEventListener("load", function () {
|
||||||
ok(true, description + "dummy page is loaded");
|
ok(true, description + "dummy page is loaded");
|
||||||
childWindow = iframe.contentWindow;
|
childWindow = iframe.contentWindow;
|
||||||
textareaInFrame = null;
|
textareaInFrame = null;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ function thirdEntry(event) {
|
|||||||
gOuterDoc.exitFullscreen();
|
gOuterDoc.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
function earlyExit(event) {
|
function earlyExit() {
|
||||||
ok(false, "MozDOMFullscreen:Exited should only be triggered after cancel all fullscreen");
|
ok(false, "MozDOMFullscreen:Exited should only be triggered after cancel all fullscreen");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ function preventBFCache(aBrowsingContext, aPrevent) {
|
|||||||
let target = content.document.getElementById("div");
|
let target = content.document.getElementById("div");
|
||||||
target.addEventListener(
|
target.addEventListener(
|
||||||
"mousedown",
|
"mousedown",
|
||||||
function (e) {
|
function () {
|
||||||
content.window.history.back();
|
content.window.history.back();
|
||||||
},
|
},
|
||||||
{ once: true }
|
{ once: true }
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ async function WaitRemoveDocumentAndCloseTab(aBrowser, aBrowsingContext) {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
content.document.addEventListener(
|
content.document.addEventListener(
|
||||||
"fullscreenchange",
|
"fullscreenchange",
|
||||||
e => {
|
() => {
|
||||||
resolve();
|
resolve();
|
||||||
},
|
},
|
||||||
{ once: true }
|
{ once: true }
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ function enter2(event) {
|
|||||||
promise = document.exitFullscreen();
|
promise = document.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
function exit2(event) {
|
function exit2() {
|
||||||
is(document.fullscreenElement, null,
|
is(document.fullscreenElement, null,
|
||||||
"Full-screen element should have rolled back.");
|
"Full-screen element should have rolled back.");
|
||||||
is(iframe.contentDocument.fullscreenElement, null,
|
is(iframe.contentDocument.fullscreenElement, null,
|
||||||
@@ -156,7 +156,7 @@ function exit3(event) {
|
|||||||
promise = outOfDocElement.requestFullscreen();
|
promise = outOfDocElement.requestFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
function error1(event) {
|
function error1() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Requests for full-screen from not-in-doc elements should fail.");
|
"Requests for full-screen from not-in-doc elements should fail.");
|
||||||
assertPromiseRejected(promise, "in error1");
|
assertPromiseRejected(promise, "in error1");
|
||||||
@@ -181,7 +181,7 @@ function enter4(event) {
|
|||||||
"Should not have a full-screen element again.");
|
"Should not have a full-screen element again.");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function exit_to_arg_test_1(event) {
|
async function exit_to_arg_test_1() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should have left full-screen mode (third time).");
|
"Should have left full-screen mode (third time).");
|
||||||
addFullscreenChangeContinuation("enter", enter_from_arg_test_1);
|
addFullscreenChangeContinuation("enter", enter_from_arg_test_1);
|
||||||
@@ -196,14 +196,14 @@ async function exit_to_arg_test_1(event) {
|
|||||||
ok(!threw, "requestFullscreen with bogus arg (123) shouldn't throw exception");
|
ok(!threw, "requestFullscreen with bogus arg (123) shouldn't throw exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
function enter_from_arg_test_1(event) {
|
function enter_from_arg_test_1() {
|
||||||
ok(document.fullscreenElement,
|
ok(document.fullscreenElement,
|
||||||
"Should have entered full-screen after calling with bogus (ignored) argument (fourth time)");
|
"Should have entered full-screen after calling with bogus (ignored) argument (fourth time)");
|
||||||
addFullscreenChangeContinuation("exit", exit_to_arg_test_2);
|
addFullscreenChangeContinuation("exit", exit_to_arg_test_2);
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function exit_to_arg_test_2(event) {
|
async function exit_to_arg_test_2() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should have left full-screen mode (fourth time).");
|
"Should have left full-screen mode (fourth time).");
|
||||||
addFullscreenChangeContinuation("enter", enter_from_arg_test_2);
|
addFullscreenChangeContinuation("enter", enter_from_arg_test_2);
|
||||||
@@ -218,14 +218,14 @@ async function exit_to_arg_test_2(event) {
|
|||||||
ok(!threw, "requestFullscreen with { vrDisplay: null } shouldn't throw exception");
|
ok(!threw, "requestFullscreen with { vrDisplay: null } shouldn't throw exception");
|
||||||
}
|
}
|
||||||
|
|
||||||
function enter_from_arg_test_2(event) {
|
function enter_from_arg_test_2() {
|
||||||
ok(document.fullscreenElement,
|
ok(document.fullscreenElement,
|
||||||
"Should have entered full-screen after calling with vrDisplay null argument (fifth time)");
|
"Should have entered full-screen after calling with vrDisplay null argument (fifth time)");
|
||||||
addFullscreenChangeContinuation("exit", exit4);
|
addFullscreenChangeContinuation("exit", exit4);
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
function exit4(event) {
|
function exit4() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should be back in non-full-screen mode (fifth time)");
|
"Should be back in non-full-screen mode (fifth time)");
|
||||||
SpecialPowers.pushPrefEnv({"set":[["full-screen-api.allow-trusted-requests-only", true]]}, function() {
|
SpecialPowers.pushPrefEnv({"set":[["full-screen-api.allow-trusted-requests-only", true]]}, function() {
|
||||||
@@ -234,7 +234,7 @@ function exit4(event) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function error2(event) {
|
function error2() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should still be in normal mode, because calling context isn't trusted.");
|
"Should still be in normal mode, because calling context isn't trusted.");
|
||||||
button = document.createElement("button");
|
button = document.createElement("button");
|
||||||
@@ -246,13 +246,13 @@ function error2(event) {
|
|||||||
sendMouseClick(button);
|
sendMouseClick(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enter5(event) {
|
function enter5() {
|
||||||
ok(document.fullscreenElement, "Moved to full-screen after mouse click");
|
ok(document.fullscreenElement, "Moved to full-screen after mouse click");
|
||||||
addFullscreenChangeContinuation("exit", exit5);
|
addFullscreenChangeContinuation("exit", exit5);
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
function exit5(event) {
|
function exit5() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should have left full-screen mode (last time).");
|
"Should have left full-screen mode (last time).");
|
||||||
SpecialPowers.pushPrefEnv({
|
SpecialPowers.pushPrefEnv({
|
||||||
@@ -264,7 +264,7 @@ function exit5(event) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function error3(event) {
|
function error3() {
|
||||||
ok(!document.fullscreenElement,
|
ok(!document.fullscreenElement,
|
||||||
"Should still be in normal mode, because pref is not enabled.");
|
"Should still be in normal mode, because pref is not enabled.");
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<button>Launch</button>
|
<button>Launch</button>
|
||||||
<script>
|
<script>
|
||||||
let button = document.querySelector("button");
|
let button = document.querySelector("button");
|
||||||
button.addEventListener("click", function(e) {
|
button.addEventListener("click", function() {
|
||||||
let newWindow = window.open("", "", "newWindow");
|
let newWindow = window.open("", "", "newWindow");
|
||||||
newWindow.document.write(`<!DOCTYPE HTML>
|
newWindow.document.write(`<!DOCTYPE HTML>
|
||||||
<button>click me!</button>
|
<button>click me!</button>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<button>click me!</button>
|
<button>click me!</button>
|
||||||
<script>
|
<script>
|
||||||
let button = document.querySelector("button");
|
let button = document.querySelector("button");
|
||||||
button.addEventListener("click", function(e) {
|
button.addEventListener("click", function() {
|
||||||
document.documentElement.requestFullscreen();
|
document.documentElement.requestFullscreen();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ function requestFullscreenMouseBtn(event, button) {
|
|||||||
synthesizeMouseAtCenter(clickEl, { button });
|
synthesizeMouseAtCenter(clickEl, { button });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testFullscreenMouseBtn(event, button, next) {
|
async function testFullscreenMouseBtn() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
"set": [["full-screen-api.mouse-event-allow-left-button-only", true]]
|
"set": [["full-screen-api.mouse-event-allow-left-button-only", true]]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function is(a, b, msg) {
|
|||||||
var escKeyReceived = false;
|
var escKeyReceived = false;
|
||||||
var escKeySent = false;
|
var escKeySent = false;
|
||||||
|
|
||||||
function keyHandler(event) {
|
function keyHandler() {
|
||||||
if (escKeyReceived == KeyboardEvent.DOM_VK_ESC) {
|
if (escKeyReceived == KeyboardEvent.DOM_VK_ESC) {
|
||||||
escKeyReceived = true;
|
escKeyReceived = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ function finish() {
|
|||||||
opener.nextTest();
|
opener.nextTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
function fullscreenchange1(event) {
|
function fullscreenchange1() {
|
||||||
is(document.fullscreenElement, document.body, "FSE should be doc");
|
is(document.fullscreenElement, document.body, "FSE should be doc");
|
||||||
addFullscreenChangeContinuation("exit", fullscreenchange2);
|
addFullscreenChangeContinuation("exit", fullscreenchange2);
|
||||||
ok(!document.getElementById("subdoc").contentWindow.escKeySent, "Should not yet have sent ESC key press.");
|
ok(!document.getElementById("subdoc").contentWindow.escKeySent, "Should not yet have sent ESC key press.");
|
||||||
document.getElementById("subdoc").contentWindow.startTest();
|
document.getElementById("subdoc").contentWindow.startTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
function fullscreenchange2(event) {
|
function fullscreenchange2() {
|
||||||
ok(document.getElementById("subdoc").contentWindow.escKeySent, "Should have sent ESC key press.");
|
ok(document.getElementById("subdoc").contentWindow.escKeySent, "Should have sent ESC key press.");
|
||||||
ok(!document.getElementById("subdoc").contentWindow.escKeyReceived, "ESC key press to exit should not be delivered.");
|
ok(!document.getElementById("subdoc").contentWindow.escKeyReceived, "ESC key press to exit should not be delivered.");
|
||||||
ok(!document.fullscreenElement, "Should have left full-screen mode on ESC key press");
|
ok(!document.fullscreenElement, "Should have left full-screen mode on ESC key press");
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
var elem = shadowRoot.firstChild;
|
var elem = shadowRoot.firstChild;
|
||||||
var gotFullscreenEvent = false;
|
var gotFullscreenEvent = false;
|
||||||
|
|
||||||
document.addEventListener("fullscreenchange", function (e) {
|
document.addEventListener("fullscreenchange", function () {
|
||||||
if (document.fullscreenElement === host) {
|
if (document.fullscreenElement === host) {
|
||||||
is(shadowRoot.fullscreenElement, elem,
|
is(shadowRoot.fullscreenElement, elem,
|
||||||
"Expected element entered fullsceen");
|
"Expected element entered fullsceen");
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
var elem = document.getElementById("svg-elem")
|
var elem = document.getElementById("svg-elem")
|
||||||
, elemWasLocked = false;
|
, elemWasLocked = false;
|
||||||
|
|
||||||
document.addEventListener("fullscreenchange", function (e) {
|
document.addEventListener("fullscreenchange", function () {
|
||||||
if (document.fullscreenElement === elem) {
|
if (document.fullscreenElement === elem) {
|
||||||
elemWasLocked = true;
|
elemWasLocked = true;
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
window.addEventListener("fullscreen", onFullScreen, true);
|
window.addEventListener("fullscreen", onFullScreen, true);
|
||||||
|
|
||||||
function onFullScreen(event)
|
function onFullScreen()
|
||||||
{
|
{
|
||||||
window.arguments[0].done(window.fullScreen);
|
window.arguments[0].done(window.fullScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function waitWidgetFullscreenEvent(
|
|||||||
aIsInFullscreen,
|
aIsInFullscreen,
|
||||||
aWaitUntil = false
|
aWaitUntil = false
|
||||||
) {
|
) {
|
||||||
return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, aEvent => {
|
return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, () => {
|
||||||
if (
|
if (
|
||||||
aWaitUntil &&
|
aWaitUntil &&
|
||||||
aIsInFullscreen !=
|
aIsInFullscreen !=
|
||||||
@@ -106,7 +106,7 @@ function waitForFullScreenObserver(
|
|||||||
aIsInFullscreen,
|
aIsInFullscreen,
|
||||||
aWaitUntil = false
|
aWaitUntil = false
|
||||||
) {
|
) {
|
||||||
return TestUtils.topicObserved("fullscreen-painted", (subject, data) => {
|
return TestUtils.topicObserved("fullscreen-painted", () => {
|
||||||
if (
|
if (
|
||||||
aWaitUntil &&
|
aWaitUntil &&
|
||||||
aIsInFullscreen !=
|
aIsInFullscreen !=
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function runNextTest() {
|
|||||||
// otherwise, the fullscreen request might be denied.
|
// otherwise, the fullscreen request might be denied.
|
||||||
if (testWindow.document.hidden) {
|
if (testWindow.document.hidden) {
|
||||||
info("Waiting for document to unhide");
|
info("Waiting for document to unhide");
|
||||||
waitForEvent(testWindow.document, "visibilitychange", (event) => {
|
waitForEvent(testWindow.document, "visibilitychange", () => {
|
||||||
return !testWindow.document.hidden;
|
return !testWindow.document.hidden;
|
||||||
}, testWindow.begin);
|
}, testWindow.begin);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const button = document.querySelector("button");
|
|||||||
let clickCount = 0;
|
let clickCount = 0;
|
||||||
let lastFullscreenPromise = null;
|
let lastFullscreenPromise = null;
|
||||||
let shouldEnterFullscreen = false;
|
let shouldEnterFullscreen = false;
|
||||||
button.addEventListener("click", function(e) {
|
button.addEventListener("click", function() {
|
||||||
clickCount++;
|
clickCount++;
|
||||||
if (shouldEnterFullscreen) {
|
if (shouldEnterFullscreen) {
|
||||||
const fullscreenElement = document.getElementById("fullscreen");
|
const fullscreenElement = document.getElementById("fullscreen");
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function asyncXHR(expectedStatus, nextTestFunc) {
|
|||||||
xhr.open("GET", "http://localhost:4444/test_error_code.xml", true);
|
xhr.open("GET", "http://localhost:4444/test_error_code.xml", true);
|
||||||
|
|
||||||
var sawError = false;
|
var sawError = false;
|
||||||
xhr.addEventListener("loadend", function doAsyncRequest_onLoad(event) {
|
xhr.addEventListener("loadend", function doAsyncRequest_onLoad() {
|
||||||
Assert.ok(sawError, "Should have received an error");
|
Assert.ok(sawError, "Should have received an error");
|
||||||
nextTestFunc();
|
nextTestFunc();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -373,10 +373,10 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) {
|
|||||||
case 0:
|
case 0:
|
||||||
// Keyboard issued
|
// Keyboard issued
|
||||||
cutCopyAll(
|
cutCopyAll(
|
||||||
function docut(aSucc) {
|
function docut() {
|
||||||
synthesizeKey("x", { accelKey: true });
|
synthesizeKey("x", { accelKey: true });
|
||||||
},
|
},
|
||||||
function docopy(aSucc) {
|
function docopy() {
|
||||||
synthesizeKey("c", { accelKey: true });
|
synthesizeKey("c", { accelKey: true });
|
||||||
},
|
},
|
||||||
function done() {
|
function done() {
|
||||||
@@ -411,14 +411,14 @@ function allMechanisms(aCb, aClipOverride, aNegateAll) {
|
|||||||
case 2:
|
case 2:
|
||||||
// Not triggered by user gesture
|
// Not triggered by user gesture
|
||||||
cutCopyAll(
|
cutCopyAll(
|
||||||
function doCut(aSucc) {
|
function doCut() {
|
||||||
is(
|
is(
|
||||||
false,
|
false,
|
||||||
document.execCommand("cut"),
|
document.execCommand("cut"),
|
||||||
"Can't directly execCommand not in a user callback"
|
"Can't directly execCommand not in a user callback"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
function doCopy(aSucc) {
|
function doCopy() {
|
||||||
is(
|
is(
|
||||||
false,
|
false,
|
||||||
document.execCommand("copy"),
|
document.execCommand("copy"),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ SimpleTest.requestFlakyTimeout("Need to test setTimeout");
|
|||||||
function startTest(aTestAsyncFun, aAllowPopup = true) {
|
function startTest(aTestAsyncFun, aAllowPopup = true) {
|
||||||
return new Promise(aResolve => {
|
return new Promise(aResolve => {
|
||||||
let target = document.getElementById("target");
|
let target = document.getElementById("target");
|
||||||
target.addEventListener("click", (e) => {
|
target.addEventListener("click", () => {
|
||||||
aTestAsyncFun(() => {
|
aTestAsyncFun(() => {
|
||||||
let w = window.open("about:blank");
|
let w = window.open("about:blank");
|
||||||
is(!!w, aAllowPopup, `Should ${aAllowPopup ? "allow" : "block"} popup`);
|
is(!!w, aAllowPopup, `Should ${aAllowPopup ? "allow" : "block"} popup`);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ if (!opener) {
|
|||||||
SimpleTest.waitForFocus(async function() {
|
SimpleTest.waitForFocus(async function() {
|
||||||
function waitForEvent(aTarget, aEvent) {
|
function waitForEvent(aTarget, aEvent) {
|
||||||
return new Promise((aResolve) => {
|
return new Promise((aResolve) => {
|
||||||
aTarget.addEventListener(aEvent, function listener(event) {
|
aTarget.addEventListener(aEvent, function listener() {
|
||||||
aResolve();
|
aResolve();
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -93,12 +93,12 @@ TestInterfaceJS.prototype = {
|
|||||||
pingPongNullableUnion(x) {
|
pingPongNullableUnion(x) {
|
||||||
return x;
|
return x;
|
||||||
},
|
},
|
||||||
returnBadUnion(x) {
|
returnBadUnion() {
|
||||||
return 3;
|
return 3;
|
||||||
},
|
},
|
||||||
|
|
||||||
testSequenceOverload(arg) {},
|
testSequenceOverload() {},
|
||||||
testSequenceUnion(arg) {},
|
testSequenceUnion() {},
|
||||||
|
|
||||||
testThrowError() {
|
testThrowError() {
|
||||||
throw new this._win.Error("We are an Error");
|
throw new this._win.Error("We are an Error");
|
||||||
@@ -121,7 +121,7 @@ TestInterfaceJS.prototype = {
|
|||||||
throw Cr.NS_BINDING_ABORTED;
|
throw Cr.NS_BINDING_ABORTED;
|
||||||
},
|
},
|
||||||
|
|
||||||
testThrowNsresultFromNative(x) {
|
testThrowNsresultFromNative() {
|
||||||
// We want to throw an exception that we generate from an nsresult thrown
|
// We want to throw an exception that we generate from an nsresult thrown
|
||||||
// by a C++ component.
|
// by a C++ component.
|
||||||
Services.io.notImplemented();
|
Services.io.notImplemented();
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ async function test_data_single() {
|
|||||||
let blockingPromises = [];
|
let blockingPromises = [];
|
||||||
for (let i = 0; i < 10; ++i) {
|
for (let i = 0; i < 10; ++i) {
|
||||||
let unblocker;
|
let unblocker;
|
||||||
let promise = new Promise((resolve, reject) => {
|
let promise = new Promise((resolve) => {
|
||||||
unblocker = resolve;
|
unblocker = resolve;
|
||||||
});
|
});
|
||||||
unblockers.push(unblocker);
|
unblockers.push(unblocker);
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1123516
|
|||||||
ok(true, "Calling iterators via xrays should fail");
|
ok(true, "Calling iterators via xrays should fail");
|
||||||
}
|
}
|
||||||
|
|
||||||
setlike.forEach((v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
|
setlike.forEach((v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
|
||||||
TestInterfaceSetlikeNode.prototype.forEach.call(setlike,
|
TestInterfaceSetlikeNode.prototype.forEach.call(setlike,
|
||||||
(v,k,t) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
|
(v) => { is(v, win.document.documentElement, "Cross-compartment forEach works"); });
|
||||||
is(TestInterfaceSetlikeNode.prototype.delete.call(setlike, win.document.documentElement), true,
|
is(TestInterfaceSetlikeNode.prototype.delete.call(setlike, win.document.documentElement), true,
|
||||||
"Cross-compartment unwrapping/comparison delete works");
|
"Cross-compartment unwrapping/comparison delete works");
|
||||||
/* eslint-disable-next-line no-shadow */
|
/* eslint-disable-next-line no-shadow */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ add_task(function testObservableArray_length() {
|
|||||||
let deleteCallbackTests = null;
|
let deleteCallbackTests = null;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value, index) {
|
||||||
@@ -82,10 +82,10 @@ add_task(function testObservableArray_length_callback_throw() {
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value) {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("deleteBooleanCallback");
|
throw new Error("deleteBooleanCallback");
|
||||||
@@ -268,7 +268,7 @@ add_task(function testObservableArray_setter_callback_throw() {
|
|||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value) {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("deleteBooleanCallback");
|
throw new Error("deleteBooleanCallback");
|
||||||
@@ -437,7 +437,7 @@ add_task(function testObservableArray_indexed_setter_callback_throw() {
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback(value) {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
@@ -501,7 +501,7 @@ add_task(function testObservableArray_object() {
|
|||||||
is(index, callbackIndex++, "setCallbackTests: test index argument");
|
is(index, callbackIndex++, "setCallbackTests: test index argument");
|
||||||
isDeeply(values[index], value, "setCallbackTests: test value argument");
|
isDeeply(values[index], value, "setCallbackTests: test value argument");
|
||||||
},
|
},
|
||||||
deleteObjectCallback(value, index) {
|
deleteObjectCallback() {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -521,10 +521,10 @@ add_task(function testObservableArray_object() {
|
|||||||
|
|
||||||
add_task(function testObservableArray_xrays() {
|
add_task(function testObservableArray_xrays() {
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setObjectCallback(value, index) {
|
setObjectCallback() {
|
||||||
ok(false, "Shouldn't reach setObjectCallback");
|
ok(false, "Shouldn't reach setObjectCallback");
|
||||||
},
|
},
|
||||||
deleteObjectCallback(value, index) {
|
deleteObjectCallback() {
|
||||||
ok(false, "Shouldn't reach deleteObjectCallback");
|
ok(false, "Shouldn't reach deleteObjectCallback");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ add_task(function testObservableArray_helper_replaceElementAt_callback_throw() {
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback(value) {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
@@ -170,7 +170,7 @@ add_task(function testObservableArray_helper_appendElement() {
|
|||||||
setCallbackTests(value, index);
|
setCallbackTests(value, index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback() {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -211,13 +211,13 @@ add_task(function testObservableArray_helper_appendElement_callback_throw() {
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback(value) {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback() {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -257,7 +257,7 @@ add_task(function testObservableArray_helper_removeLastElement() {
|
|||||||
let deleteCallbackTests = null;
|
let deleteCallbackTests = null;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value, index) {
|
||||||
@@ -316,10 +316,10 @@ add_task(function testObservableArray_helper_removeLastElement_callback_throw()
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value) {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("deleteBooleanCallback");
|
throw new Error("deleteBooleanCallback");
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ add_task(function testObservableArrayExoticObjects_defineProperty_callback_throw
|
|||||||
|
|
||||||
const minLen = 3;
|
const minLen = 3;
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback(value) {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
@@ -300,7 +300,7 @@ add_task(function testObservableArrayExoticObjects_deleteProperty() {
|
|||||||
let deleteCallbackTests = null;
|
let deleteCallbackTests = null;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value, index) {
|
||||||
@@ -384,10 +384,10 @@ add_task(function testObservableArrayExoticObjects_deleteProperty_callback_throw
|
|||||||
let deleteCallbackCount = 0;
|
let deleteCallbackCount = 0;
|
||||||
|
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback() {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
},
|
},
|
||||||
deleteBooleanCallback(value, index) {
|
deleteBooleanCallback(value) {
|
||||||
deleteCallbackCount++;
|
deleteCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("deleteBooleanCallback");
|
throw new Error("deleteBooleanCallback");
|
||||||
@@ -731,7 +731,7 @@ add_task(function testObservableArrayExoticObjects_set_callback_throw() {
|
|||||||
|
|
||||||
const minLen = 3;
|
const minLen = 3;
|
||||||
let m = new TestInterfaceObservableArray({
|
let m = new TestInterfaceObservableArray({
|
||||||
setBooleanCallback(value, index) {
|
setBooleanCallback(value) {
|
||||||
setCallbackCount++;
|
setCallbackCount++;
|
||||||
if (value) {
|
if (value) {
|
||||||
throw new Error("setBooleanCallback");
|
throw new Error("setBooleanCallback");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
|
|||||||
is(exn.stack, stack, "Should have the right stack in test " + testNumber);
|
is(exn.stack, stack, "Should have the right stack in test " + testNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensurePromiseFail(testNumber, value) {
|
function ensurePromiseFail(testNumber) {
|
||||||
ok(false, "Test " + testNumber + " should not have a fulfilled promise");
|
ok(false, "Test " + testNumber + " should not have a fulfilled promise");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function doTest() {
|
|||||||
|
|
||||||
win.Object.defineProperty(win.Array.prototype, "0",
|
win.Object.defineProperty(win.Array.prototype, "0",
|
||||||
{
|
{
|
||||||
set(val) {
|
set() {
|
||||||
setterCalled = true;
|
setterCalled = true;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ add_task(async function () {
|
|||||||
await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
|
await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
|
||||||
var browser2 = gBrowser.getBrowserForTab(tab2);
|
var browser2 = gBrowser.getBrowserForTab(tab2);
|
||||||
|
|
||||||
var p1 = SpecialPowers.spawn(browser1, [], function (opts) {
|
var p1 = SpecialPowers.spawn(browser1, [], function () {
|
||||||
return new content.window.Promise(resolve => {
|
return new content.window.Promise(resolve => {
|
||||||
content.window.bc = new content.window.BroadcastChannel("foobar");
|
content.window.bc = new content.window.BroadcastChannel("foobar");
|
||||||
content.window.bc.onmessage = function (e) {
|
content.window.bc.onmessage = function (e) {
|
||||||
@@ -46,7 +46,7 @@ add_task(async function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var p2 = SpecialPowers.spawn(browser2, [], function (opts) {
|
var p2 = SpecialPowers.spawn(browser2, [], function () {
|
||||||
return new content.window.Promise(resolve => {
|
return new content.window.Promise(resolve => {
|
||||||
content.window.bc = new content.window.BroadcastChannel("foobar");
|
content.window.bc = new content.window.BroadcastChannel("foobar");
|
||||||
content.window.bc.onmessage = function (e) {
|
content.window.bc.onmessage = function (e) {
|
||||||
@@ -55,7 +55,7 @@ add_task(async function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await SpecialPowers.spawn(browser1, [], function (opts) {
|
await SpecialPowers.spawn(browser1, [], function () {
|
||||||
return new content.window.Promise(resolve => {
|
return new content.window.Promise(resolve => {
|
||||||
var bc = new content.window.BroadcastChannel("foobar");
|
var bc = new content.window.BroadcastChannel("foobar");
|
||||||
bc.postMessage("hello world from private browsing");
|
bc.postMessage("hello world from private browsing");
|
||||||
@@ -63,7 +63,7 @@ add_task(async function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await SpecialPowers.spawn(browser2, [], function (opts) {
|
await SpecialPowers.spawn(browser2, [], function () {
|
||||||
return new content.window.Promise(resolve => {
|
return new content.window.Promise(resolve => {
|
||||||
var bc = new content.window.BroadcastChannel("foobar");
|
var bc = new content.window.BroadcastChannel("foobar");
|
||||||
bc.postMessage("hello world from non private browsing");
|
bc.postMessage("hello world from non private browsing");
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
function page2Shown(e) {
|
function page2Shown() {
|
||||||
if (!expectedPersisted) {
|
if (!expectedPersisted) {
|
||||||
SimpleTest.executeSoon(function() {
|
SimpleTest.executeSoon(function() {
|
||||||
info("Posting a message.");
|
info("Posting a message.");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ async function useBroadcastChannel(contentWindow) {
|
|||||||
outer.postMessage("foo");
|
outer.postMessage("foo");
|
||||||
|
|
||||||
await new Promise(resolve => {
|
await new Promise(resolve => {
|
||||||
bc.onmessage = e => {
|
bc.onmessage = () => {
|
||||||
contentWindow.messageCount += 1;
|
contentWindow.messageCount += 1;
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ let a = new BroadcastChannel('a');
|
|||||||
let b = new BroadcastChannel('a');
|
let b = new BroadcastChannel('a');
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
a.onmessage = function(e) {
|
a.onmessage = function() {
|
||||||
++count;
|
++count;
|
||||||
a.close();
|
a.close();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function debug(msg) {
|
function debug(_msg) {
|
||||||
// dump("BrowserElementChild - " + msg + "\n");
|
// dump("BrowserElementChild - " + _msg + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
var BrowserElementIsReady;
|
var BrowserElementIsReady;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
/* eslint-env mozilla/frame-script */
|
/* eslint-env mozilla/frame-script */
|
||||||
|
|
||||||
function debug(msg) {
|
function debug() {
|
||||||
// dump("BrowserElementChildPreload - " + msg + "\n");
|
// dump("BrowserElementChildPreload - " + msg + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const { BrowserElementPromptService } = ChromeUtils.import(
|
|||||||
"resource://gre/modules/BrowserElementPromptService.jsm"
|
"resource://gre/modules/BrowserElementPromptService.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
function debug(msg) {
|
function debug() {
|
||||||
// dump("BrowserElementParent - " + msg + "\n");
|
// dump("BrowserElementParent - " + msg + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ var Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
|||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["BrowserElementPromptService"];
|
var EXPORTED_SYMBOLS = ["BrowserElementPromptService"];
|
||||||
|
|
||||||
function debug(msg) {
|
function debug() {
|
||||||
// dump("BrowserElementPromptService - " + msg + "\n");
|
// dump("BrowserElementPromptService - " + msg + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ BrowserElementPrompt.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
alertCheck(title, text, checkMsg, checkState) {
|
alertCheck(title, text) {
|
||||||
// Treat this like a normal alert() call, ignoring the checkState. The
|
// Treat this like a normal alert() call, ignoring the checkState. The
|
||||||
// front-end can do its own suppression of the alert() if it wants.
|
// front-end can do its own suppression of the alert() if it wants.
|
||||||
this.alert(title, text);
|
this.alert(title, text);
|
||||||
@@ -45,7 +45,7 @@ BrowserElementPrompt.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmCheck(title, text, checkMsg, checkState) {
|
confirmCheck(title, text) {
|
||||||
return this.confirm(title, text);
|
return this.confirm(title, text);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ BrowserElementPrompt.prototype = {
|
|||||||
return buttonProperties.indexToButtonNumberMap[ret.selectedButton];
|
return buttonProperties.indexToButtonNumberMap[ret.selectedButton];
|
||||||
},
|
},
|
||||||
|
|
||||||
prompt(title, text, value, checkMsg, checkState) {
|
prompt(title, text, value) {
|
||||||
let rv = this._browserElementChild.showModalPrompt(this._win, {
|
let rv = this._browserElementChild.showModalPrompt(this._win, {
|
||||||
promptType: "prompt",
|
promptType: "prompt",
|
||||||
title,
|
title,
|
||||||
@@ -117,15 +117,15 @@ BrowserElementPrompt.prototype = {
|
|||||||
return rv !== null;
|
return rv !== null;
|
||||||
},
|
},
|
||||||
|
|
||||||
promptUsernameAndPassword(title, text, username, password) {
|
promptUsernameAndPassword() {
|
||||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||||
},
|
},
|
||||||
|
|
||||||
promptPassword(title, text, password) {
|
promptPassword() {
|
||||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||||
},
|
},
|
||||||
|
|
||||||
select(title, text, aSelectList, aOutSelection) {
|
select() {
|
||||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ function BrowserElementAuthPrompt() {}
|
|||||||
BrowserElementAuthPrompt.prototype = {
|
BrowserElementAuthPrompt.prototype = {
|
||||||
QueryInterface: ChromeUtils.generateQI(["nsIAuthPrompt2"]),
|
QueryInterface: ChromeUtils.generateQI(["nsIAuthPrompt2"]),
|
||||||
|
|
||||||
promptAuth: function promptAuth(channel, level, authInfo) {
|
promptAuth: function promptAuth() {
|
||||||
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -706,7 +706,7 @@ var BrowserElementPromptService = {
|
|||||||
delete this._browserElementChildMap[outerWindowID.data];
|
delete this._browserElementChildMap[outerWindowID.data];
|
||||||
},
|
},
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject, topic) {
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case "outer-window-destroyed":
|
case "outer-window-destroyed":
|
||||||
this._observeOuterWindowDestroyed(subject);
|
this._observeOuterWindowDestroyed(subject);
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
var name = "pb-window-cache";
|
var name = "pb-window-cache";
|
||||||
|
|
||||||
function testMatch(browser) {
|
function testMatch(browser) {
|
||||||
return SpecialPowers.spawn(browser, [name], function (name) {
|
return SpecialPowers.spawn(browser, [name], function () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
content.caches
|
content.caches
|
||||||
.match("http://foo.com")
|
.match("http://foo.com")
|
||||||
.then(function (response) {
|
.then(function () {
|
||||||
ok(true, "caches.match() should be successful");
|
ok(true, "caches.match() should be successful");
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function () {
|
||||||
ok(false, "caches.match() should not throw error");
|
ok(false, "caches.match() should not throw error");
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
@@ -23,11 +23,11 @@ function testHas(browser) {
|
|||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
content.caches
|
content.caches
|
||||||
.has(name)
|
.has(name)
|
||||||
.then(function (result) {
|
.then(function () {
|
||||||
ok(true, "caches.has() should be successful");
|
ok(true, "caches.has() should be successful");
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function () {
|
||||||
ok(false, "caches.has() should not throw error");
|
ok(false, "caches.has() should not throw error");
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
@@ -40,11 +40,11 @@ function testOpen(browser) {
|
|||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
content.caches
|
content.caches
|
||||||
.open(name)
|
.open(name)
|
||||||
.then(function (c) {
|
.then(function () {
|
||||||
ok(true, "caches.open() should be successful");
|
ok(true, "caches.open() should be successful");
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function () {
|
||||||
ok(false, "caches.open() should not throw error");
|
ok(false, "caches.open() should not throw error");
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
@@ -57,11 +57,11 @@ function testDelete(browser) {
|
|||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
content.caches
|
content.caches
|
||||||
.delete(name)
|
.delete(name)
|
||||||
.then(function (result) {
|
.then(function () {
|
||||||
ok(true, "caches.delete() should be successful");
|
ok(true, "caches.delete() should be successful");
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function () {
|
||||||
ok(false, "caches.delete should not throw error");
|
ok(false, "caches.delete should not throw error");
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
@@ -70,15 +70,15 @@ function testDelete(browser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testKeys(browser) {
|
function testKeys(browser) {
|
||||||
return SpecialPowers.spawn(browser, [name], function (name) {
|
return SpecialPowers.spawn(browser, [name], function () {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
content.caches
|
content.caches
|
||||||
.keys()
|
.keys()
|
||||||
.then(function (names) {
|
.then(function () {
|
||||||
ok(true, "caches.keys() should be successful");
|
ok(true, "caches.keys() should be successful");
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
.catch(function (err) {
|
.catch(function () {
|
||||||
ok(false, "caches.keys should not throw error");
|
ok(false, "caches.keys should not throw error");
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
@@ -129,7 +129,7 @@ function test() {
|
|||||||
privateTab = BrowserTestUtils.addTab(pw.gBrowser, "http://example.com/");
|
privateTab = BrowserTestUtils.addTab(pw.gBrowser, "http://example.com/");
|
||||||
return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser);
|
return BrowserTestUtils.browserLoaded(privateTab.linkedBrowser);
|
||||||
})
|
})
|
||||||
.then(tab => {
|
.then(() => {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
testMatch(privateTab.linkedBrowser),
|
testMatch(privateTab.linkedBrowser),
|
||||||
testHas(privateTab.linkedBrowser),
|
testHas(privateTab.linkedBrowser),
|
||||||
|
|||||||
8
dom/cache/test/mochitest/driver.js
vendored
8
dom/cache/test/mochitest/driver.js
vendored
@@ -32,14 +32,14 @@ function runTests(testFile, order) {
|
|||||||
|
|
||||||
// adapted from dom/indexedDB/test/helpers.js
|
// adapted from dom/indexedDB/test/helpers.js
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
var clearUnpartitionedStorage = new Promise(function (resolve, reject) {
|
var clearUnpartitionedStorage = new Promise(function (resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
var cb = SpecialPowers.wrapCallback(resolve);
|
var cb = SpecialPowers.wrapCallback(resolve);
|
||||||
request.callback = cb;
|
request.callback = cb;
|
||||||
});
|
});
|
||||||
var clearPartitionedStorage = new Promise(function (resolve, reject) {
|
var clearPartitionedStorage = new Promise(function (resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).partitionedPrincipal;
|
var principal = SpecialPowers.wrap(document).partitionedPrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -77,7 +77,7 @@ function runTests(testFile, order) {
|
|||||||
navigator.serviceWorker == null &&
|
navigator.serviceWorker == null &&
|
||||||
SpecialPowers.getBoolPref("dom.cache.privateBrowsing.enabled")
|
SpecialPowers.getBoolPref("dom.cache.privateBrowsing.enabled")
|
||||||
) {
|
) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve) {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ function runTests(testFile, order) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function runFrameTest() {
|
function runFrameTest() {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve) {
|
||||||
var iframe = document.createElement("iframe");
|
var iframe = document.createElement("iframe");
|
||||||
iframe.src = "frame.html";
|
iframe.src = "frame.html";
|
||||||
iframe.onload = function () {
|
iframe.onload = function () {
|
||||||
|
|||||||
2
dom/cache/test/mochitest/test_cache.js
vendored
2
dom/cache/test/mochitest/test_cache.js
vendored
@@ -67,7 +67,7 @@ caches
|
|||||||
);
|
);
|
||||||
return snafu.put(req, res);
|
return snafu.put(req, res);
|
||||||
})
|
})
|
||||||
.then(function (v) {
|
.then(function () {
|
||||||
return snafu;
|
return snafu;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function testRequest(
|
|||||||
.then(function () {
|
.then(function () {
|
||||||
return caches
|
return caches
|
||||||
.match(request, { cacheName: name + "mambojambo" })
|
.match(request, { cacheName: name + "mambojambo" })
|
||||||
.then(function (result) {
|
.then(function () {
|
||||||
is(
|
is(
|
||||||
typeof r,
|
typeof r,
|
||||||
"undefined",
|
"undefined",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -33,7 +33,7 @@ function clearStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function storageUsage() {
|
function storageUsage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var cb = SpecialPowers.wrapCallback(function(request) {
|
var cb = SpecialPowers.wrapCallback(function(request) {
|
||||||
@@ -45,7 +45,7 @@ function storageUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function groupUsage() {
|
function groupUsage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
navigator.storage.estimate().then(storageEstimation => {
|
navigator.storage.estimate().then(storageEstimation => {
|
||||||
resolve(storageEstimation.usage, 0);
|
resolve(storageEstimation.usage, 0);
|
||||||
});
|
});
|
||||||
@@ -53,7 +53,7 @@ function groupUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function workerGroupUsage() {
|
function workerGroupUsage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
function workerScript() {
|
function workerScript() {
|
||||||
navigator.storage.estimate().then(storageEstimation => {
|
navigator.storage.estimate().then(storageEstimation => {
|
||||||
postMessage(storageEstimation.usage);
|
postMessage(storageEstimation.usage);
|
||||||
@@ -71,7 +71,7 @@ function workerGroupUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -81,7 +81,7 @@ function resetStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gc() {
|
function gc() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
SpecialPowers.exactGC(resolve);
|
SpecialPowers.exactGC(resolve);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -33,7 +33,7 @@ function clearStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function storageUsage() {
|
function storageUsage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var cb = SpecialPowers.wrapCallback(function(request) {
|
var cb = SpecialPowers.wrapCallback(function(request) {
|
||||||
@@ -45,7 +45,7 @@ function storageUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -55,7 +55,7 @@ function resetStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gc() {
|
function gc() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
SpecialPowers.exactGC(resolve);
|
SpecialPowers.exactGC(resolve);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -33,7 +33,7 @@ function clearStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -43,7 +43,7 @@ function resetStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getStorageUsage(fromMemory) {
|
function getStorageUsage(fromMemory) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var cb = SpecialPowers.wrapCallback(function(request) {
|
var cb = SpecialPowers.wrapCallback(function(request) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -47,9 +47,9 @@ SpecialPowers.pushPrefEnv({
|
|||||||
}).then(function() {
|
}).then(function() {
|
||||||
return resetStorage();
|
return resetStorage();
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
return cache.match(url).then(function(resp) {
|
return cache.match(url).then(function() {
|
||||||
ok(false, "old cache reference should not work after reset");
|
ok(false, "old cache reference should not work after reset");
|
||||||
}).catch(function(err) {
|
}).catch(function() {
|
||||||
ok(true, "old cache reference should not work after reset");
|
ok(true, "old cache reference should not work after reset");
|
||||||
});
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -33,7 +33,7 @@ function clearStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function storageUsage() {
|
function storageUsage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var cb = SpecialPowers.wrapCallback(function(request) {
|
var cb = SpecialPowers.wrapCallback(function(request) {
|
||||||
@@ -45,7 +45,7 @@ function storageUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -55,7 +55,7 @@ function resetStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function gc() {
|
function gc() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
SpecialPowers.exactGC(resolve);
|
SpecialPowers.exactGC(resolve);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function setupTestIframe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearStorage() {
|
function clearStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.clearStoragesForPrincipal(principal);
|
var request = qms.clearStoragesForPrincipal(principal);
|
||||||
@@ -33,7 +33,7 @@ function clearStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var request = qms.resetStoragesForPrincipal(principal);
|
var request = qms.resetStoragesForPrincipal(principal);
|
||||||
@@ -43,7 +43,7 @@ function resetStorage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getStorageUsage(fromMemory) {
|
function getStorageUsage(fromMemory) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve) {
|
||||||
var qms = SpecialPowers.Services.qms;
|
var qms = SpecialPowers.Services.qms;
|
||||||
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
var principal = SpecialPowers.wrap(document).nodePrincipal;
|
||||||
var cb = SpecialPowers.wrapCallback(function(request) {
|
var cb = SpecialPowers.wrapCallback(function(request) {
|
||||||
|
|||||||
2
dom/cache/test/mochitest/test_caches.js
vendored
2
dom/cache/test/mochitest/test_caches.js
vendored
@@ -17,7 +17,7 @@ function testHas() {
|
|||||||
ok(!has, name + " should not exist yet");
|
ok(!has, name + " should not exist yet");
|
||||||
return caches.open(name);
|
return caches.open(name);
|
||||||
})
|
})
|
||||||
.then(function (c) {
|
.then(function () {
|
||||||
return caches.has(name);
|
return caches.has(name);
|
||||||
})
|
})
|
||||||
.then(function (has) {
|
.then(function (has) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function resetStorage() {
|
function resetStorage() {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve) {
|
||||||
var qms = Services.qms;
|
var qms = Services.qms;
|
||||||
var request = qms.reset();
|
var request = qms.reset();
|
||||||
request.callback = resolve;
|
request.callback = resolve;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ ConsoleAPIStorageService.prototype = {
|
|||||||
"nsIObserver",
|
"nsIObserver",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
observe: function CS_observe(aSubject, aTopic, aData) {
|
observe: function CS_observe(aSubject, aTopic) {
|
||||||
if (aTopic == "xpcom-shutdown") {
|
if (aTopic == "xpcom-shutdown") {
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
Services.obs.removeObserver(this, "inner-window-destroyed");
|
Services.obs.removeObserver(this, "inner-window-destroyed");
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
is(cred.type,
|
is(cred.type,
|
||||||
"identity",
|
"identity",
|
||||||
"Correct type on the credential");
|
"Correct type on the credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(false, "must not have an error");
|
ok(false, "must not have an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
is(cred.type,
|
is(cred.type,
|
||||||
"identity",
|
"identity",
|
||||||
"Correct type on the credential");
|
"Correct type on the credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(false, "must not have an error");
|
ok(false, "must not have an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
is(cred.type,
|
is(cred.type,
|
||||||
"identity",
|
"identity",
|
||||||
"Correct type on the credential");
|
"Correct type on the credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(false, "must not have an error");
|
ok(false, "must not have an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
).then((cred) => {
|
).then(() => {
|
||||||
ok(false, "incorrectly got a credential");
|
ok(false, "incorrectly got a credential");
|
||||||
}).catch((err) => {
|
}).catch(() => {
|
||||||
ok(true, "correctly got an error");
|
ok(true, "correctly got an error");
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ function WorkerTest(worker, name, test) {
|
|||||||
|
|
||||||
// We expect only boolean responses from the worker script.
|
// We expect only boolean responses from the worker script.
|
||||||
worker.onmessage = e => this.complete(e.data);
|
worker.onmessage = e => this.complete(e.data);
|
||||||
worker.onerror = e => this.complete(false);
|
worker.onerror = () => this.complete(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
var base = new Test(name, test);
|
var base = new Test(name, test);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function memcmp_complete(test, value) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function error(test) {
|
function error() {
|
||||||
return function (x) {
|
return function (x) {
|
||||||
throw x;
|
throw x;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ TestArray.addTest(
|
|||||||
crypto.subtle.importKey("raw", tv.raw, alg, true, ["encrypt"])
|
crypto.subtle.importKey("raw", tv.raw, alg, true, ["encrypt"])
|
||||||
.then(
|
.then(
|
||||||
error(that),
|
error(that),
|
||||||
complete(that, function(x) { return true; })
|
complete(that, function() { return true; })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -982,7 +982,7 @@ TestArray.addTest(
|
|||||||
.then(doVerify)
|
.then(doVerify)
|
||||||
.then(
|
.then(
|
||||||
error(that),
|
error(that),
|
||||||
complete(that, function(x) { return true; })
|
complete(that, function() { return true; })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ TestArray.addTest(
|
|||||||
function setKeyPair(x) { pair = x; }
|
function setKeyPair(x) { pair = x; }
|
||||||
|
|
||||||
function doDerive(n) {
|
function doDerive(n) {
|
||||||
return function(x) {
|
return function() {
|
||||||
return crypto.subtle.deriveBits({ name: "ECDH", public: pair.publicKey }, pair.privateKey, n * 8);
|
return crypto.subtle.deriveBits({ name: "ECDH", public: pair.publicKey }, pair.privateKey, n * 8);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ TestArray.addTest(
|
|||||||
function doVerify(x) {
|
function doVerify(x) {
|
||||||
return crypto.subtle.verify(alg.name, x, tv.rsassa.sig256, tv.rsassa.data);
|
return crypto.subtle.verify(alg.name, x, tv.rsassa.sig256, tv.rsassa.data);
|
||||||
}
|
}
|
||||||
function fail(x) { error(that); }
|
function fail() { error(that); }
|
||||||
|
|
||||||
crypto.subtle.importKey("jwk", tv.rsassa.jwk_pub, alg, false, ["verify"])
|
crypto.subtle.importKey("jwk", tv.rsassa.jwk_pub, alg, false, ["verify"])
|
||||||
.then( doVerify, fail )
|
.then( doVerify, fail )
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function runTextDecoderOptions() {
|
|||||||
* - This function is not testing the decode function.
|
* - This function is not testing the decode function.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function testConstructorFatalOption(data, expectedString) {
|
function testConstructorFatalOption() {
|
||||||
//invalid string to decode passed, fatal = false
|
//invalid string to decode passed, fatal = false
|
||||||
testCharset({
|
testCharset({
|
||||||
fatal: false,
|
fatal: false,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||||
Cu.importGlobalProperties(["File"]);
|
Cu.importGlobalProperties(["File"]);
|
||||||
|
|
||||||
addMessageListener("file.open", function (e) {
|
addMessageListener("file.open", function () {
|
||||||
var testFile = Services.dirsvc
|
var testFile = Services.dirsvc
|
||||||
.QueryInterface(Ci.nsIProperties)
|
.QueryInterface(Ci.nsIProperties)
|
||||||
.get("ProfD", Ci.nsIFile);
|
.get("ProfD", Ci.nsIFile);
|
||||||
@@ -29,7 +29,7 @@ addMessageListener("file.open", function (e) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
addMessageListener("emptyfile.open", function (e) {
|
addMessageListener("emptyfile.open", function () {
|
||||||
var testFile = Services.dirsvc
|
var testFile = Services.dirsvc
|
||||||
.QueryInterface(Ci.nsIProperties)
|
.QueryInterface(Ci.nsIProperties)
|
||||||
.get("ProfD", Ci.nsIFile);
|
.get("ProfD", Ci.nsIFile);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Cu.importGlobalProperties(["File", "Directory"]);
|
Cu.importGlobalProperties(["File", "Directory"]);
|
||||||
var tmpFile, tmpDir;
|
var tmpFile, tmpDir;
|
||||||
|
|
||||||
addMessageListener("entries.open", function (e) {
|
addMessageListener("entries.open", function () {
|
||||||
tmpFile = Services.dirsvc
|
tmpFile = Services.dirsvc
|
||||||
.QueryInterface(Ci.nsIProperties)
|
.QueryInterface(Ci.nsIProperties)
|
||||||
.get("TmpD", Ci.nsIFile);
|
.get("TmpD", Ci.nsIFile);
|
||||||
@@ -40,7 +40,7 @@ addMessageListener("entries.open", function (e) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
addMessageListener("entries.delete", function (e) {
|
addMessageListener("entries.delete", function () {
|
||||||
tmpFile.remove(true);
|
tmpFile.remove(true);
|
||||||
tmpDir.remove(true);
|
tmpDir.remove(true);
|
||||||
sendAsyncMessage("entries.deleted");
|
sendAsyncMessage("entries.deleted");
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ function test_directoryEntry_getFile_simple() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "foo.txt", "We have the right FileEntry.");
|
is(e.name, "foo.txt", "We have the right FileEntry.");
|
||||||
test_getParent(e, directoryEntry, /* nested */ false);
|
test_getParent(e, directoryEntry, /* nested */ false);
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ function test_directoryEntry_getFile_deep() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "bar..txt", "We have the right FileEntry.");
|
is(e.name, "bar..txt", "We have the right FileEntry.");
|
||||||
test_getParent(e, directoryEntry, /* nested */ true);
|
test_getParent(e, directoryEntry, /* nested */ true);
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ function test_directoryEntry_getDirectory_simple() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "subdir", "We have the right DirectoryEntry.");
|
is(e.name, "subdir", "We have the right DirectoryEntry.");
|
||||||
test_getParent(e, directoryEntry, /* nested */ false);
|
test_getParent(e, directoryEntry, /* nested */ false);
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ function test_directoryEntry_getDirectory_deep() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
|
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
|
||||||
test_getParent(e, directoryEntry, /* nested */ true);
|
test_getParent(e, directoryEntry, /* nested */ true);
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ function test_root_getFile_simple() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, fileEntry.name, "We have the right FileEntry.");
|
is(e.name, fileEntry.name, "We have the right FileEntry.");
|
||||||
next();
|
next();
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@ function test_root_getFile_deep() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "bar..txt", "We have the right FileEntry.");
|
is(e.name, "bar..txt", "We have the right FileEntry.");
|
||||||
next();
|
next();
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ function test_root_getDirectory_simple() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, directoryEntry.name, "We have the right DirectoryEntry.");
|
is(e.name, directoryEntry.name, "We have the right DirectoryEntry.");
|
||||||
next();
|
next();
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -378,7 +378,7 @@ function test_root_getDirectory_deep() {
|
|||||||
function(e) {
|
function(e) {
|
||||||
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
|
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
|
||||||
next();
|
next();
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ function test_getParent(entry, parentEntry, nested) {
|
|||||||
} else {
|
} else {
|
||||||
test_getParent(e, parentEntry, false);
|
test_getParent(e, parentEntry, false);
|
||||||
}
|
}
|
||||||
}, function(e) {
|
}, function() {
|
||||||
ok(false, "This should not happen.");
|
ok(false, "This should not happen.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ addMessageListener("dir.open", function (e) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
addMessageListener("file.open", function (e) {
|
addMessageListener("file.open", function () {
|
||||||
var testFile = Services.dirsvc
|
var testFile = Services.dirsvc
|
||||||
.QueryInterface(Ci.nsIProperties)
|
.QueryInterface(Ci.nsIProperties)
|
||||||
.get("ProfD", Ci.nsIFile);
|
.get("ProfD", Ci.nsIFile);
|
||||||
@@ -164,7 +164,7 @@ addMessageListener("file.open", function (e) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
addMessageListener("symlink.open", function (e) {
|
addMessageListener("symlink.open", function () {
|
||||||
let testDir = createTestFile();
|
let testDir = createTestFile();
|
||||||
let testFile = testDir.clone();
|
let testFile = testDir.clone();
|
||||||
testFile.append("subdir");
|
testFile.append("subdir");
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
let dialogObserverTopic = "common-dialog-loaded";
|
let dialogObserverTopic = "common-dialog-loaded";
|
||||||
|
|
||||||
function dialogObserver(subj, topic, data) {
|
function dialogObserver(subj) {
|
||||||
subj.document.querySelector("dialog").acceptDialog();
|
subj.document.querySelector("dialog").acceptDialog();
|
||||||
sendAsyncMessage("promptAccepted");
|
sendAsyncMessage("promptAccepted");
|
||||||
}
|
}
|
||||||
|
|
||||||
addMessageListener("init", message => {
|
addMessageListener("init", () => {
|
||||||
Services.obs.addObserver(dialogObserver, dialogObserverTopic);
|
Services.obs.addObserver(dialogObserver, dialogObserverTopic);
|
||||||
sendAsyncMessage("initDone");
|
sendAsyncMessage("initDone");
|
||||||
});
|
});
|
||||||
|
|
||||||
addMessageListener("cleanup", message => {
|
addMessageListener("cleanup", () => {
|
||||||
Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
|
Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
|
||||||
sendAsyncMessage("cleanupDone");
|
sendAsyncMessage("cleanupDone");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function create_fileList(aPath) {
|
|||||||
script.sendAsyncMessage("dir.open", { path: aPath });
|
script.sendAsyncMessage("dir.open", { path: aPath });
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_simpleFilePicker(aPath) {
|
function test_simpleFilePicker() {
|
||||||
var url = SimpleTest.getTestFileURL("script_fileList.js");
|
var url = SimpleTest.getTestFileURL("script_fileList.js");
|
||||||
var script = SpecialPowers.loadChromeScript(url);
|
var script = SpecialPowers.loadChromeScript(url);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
function createDb() {
|
function createDb() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
const openRequest = indexedDB.open("test-abort-on-reload", 1);
|
const openRequest = indexedDB.open("test-abort-on-reload", 1);
|
||||||
openRequest.onsuccess = () => {
|
openRequest.onsuccess = () => {
|
||||||
const db = openRequest.result;
|
const db = openRequest.result;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
};
|
};
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
openRequest.onupgradeneeded = (evt) => {
|
openRequest.onupgradeneeded = () => {
|
||||||
// Interrupt upgrade
|
// Interrupt upgrade
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
opener.info('reload requested\n');
|
opener.info('reload requested\n');
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
const request = indexedDB.deleteDatabase("test-abort-on-reload");
|
const request = indexedDB.deleteDatabase("test-abort-on-reload");
|
||||||
request.onsuccess = resolve;
|
request.onsuccess = resolve;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
request.onupgradeneeded = function(e) {
|
request.onupgradeneeded = function(e) {
|
||||||
var db = e.target.result;
|
var db = e.target.result;
|
||||||
// This should never be called
|
// This should never be called
|
||||||
db.onversionchange = function(e) {
|
db.onversionchange = function() {
|
||||||
db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
|
db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
|
||||||
};
|
};
|
||||||
var trans = e.target.transaction;
|
var trans = e.target.transaction;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ dump("EXCEPTION IN CREATION: " + e + "\n " + e.stack + "\n");
|
|||||||
objectStore.delete(42).onsuccess = closeDBTellOwningThread;
|
objectStore.delete(42).onsuccess = closeDBTellOwningThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeDBTellOwningThread(event) {
|
function closeDBTellOwningThread() {
|
||||||
// Now that worker has latched the blob, clean up the database.
|
// Now that worker has latched the blob, clean up the database.
|
||||||
db.close();
|
db.close();
|
||||||
db = null;
|
db = null;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ async function idbCheckFunc() {
|
|||||||
try {
|
try {
|
||||||
console.log("opening db");
|
console.log("opening db");
|
||||||
const req = factory.open("db", 1);
|
const req = factory.open("db", 1);
|
||||||
const result = await new Promise((resolve, reject) => {
|
const result = await new Promise(resolve => {
|
||||||
req.onerror = () => {
|
req.onerror = () => {
|
||||||
resolve("error");
|
resolve("error");
|
||||||
};
|
};
|
||||||
@@ -21,7 +21,7 @@ async function idbCheckFunc() {
|
|||||||
resolve("created");
|
resolve("created");
|
||||||
};
|
};
|
||||||
// ...so this will lose the race
|
// ...so this will lose the race
|
||||||
req.onsuccess = event => {
|
req.onsuccess = () => {
|
||||||
resolve("already-exists");
|
resolve("already-exists");
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const nsIQuotaManagerService = Ci.nsIQuotaManagerService;
|
|||||||
|
|
||||||
var gURI = Services.io.newURI("http://localhost");
|
var gURI = Services.io.newURI("http://localhost");
|
||||||
|
|
||||||
function onUsageCallback(request) {}
|
function onUsageCallback() {}
|
||||||
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
var quotaManagerService = Cc[
|
var quotaManagerService = Cc[
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
function unexpectedSuccessHandler(event) {
|
function unexpectedSuccessHandler() {
|
||||||
ok(false, "got success when it was not expected!");
|
ok(false, "got success when it was not expected!");
|
||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onerror = function(message, filename, lineno) {
|
window.onerror = function(message) {
|
||||||
is(message, "ConstraintError", "Expect a constraint error");
|
is(message, "ConstraintError", "Expect a constraint error");
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
request = objectStore.add({}, 1);
|
request = objectStore.add({}, 1);
|
||||||
request.onsuccess = unexpectedSuccessHandler;
|
request.onsuccess = unexpectedSuccessHandler;
|
||||||
request.onerror = function(event) {
|
request.onerror = function() {
|
||||||
// Don't do anything! ConstraintError is expected in window.onerror.
|
// Don't do anything! ConstraintError is expected in window.onerror.
|
||||||
};
|
};
|
||||||
event = yield undefined;
|
event = yield undefined;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
event = yield undefined;
|
event = yield undefined;
|
||||||
|
|
||||||
request = objectStore.add({}, 1);
|
request = objectStore.add({}, 1);
|
||||||
request.onsuccess = function(event) {
|
request.onsuccess = function() {
|
||||||
ok(false, "Did not expect second add to succeed.");
|
ok(false, "Did not expect second add to succeed.");
|
||||||
};
|
};
|
||||||
request.onerror = errorEventCounter;
|
request.onerror = errorEventCounter;
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
event = yield undefined;
|
event = yield undefined;
|
||||||
|
|
||||||
request = objectStore.add({}, 1);
|
request = objectStore.add({}, 1);
|
||||||
request.onsuccess = function(event) {
|
request.onsuccess = function() {
|
||||||
ok(false, "Did not expect second add to succeed.");
|
ok(false, "Did not expect second add to succeed.");
|
||||||
};
|
};
|
||||||
request.onerror = errorEventCounter;
|
request.onerror = errorEventCounter;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
function unexpectedSuccessHandler(event) {
|
function unexpectedSuccessHandler() {
|
||||||
ok(false, "got success when it was not expected!");
|
ok(false, "got success when it was not expected!");
|
||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
ok(db.objectStoreNames.contains("foo"), "Has correct objectStore");
|
ok(db.objectStoreNames.contains("foo"), "Has correct objectStore");
|
||||||
|
|
||||||
request = objectStore.add({}, 1);
|
request = objectStore.add({}, 1);
|
||||||
request.onsuccess = function(event) {
|
request.onsuccess = function() {
|
||||||
throw new Error("foo");
|
throw new Error("foo");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ function triggerSecondaryCommand(popup, win) {
|
|||||||
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {}, win);
|
EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {}, win);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dismissNotification(popup) {
|
function dismissNotification() {
|
||||||
info("dismissing notification");
|
info("dismissing notification");
|
||||||
executeSoon(function () {
|
executeSoon(function () {
|
||||||
EventUtils.synthesizeKey("KEY_Escape");
|
EventUtils.synthesizeKey("KEY_Escape");
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ function workerScript() {
|
|||||||
self.executeSoon = function (_fun_) {
|
self.executeSoon = function (_fun_) {
|
||||||
var channel = new MessageChannel();
|
var channel = new MessageChannel();
|
||||||
channel.port1.postMessage("");
|
channel.port1.postMessage("");
|
||||||
channel.port2.onmessage = function (event) {
|
channel.port2.onmessage = function () {
|
||||||
_fun_();
|
_fun_();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function madeMod() {
|
|||||||
parent.postMessage("didcommit", "*");
|
parent.postMessage("didcommit", "*");
|
||||||
};
|
};
|
||||||
|
|
||||||
store.put({ hello: "officer" }, 42).onsuccess = function(e) {
|
store.put({ hello: "officer" }, 42).onsuccess = function() {
|
||||||
// Make this transaction run until the end of time or until the page is
|
// Make this transaction run until the end of time or until the page is
|
||||||
// navigated away, whichever comes first.
|
// navigated away, whichever comes first.
|
||||||
function doGet() {
|
function doGet() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
openedWindow = window.open("abort_on_reload.html");
|
openedWindow = window.open("abort_on_reload.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
function messageListener(event) {
|
function messageListener() {
|
||||||
ok(true, "reload recorded");
|
ok(true, "reload recorded");
|
||||||
|
|
||||||
if (++reloads == 20) {
|
if (++reloads == 20) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ async function useIDB(contentWindow) {
|
|||||||
store.get(0).onsuccess = spin;
|
store.get(0).onsuccess = spin;
|
||||||
}
|
}
|
||||||
|
|
||||||
store.put(0, "purgatory").onsuccess = e => {
|
store.put(0, "purgatory").onsuccess = () => {
|
||||||
contentWindow.putCount += 1;
|
contentWindow.putCount += 1;
|
||||||
spin();
|
spin();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
let iframe = document.getElementById("iframe1");
|
let iframe = document.getElementById("iframe1");
|
||||||
iframe.src = evt.data.iframeUrl;
|
iframe.src = evt.data.iframeUrl;
|
||||||
|
|
||||||
iframe.addEventListener("load", e => {
|
iframe.addEventListener("load", () => {
|
||||||
iframe.contentWindow.postMessage(JSON.stringify(evt.data), "*");
|
iframe.contentWindow.postMessage(JSON.stringify(evt.data), "*");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function* testSteps() {
|
|||||||
let db = request.result;
|
let db = request.result;
|
||||||
is(db.version, 1, "Got version 1");
|
is(db.version, 1, "Got version 1");
|
||||||
|
|
||||||
db.onversionchange = function (event) {
|
db.onversionchange = function () {
|
||||||
info("Closing database " + thisIndex);
|
info("Closing database " + thisIndex);
|
||||||
db.close();
|
db.close();
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ function* testSteps() {
|
|||||||
request.onerror = errorHandler;
|
request.onerror = errorHandler;
|
||||||
request.onsuccess = grabEventAndContinueHandler;
|
request.onsuccess = grabEventAndContinueHandler;
|
||||||
|
|
||||||
request.onblocked = function (event) {
|
request.onblocked = function () {
|
||||||
ok(false, "Should not receive a blocked event");
|
ok(false, "Should not receive a blocked event");
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ function* testSteps() {
|
|||||||
let db = request.result;
|
let db = request.result;
|
||||||
is(db.version, 1, "Got version 1");
|
is(db.version, 1, "Got version 1");
|
||||||
|
|
||||||
db.onversionchange = function (event) {
|
db.onversionchange = function () {
|
||||||
if (thisIndex == databaseCount - 1) {
|
if (thisIndex == databaseCount - 1) {
|
||||||
info("Closing all databases with version 1");
|
info("Closing all databases with version 1");
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ function* testSteps() {
|
|||||||
request.onerror = errorHandler;
|
request.onerror = errorHandler;
|
||||||
request.onsuccess = grabEventAndContinueHandler;
|
request.onsuccess = grabEventAndContinueHandler;
|
||||||
|
|
||||||
request.onblocked = function (event) {
|
request.onblocked = function () {
|
||||||
ok(false, "Should not receive a blocked event");
|
ok(false, "Should not receive a blocked event");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ function* testSteps() {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
};
|
};
|
||||||
|
|
||||||
trans.oncomplete = function (event) {
|
trans.oncomplete = function () {
|
||||||
i++;
|
i++;
|
||||||
j++;
|
j++;
|
||||||
testGenerator.next(true);
|
testGenerator.next(true);
|
||||||
};
|
};
|
||||||
trans.onabort = function (event) {
|
trans.onabort = function () {
|
||||||
is(trans.error.name, "QuotaExceededError", "Reached quota limit");
|
is(trans.error.name, "QuotaExceededError", "Reached quota limit");
|
||||||
testGenerator.next(false);
|
testGenerator.next(false);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ function* testSteps() {
|
|||||||
|
|
||||||
request = db.transaction("foo").objectStore("foo").openCursor();
|
request = db.transaction("foo").objectStore("foo").openCursor();
|
||||||
request.onerror = errorHandler;
|
request.onerror = errorHandler;
|
||||||
request.onsuccess = function (event) {
|
request.onsuccess = function () {
|
||||||
let cursor = request.result;
|
let cursor = request.result;
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
ok(false, "Shouldn't have any entries");
|
ok(false, "Shouldn't have any entries");
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user