Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato

This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kris Maglione 2019-12-07 19:11:58 +00:00
Родитель 64dd29e2b8
Коммит 910eab35d2
985 изменённых файлов: 2916 добавлений и 3885 удалений

Просмотреть файл

@ -28,7 +28,7 @@ add_task(async function checkWrongSystemTimeWarning() {
info("Loading and waiting for the cert error");
await certErrorLoaded;
return ContentTask.spawn(browser, null, async function() {
return SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
let div = doc.getElementById("errorShortDescText");
let systemDateDiv = doc.getElementById("wrongSystemTime_systemDate1");

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function checkExceptionDialogButton() {
let browser = tab.linkedBrowser;
let loaded = BrowserTestUtils.browserLoaded(browser, false, BAD_CERT);
info("Clicking the exceptionDialogButton in advanced panel");
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
let exceptionButton = doc.getElementById("exceptionDialogButton");
exceptionButton.click();
@ -25,7 +25,7 @@ add_task(async function checkExceptionDialogButton() {
info("Loading the url after adding exception");
await loaded;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
ok(
!doc.documentURI.startsWith("about:certerror"),
@ -52,10 +52,8 @@ add_task(async function checkPermanentExceptionPref() {
let browser = tab.linkedBrowser;
let loaded = BrowserTestUtils.browserLoaded(browser, false, BAD_CERT);
info("Clicking the exceptionDialogButton in advanced panel");
let securityInfoAsString = await ContentTask.spawn(
browser,
null,
async function() {
let securityInfoAsString = await SpecialPowers.spawn(
browser, [], async function() {
let doc = content.document;
let exceptionButton = doc.getElementById("exceptionDialogButton");
exceptionButton.click();
@ -72,7 +70,7 @@ add_task(async function checkPermanentExceptionPref() {
info("Loading the url after adding exception");
await loaded;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
ok(
!doc.documentURI.startsWith("about:certerror"),
@ -116,7 +114,7 @@ add_task(async function checkBadStsCert() {
let tab = await openErrorPage(BAD_STS_CERT, useFrame);
let browser = tab.linkedBrowser;
await ContentTask.spawn(browser, { frame: useFrame }, async function({
await SpecialPowers.spawn(browser, [{ frame: useFrame }], async function({
frame,
}) {
let doc = frame
@ -129,10 +127,8 @@ add_task(async function checkBadStsCert() {
);
});
let message = await ContentTask.spawn(
browser,
{ frame: useFrame },
async function({ frame }) {
let message = await SpecialPowers.spawn(
browser, [{ frame: useFrame }], async function({ frame }) {
let doc = frame
? content.document.querySelector("iframe").contentDocument
: content.document;
@ -172,7 +168,7 @@ add_task(async function checkhideAddExceptionButtonViaPref() {
let tab = await openErrorPage(BAD_CERT, useFrame);
let browser = tab.linkedBrowser;
await ContentTask.spawn(browser, { frame: useFrame }, async function({
await SpecialPowers.spawn(browser, [{ frame: useFrame }], async function({
frame,
}) {
let doc = frame
@ -199,7 +195,7 @@ add_task(async function checkhideAddExceptionButtonInFrames() {
let tab = await openErrorPage(BAD_CERT, true);
let browser = tab.linkedBrowser;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document.querySelector("iframe").contentDocument;
let exceptionButton = doc.getElementById("exceptionDialogButton");
ok(

Просмотреть файл

@ -38,7 +38,7 @@ add_task(async function checkMitmPriming() {
// The page will reload after the initial canary request, so we'll just
// wait until we're seeing the dedicated MitM page.
await TestUtils.waitForCondition(function() {
return ContentTask.spawn(browser, {}, () => {
return SpecialPowers.spawn(browser, [], () => {
return (
content.document.body.getAttribute("code") ==
"MOZILLA_PKIX_ERROR_MITM_DETECTED"
@ -54,7 +54,7 @@ add_task(async function checkMitmPriming() {
"Stored the correct issuer"
);
await ContentTask.spawn(browser, {}, () => {
await SpecialPowers.spawn(browser, [], () => {
let mitmName1 = content.document.querySelector(
"#errorShortDescText .mitm-name"
);
@ -113,7 +113,7 @@ add_task(async function checkMitmAutoEnableEnterpriseRoots() {
// The page will reload after the initial canary request, so we'll just
// wait until we're seeing the dedicated MitM page.
await TestUtils.waitForCondition(function() {
return ContentTask.spawn(browser, {}, () => {
return SpecialPowers.spawn(browser, [], () => {
return (
content.document.body.getAttribute("code") ==
"MOZILLA_PKIX_ERROR_MITM_DETECTED"

Просмотреть файл

@ -57,10 +57,8 @@ add_task(async function checkUntrustedCertError() {
let tab = await openErrorPage(UNKNOWN_ISSUER);
let browser = tab.linkedBrowser;
info("Clicking the exceptionDialogButton in advanced panel");
let badCertTechnicalInfoText = await ContentTask.spawn(
browser,
null,
checkAdvancedAndGetTechnicalInfoText
let badCertTechnicalInfoText = await SpecialPowers.spawn(
browser, [], checkAdvancedAndGetTechnicalInfoText
);
checkCorrectMessages(badCertTechnicalInfoText, browser);
BrowserTestUtils.removeTab(gBrowser.selectedTab);

Просмотреть файл

@ -41,7 +41,7 @@ add_task(async function() {
Services.search.setDefault(engine),
]);
let promise = BrowserTestUtils.browserLoaded(browser);
await ContentTask.spawn(browser, { needle }, async function(args) {
await SpecialPowers.spawn(browser, [{ needle }], async function(args) {
let doc = content.document;
let el = doc.querySelector(["#searchText", "#newtab-search-text"]);
el.value = args.needle;
@ -51,7 +51,7 @@ add_task(async function() {
await promise;
// When the search results load, check them for correctness.
await ContentTask.spawn(browser, { needle }, async function(args) {
await SpecialPowers.spawn(browser, [{ needle }], async function(args) {
let loadedText = content.document.body.textContent;
ok(loadedText, "search page loaded");
is(

Просмотреть файл

@ -36,7 +36,7 @@ add_task(async function() {
);
});
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
// Start composition and type "x"
let input = content.document.querySelector([
"#searchText",
@ -46,7 +46,7 @@ add_task(async function() {
});
info("Setting up the mutation observer before synthesizing composition");
let mutationPromise = ContentTask.spawn(browser, null, async function() {
let mutationPromise = SpecialPowers.spawn(browser, [], async function() {
let searchController = content.wrappedJSObject.gContentSearchController;
// Wait for the search suggestions to become visible.

Просмотреть файл

@ -19,7 +19,7 @@ add_task(async function() {
Services.search.setDefault(engine),
]);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
// Type an X in the search input.
let input = content.document.querySelector([
"#searchText",
@ -30,7 +30,7 @@ add_task(async function() {
await BrowserTestUtils.synthesizeKey("x", {}, browser);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
// Wait for the search suggestions to become visible.
let table = content.document.getElementById("searchSuggestionTable");
let input = content.document.querySelector([
@ -57,7 +57,7 @@ add_task(async function() {
await BrowserTestUtils.synthesizeKey("a", { accelKey: true }, browser);
await BrowserTestUtils.synthesizeKey("VK_DELETE", {}, browser);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let table = content.document.getElementById("searchSuggestionTable");
await ContentTaskUtils.waitForCondition(
() => table.hidden,

Просмотреть файл

@ -24,10 +24,8 @@ add_task(async function() {
Services.search.setDefault(engine),
]);
await ContentTask.spawn(
browser,
{ expectedName: engine.name },
async function(args) {
await SpecialPowers.spawn(
browser, [{ expectedName: engine.name }], async function(args) {
let engineName =
content.wrappedJSObject.gContentSearchController.defaultEngine.name;
is(
@ -65,7 +63,7 @@ add_task(async function() {
);
// Perform a search to increase the SEARCH_COUNT histogram.
await ContentTask.spawn(browser, { searchStr }, async function(args) {
await SpecialPowers.spawn(browser, [{ searchStr }], async function(args) {
let doc = content.document;
info("Perform a search.");
let el = doc.querySelector(["#searchText", "#newtab-search-text"]);

Просмотреть файл

@ -70,7 +70,7 @@ add_task(async function resetToDefaultConfig() {
TLS12_PAGE
);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
const doc = content.document;
ok(
doc.documentURI.startsWith("about:neterror"),
@ -124,7 +124,7 @@ add_task(async function checkLearnMoreLink() {
const baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
await ContentTask.spawn(browser, baseURL, function(_baseURL) {
await SpecialPowers.spawn(browser, [baseURL], function(_baseURL) {
const doc = content.document;
ok(
doc.documentURI.startsWith("about:neterror"),
@ -176,7 +176,7 @@ add_task(async function checkEnable10() {
TLS10_PAGE
);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
const doc = content.document;
ok(
doc.documentURI.startsWith("about:neterror"),
@ -227,7 +227,7 @@ add_task(async function dontOffer10WhenAlreadyEnabled() {
info("Loading and waiting for the net error");
await pageLoaded;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
const doc = content.document;
ok(
doc.documentURI.startsWith("about:neterror"),

Просмотреть файл

@ -7,10 +7,8 @@ add_task(async function() {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:support" },
async function(browser) {
let keyLocationServiceGoogleStatus = await ContentTask.spawn(
browser,
null,
async function() {
let keyLocationServiceGoogleStatus = await SpecialPowers.spawn(
browser, [], async function() {
let textBox = content.document.getElementById(
"key-location-service-google-box"
);
@ -26,10 +24,8 @@ add_task(async function() {
"Google location service API key status shown"
);
let keySafebrowsingGoogleStatus = await ContentTask.spawn(
browser,
null,
async function() {
let keySafebrowsingGoogleStatus = await SpecialPowers.spawn(
browser, [], async function() {
let textBox = content.document.getElementById(
"key-safebrowsing-google-box"
);
@ -45,10 +41,8 @@ add_task(async function() {
"Google Safebrowsing API key status shown"
);
let keyMozillaStatus = await ContentTask.spawn(
browser,
null,
async function() {
let keyMozillaStatus = await SpecialPowers.spawn(
browser, [], async function() {
let textBox = content.document.getElementById("key-mozilla-box");
await ContentTaskUtils.waitForCondition(
() => content.document.l10n.getAttributes(textBox).id,

Просмотреть файл

@ -34,7 +34,7 @@ add_task(async function checkSwitchPageToOnlineMode() {
);
// Click on the 'Try again' button.
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
ok(
content.document.documentURI.startsWith("about:neterror?e=netOffline"),
"Should be showing error page"

Просмотреть файл

@ -7,7 +7,7 @@ add_task(async function test() {
await BrowserTestUtils.withNewTab({ gBrowser, url: URL }, async function(
browser
) {
let context = await ContentTask.spawn(browser, null, function() {
let context = await SpecialPowers.spawn(browser, [], function() {
let iframe = content.document.querySelector("iframe");
iframe.src = "https://expired.example.com/";
return BrowsingContext.getFromWindow(iframe.contentWindow);

Просмотреть файл

@ -161,7 +161,7 @@ function promiseTabLoadEvent(tab, url) {
* Wait for the search engine to change.
*/
function promiseContentSearchChange(browser, newEngineName) {
return ContentTask.spawn(browser, { newEngineName }, async function(args) {
return SpecialPowers.spawn(browser, [{ newEngineName }], async function(args) {
return new Promise(resolve => {
content.addEventListener("ContentSearchService", function listener(
aEvent

Просмотреть файл

@ -12,7 +12,7 @@ add_task(async function test_notificationReplace() {
url: notificationURL,
},
async function dummyTabTask(aBrowser) {
await ContentTask.spawn(aBrowser, {}, async function() {
await SpecialPowers.spawn(aBrowser, [], async function() {
let win = content.window.wrappedJSObject;
let notification = win.showNotification1();
let promiseCloseEvent = ContentTaskUtils.waitForEvent(

Просмотреть файл

@ -34,7 +34,7 @@ add_task(async function test_notificationPreventDefaultAndSwitchTabs() {
// First, show a notification that will be have the tab-switching prevented.
function promiseNotificationEvent(evt) {
return ContentTask.spawn(aBrowser, evt, async function(contentEvt) {
return SpecialPowers.spawn(aBrowser, [evt], async function(contentEvt) {
return new Promise(resolve => {
let contentNotification = content.wrappedJSObject._notification;
contentNotification.addEventListener(

Просмотреть файл

@ -33,7 +33,7 @@ function promiseWindowClosed(window) {
*/
function openNotification(aBrowser, fn, timeout) {
info(`openNotification: ${fn}`);
return ContentTask.spawn(aBrowser, [fn, timeout], async function([
return SpecialPowers.spawn(aBrowser, [[fn, timeout]], async function([
contentFn,
contentTimeout,
]) {
@ -60,7 +60,7 @@ function openNotification(aBrowser, fn, timeout) {
}
function closeNotification(aBrowser) {
return ContentTask.spawn(aBrowser, null, function() {
return SpecialPowers.spawn(aBrowser, [], function() {
content.wrappedJSObject._notification.close();
});
}

Просмотреть файл

@ -55,7 +55,7 @@ add_task(async function checkCaptivePortalCertErrorUI() {
CANONICAL_URL
);
await ContentTask.spawn(browser, null, () => {
await SpecialPowers.spawn(browser, [], () => {
let doc = content.document;
ok(
doc.body.classList.contains("captiveportal"),
@ -84,7 +84,7 @@ add_task(async function checkCaptivePortalCertErrorUI() {
// Passing an empty function to BrowserTestUtils.switchTab lets us wait for an arbitrary
// tab switch.
portalTabPromise = BrowserTestUtils.switchTab(gBrowser, () => {});
await ContentTask.spawn(browser, null, () => {
await SpecialPowers.spawn(browser, [], () => {
info("Clicking the Open Login Page button.");
content.document.getElementById("openPortalLoginPageButton").click();
});
@ -102,7 +102,7 @@ add_task(async function checkCaptivePortalCertErrorUI() {
"Waiting for error tab to be reloaded after the captive portal was freed."
);
await errorTabReloaded;
await ContentTask.spawn(browser, null, () => {
await SpecialPowers.spawn(browser, [], () => {
let doc = content.document;
ok(
!doc.body.classList.contains("captiveportal"),

Просмотреть файл

@ -109,7 +109,7 @@ add_task(async function test_setup_html() {
await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let audioIframe = doc.querySelector("#test-audio-in-iframe");
// media documents always use a <video> tag.
@ -1128,7 +1128,7 @@ add_task(async function test_copylinkcommand() {
// The easiest way to check the clipboard is to paste the contents
// into a textbox.
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let input = doc.getElementById("test-input");
input.focus();
@ -1137,7 +1137,7 @@ add_task(async function test_copylinkcommand() {
document.commandDispatcher
.getControllerForCommand("cmd_paste")
.doCommand("cmd_paste");
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let input = doc.getElementById("test-input");
Assert.equal(
@ -1242,10 +1242,8 @@ add_task(async function test_pagemenu() {
)[0];
ok(item, "Got generated XUL menu item");
item.doCommand();
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let pagemenu = content.document.getElementById("test-pagemenu");
Assert.ok(
!pagemenu.hasAttribute("hopeless"),
@ -1313,10 +1311,8 @@ add_task(async function test_dom_full_screen() {
["full-screen-api.transition-duration.enter", "0 0"],
["full-screen-api.transition-duration.leave", "0 0"]
);
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let win = doc.defaultView;
let full_screen_element = doc.getElementById(
@ -1332,10 +1328,8 @@ add_task(async function test_dom_full_screen() {
);
},
async postCheckContextMenuFn() {
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let win = content.document.defaultView;
let awaitFullScreenChange = ContentTaskUtils.waitForEvent(
win,
@ -1470,10 +1464,8 @@ add_task(async function test_select_text_link() {
await selectText("#test-select-text-link");
},
async postCheckContextMenuFn() {
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let win = content.document.defaultView;
win.getSelection().removeAllRanges();
}
@ -1976,7 +1968,7 @@ add_task(async function test_cleanup_html() {
* the element that will be referenced.
*/
async function selectText(selector) {
await ContentTask.spawn(gBrowser.selectedBrowser, selector, async function(
await SpecialPowers.spawn(gBrowser.selectedBrowser, [selector], async function(
contentSelector
) {
info(`Selecting text of ${contentSelector}`);

Просмотреть файл

@ -87,10 +87,8 @@ add_task(async function test_text_input_spellcheck() {
// will think that the form inputs on the page are part of a login
// and will add fill-login context menu items.
async preCheckContextMenuFn() {
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let input = doc.getElementById("input_spellcheck_no_value");
input.setAttribute("spellcheck", "true");
@ -265,10 +263,8 @@ add_task(async function test_password_input() {
// will think that the form inputs on the page are part of a login
// and will add fill-login context menu items.
async preCheckContextMenuFn() {
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let input = doc.getElementById("input_password");
input.type = "password";
@ -277,10 +273,8 @@ add_task(async function test_password_input() {
);
},
async postCheckContextMenuFn() {
await ContentTask.spawn(
gBrowser.selectedBrowser,
null,
async function() {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let input = doc.getElementById("input_password");
input.type = "text";

Просмотреть файл

@ -31,7 +31,7 @@ function test_openUILink_checkPrincipal() {
"example.com loaded"
);
await ContentTask.spawn(tab.linkedBrowser, null, function() {
await SpecialPowers.spawn(tab.linkedBrowser, [], function() {
let channel = content.docShell.currentDocumentChannel;
const loadingPrincipal = channel.loadInfo.loadingPrincipal;

Просмотреть файл

@ -361,10 +361,8 @@ async function test_contextmenu(selector, menuItems, options = {}) {
}
if (!options.skipFocusChange) {
await ContentTask.spawn(
gBrowser.selectedBrowser,
[lastElementSelector, selector],
async function([contentLastElementSelector, contentSelector]) {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [[lastElementSelector, selector]], async function([contentLastElementSelector, contentSelector]) {
if (contentLastElementSelector) {
let contentLastElement = content.document.querySelector(
contentLastElementSelector
@ -386,7 +384,7 @@ async function test_contextmenu(selector, menuItems, options = {}) {
if (options.waitForSpellCheck) {
info("Waiting for spell check");
await ContentTask.spawn(gBrowser.selectedBrowser, selector, async function(
await SpecialPowers.spawn(gBrowser.selectedBrowser, [selector], async function(
contentSelector
) {
let { onSpellCheck } = ChromeUtils.import(

Просмотреть файл

@ -15,7 +15,7 @@ add_task(async function test() {
faviconPromise = waitForLinkAvailable(tabBrowser);
await ContentTask.spawn(tabBrowser, null, function() {
await SpecialPowers.spawn(tabBrowser, [], function() {
content.location.href += "#foo";
});

Просмотреть файл

@ -15,7 +15,7 @@ add_task(async function test() {
faviconPromise = waitForLinkAvailable(tabBrowser);
await ContentTask.spawn(tabBrowser, null, function() {
await SpecialPowers.spawn(tabBrowser, [], function() {
content.history.pushState("page2", "page2", "page2");
});

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function() {
haveChanged = waitForFavicon(extraTab.linkedBrowser, TEST_ROOT + "moz.png");
ContentTask.spawn(extraTab.linkedBrowser, null, function() {
SpecialPowers.spawn(extraTab.linkedBrowser, [], function() {
let ev = new content.CustomEvent("PleaseChangeFavicon", {});
content.dispatchEvent(ev);
});

Просмотреть файл

@ -96,10 +96,8 @@ add_task(async function() {
let iconPromise = waitForFaviconMessage(!testCase.richIcon, expectedIcon);
await ContentTask.spawn(
gBrowser.selectedBrowser,
[testCase.icons, ROOTURI + ICON],
([icons, defaultIcon]) => {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [[testCase.icons, ROOTURI + ICON]], ([icons, defaultIcon]) => {
let doc = content.document;
let head = doc.head;
@ -124,7 +122,7 @@ add_task(async function() {
ok(!testCase.pass, testCase.text);
}
await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
let links = content.document.querySelectorAll("link");
for (let link of links) {
link.remove();

Просмотреть файл

@ -13,7 +13,7 @@ add_task(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
let icon = await iconPromise;
await ContentTask.spawn(gBrowser.selectedBrowser, ROOT, root => {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [ROOT], root => {
let doc = content.document;
let head = doc.head;
let link = doc.createElement("link");

Просмотреть файл

@ -10,7 +10,7 @@ async function waitIcon(url) {
}
function createLinks(linkInfos) {
return ContentTask.spawn(gBrowser.selectedBrowser, linkInfos, links => {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [linkInfos], links => {
let doc = content.document;
let head = doc.head;
for (let l of links) {

Просмотреть файл

@ -83,7 +83,7 @@ add_task(async () => {
let label = tab.textLabel;
let bounds = label.getBoundingClientRect();
await ContentTask.spawn(browser, null, () => {
await SpecialPowers.spawn(browser, [], () => {
let link = content.document.createElement("link");
link.setAttribute("href", "file_favicon.png");
link.setAttribute("rel", "icon");

Просмотреть файл

@ -129,19 +129,19 @@ function openSelectPopup(
}
function getInputEvents() {
return ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
return content.wrappedJSObject.gInputEvents;
});
}
function getChangeEvents() {
return ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
return content.wrappedJSObject.gChangeEvents;
});
}
function getClickEvents() {
return ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
return content.wrappedJSObject.gClickEvents;
});
}
@ -210,7 +210,7 @@ async function doSelectTests(contentType, content) {
is(await getClickEvents(), 0, "Before closed - number of click events");
EventUtils.synthesizeKey("a", { accelKey: true });
await ContentTask.spawn(gBrowser.selectedBrowser, { isWindows }, function(
await SpecialPowers.spawn(gBrowser.selectedBrowser, [{ isWindows }], function(
args
) {
Assert.equal(
@ -354,7 +354,7 @@ add_task(async function() {
// First, try it when a different <select> element than the one that is open is removed
await openSelectPopup(selectPopup, "click", "#one");
await ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
content.document.body.removeChild(content.document.getElementById("two"));
});
@ -372,7 +372,7 @@ add_task(async function() {
selectPopup,
"popuphidden"
);
await ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
content.document.body.removeChild(content.document.getElementById("three"));
});
await popupHiddenPromise;
@ -444,7 +444,7 @@ add_task(async function() {
for (let stepIndex = 0; stepIndex < steps.length; stepIndex++) {
let step = steps[stepIndex];
await ContentTask.spawn(gBrowser.selectedBrowser, step, async function(
await SpecialPowers.spawn(gBrowser.selectedBrowser, [step], async function(
contentStep
) {
return new Promise(resolve => {
@ -550,10 +550,8 @@ add_task(async function test_event_order() {
mode == "enter" ? "#one" : "#two"
);
let eventsPromise = ContentTask.spawn(
browser,
[mode, expected],
async function([contentMode, contentExpected]) {
let eventsPromise = SpecialPowers.spawn(
browser, [[mode, expected]], async function([contentMode, contentExpected]) {
return new Promise(resolve => {
function onEvent(event) {
select.removeEventListener(event.type, onEvent);
@ -610,7 +608,7 @@ add_task(async function test_event_order() {
async function performLargePopupTests(win) {
let browser = win.gBrowser.selectedBrowser;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
let select = doc.getElementById("one");
for (var i = 0; i < 180; i++) {
@ -829,7 +827,7 @@ async function performLargePopupTests(win) {
browser,
"MozAfterPaint"
);
await ContentTask.spawn(browser, position, async function(contentPosition) {
await SpecialPowers.spawn(browser, [position], async function(contentPosition) {
let select = content.document.getElementById("one");
select.setAttribute("style", contentPosition || "");
select.getBoundingClientRect();
@ -838,7 +836,7 @@ async function performLargePopupTests(win) {
}
if (navigator.platform.indexOf("Mac") == 0) {
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
doc.body.style = "padding-top: 400px;";
@ -901,7 +899,7 @@ add_task(async function test_large_popup_in_small_window() {
async function performSelectSearchTests(win) {
let browser = win.gBrowser.selectedBrowser;
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
let select = doc.getElementById("one");
@ -1110,7 +1108,7 @@ add_task(async function test_blur_hides_popup() {
const pageUrl = "data:text/html," + escape(PAGECONTENT_SMALL);
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
content.addEventListener(
"blur",
function(event) {
@ -1133,7 +1131,7 @@ add_task(async function test_blur_hides_popup() {
"popuphidden"
);
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
content.document.getElementById("one").blur();
});
@ -1145,7 +1143,7 @@ add_task(async function test_blur_hides_popup() {
});
function getIsHandlingUserInput(browser, elementId, eventName) {
return ContentTask.spawn(browser, [elementId, eventName], async function([
return SpecialPowers.spawn(browser, [[elementId, eventName]], async function([
contentElementId,
contentEventName,
]) {

Просмотреть файл

@ -1,6 +1,6 @@
function hideSelectPopup(selectPopup, mode = "enter", win = window) {
let browser = win.gBrowser.selectedBrowser;
let selectClosedPromise = ContentTask.spawn(browser, null, async function() {
let selectClosedPromise = SpecialPowers.spawn(browser, [], async function() {
let { SelectContentHelper } = ChromeUtils.import(
"resource://gre/actors/SelectChild.jsm",
null

Просмотреть файл

@ -12,13 +12,13 @@ SimpleTest.ignoreAllUncaughtExceptions(true);
SimpleTest.requestCompleteLog();
async function requestNotificationPermission(browser) {
return ContentTask.spawn(browser, null, () => {
return SpecialPowers.spawn(browser, [], () => {
return content.Notification.requestPermission();
});
}
async function requestCameraPermission(browser) {
return ContentTask.spawn(browser, null, () => {
return SpecialPowers.spawn(browser, [], () => {
return new Promise(resolve => {
content.navigator.mediaDevices
.getUserMedia({ video: true, fake: true })

Просмотреть файл

@ -1,9 +1,7 @@
const { ContentTaskUtils } = ChromeUtils.import(
"resource://testing-common/ContentTaskUtils.jsm"
);
const { ContentTask } = ChromeUtils.import(
"resource://testing-common/ContentTask.jsm"
);
;
function waitForFullScreenState(browser, state) {
info("inside waitforfullscreenstate");
@ -40,7 +38,7 @@ async function changeFullscreen(browser, fullScreenState) {
SimpleTest.waitForFocus(resolve, browser.ownerGlobal)
);
let fullScreenChange = waitForFullScreenState(browser, fullScreenState);
ContentTask.spawn(browser, fullScreenState, async state => {
SpecialPowers.spawn(browser, [fullScreenState], async state => {
// Wait for document focus before requesting full-screen
await ContentTaskUtils.waitForCondition(
() => docShell.isActive && content.document.hasFocus(),

Просмотреть файл

@ -29,10 +29,8 @@ add_task(async function() {
"popupshown"
);
await ContentTask.spawn(
tab.linkedBrowser,
{ action, param, method, id },
async function(args) {
await SpecialPowers.spawn(
tab.linkedBrowser, [{ action, param, method, id }], async function(args) {
let doc = content.document;
let form = doc.createElement("form");
form.id = args.id;

Просмотреть файл

@ -81,7 +81,7 @@ var successfulPinningPageListener = {
// The browser should load about:neterror, when this happens, proceed
// to load the pinning domain again, this time removing the pinning information
function errorPageLoaded() {
ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let textElement = content.document.getElementById("errorShortDescText2");
let text = textElement.innerHTML;
ok(

Просмотреть файл

@ -40,10 +40,8 @@ async function cutCurrentSelection(elementQueryString, property, browser) {
await BrowserTestUtils.synthesizeKey("x", { accelKey: true }, browser);
// The editor should be empty after cut.
await ContentTask.spawn(
browser,
[elementQueryString, property],
async function([contentElementQueryString, contentProperty]) {
await SpecialPowers.spawn(
browser, [[elementQueryString, property]], async function([contentElementQueryString, contentProperty]) {
let element = content.document.querySelector(contentElementQueryString);
is(
element[contentProperty],
@ -72,7 +70,7 @@ add_task(async function test_paste_transferable_plain_text() {
let DOMWindowUtils = EventUtils._getDOMWindowUtils(window);
DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let textArea = content.document.querySelector("#textarea");
is(
textArea.value,
@ -98,7 +96,7 @@ add_task(async function test_paste_transferable_html() {
await BrowserTestUtils.withNewTab(testPage, async function(browser) {
// Select all the content in your editor element.
await BrowserTestUtils.synthesizeMouse("div", 0, 0, {}, browser);
await ContentTask.spawn(browser, {}, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let element = content.document.querySelector("div");
let selection = content.window.getSelection();
selection.selectAllChildren(element);
@ -110,7 +108,7 @@ add_task(async function test_paste_transferable_html() {
let DOMWindowUtils = EventUtils._getDOMWindowUtils(window);
DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let textArea = content.document.querySelector("div");
is(
textArea.innerHTML,

Просмотреть файл

@ -4,7 +4,7 @@
add_task(async function() {
await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
content.history.pushState({}, "2", "2.html");
});

Просмотреть файл

@ -8,7 +8,7 @@ add_task(async function() {
BrowserTestUtils.loadURI(gBrowser, htmlContent);
await loadedPromise;
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function(arg) {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(arg) {
let frame = content.frames[0];
let sel = frame.getSelection();
let range = frame.document.createRange();

Просмотреть файл

@ -25,10 +25,8 @@ add_task(async function() {
for (let index = 0; index < tests.length; index++) {
let test = tests[index];
await ContentTask.spawn(
gBrowser.selectedBrowser,
{ element: test.element, type: test.type, index },
async function(arg) {
await SpecialPowers.spawn(
gBrowser.selectedBrowser, [{ element: test.element, type: test.type, index }], async function(arg) {
let element = content.document.createElement(arg.element);
element.id = "element" + arg.index;
if (arg.type) {

Просмотреть файл

@ -13,7 +13,7 @@ const URL =
"<script>document.body.firstElementChild.focus()</script></body>";
function getFocusedLocalName(browser) {
return ContentTask.spawn(browser, null, async function() {
return SpecialPowers.spawn(browser, [], async function() {
return content.document.activeElement.localName;
});
}

Просмотреть файл

@ -1,5 +1,5 @@
function remote(task) {
return ContentTask.spawn(gBrowser.selectedBrowser, null, task);
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], task);
}
add_task(async function() {

Просмотреть файл

@ -42,7 +42,7 @@ function test() {
resolve()
);
});
ContentTask.spawn(testBrowser, TEST_IFRAME_URL, url => {
SpecialPowers.spawn(testBrowser, [TEST_IFRAME_URL], url => {
content.document.querySelector("iframe").src = url;
});
});

Просмотреть файл

@ -33,7 +33,7 @@ add_task(async function() {
ok(!newwindow.gFindBarInitialized, "find bar is not yet initialized");
let findBar = await newwindow.gFindBarPromise;
await ContentTask.spawn(selectedBrowser, {}, async function() {
await SpecialPowers.spawn(selectedBrowser, [], async function() {
let elt = content.document.getElementById("h1");
let selection = content.getSelection();
let range = content.document.createRange();

Просмотреть файл

@ -94,10 +94,8 @@ async function testLink(
link.click();
href = link.href;
} else {
href = await ContentTask.spawn(
browser,
[testSubFrame, aLinkIndexOrFunction],
function([subFrame, index]) {
href = await SpecialPowers.spawn(
browser, [[testSubFrame, aLinkIndexOrFunction]], function([subFrame, index]) {
let doc = subFrame
? content.document.querySelector("iframe").contentDocument
: content.document;

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function test() {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: uriString },
async function(browser) {
await ContentTask.spawn(browser, null, function() {
await SpecialPowers.spawn(browser, [], function() {
is(
content.navigator.cookieEnabled,
true,

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function test() {
});
function promiseGetIndex(browser) {
return ContentTask.spawn(browser, null, function() {
return SpecialPowers.spawn(browser, [], function() {
let shistory = docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISHistory);

Просмотреть файл

@ -4,7 +4,7 @@
add_task(async function() {
await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
content.history.pushState({}, "2", "2.html");
});

Просмотреть файл

@ -31,13 +31,13 @@ async function testLink(link, name) {
let winPromise = waitForNewWindow();
ContentTask.spawn(gBrowser.selectedBrowser, link, contentLink => {
SpecialPowers.spawn(gBrowser.selectedBrowser, [link], contentLink => {
content.document.getElementById(contentLink).click();
});
let win = await winPromise;
await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
Assert.equal(
content.document.getElementById("unload-flag").textContent,
"Okay",
@ -57,7 +57,7 @@ async function testLink(link, name) {
async function testLocation(link, url) {
let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
ContentTask.spawn(gBrowser.selectedBrowser, link, contentLink => {
SpecialPowers.spawn(gBrowser.selectedBrowser, [link], contentLink => {
content.document.getElementById(contentLink).click();
});

Просмотреть файл

@ -23,10 +23,8 @@ add_task(async function() {
url: "http://mochi.test:8888/",
element: "body",
go() {
return ContentTask.spawn(
gBrowser.selectedBrowser,
{ writeDomainURL },
async function(arg) {
return SpecialPowers.spawn(
gBrowser.selectedBrowser, [{ writeDomainURL }], async function(arg) {
let contentBody = content.document.body;
contentBody.style.backgroundImage =
"url('" + arg.writeDomainURL + "')";
@ -36,7 +34,7 @@ add_task(async function() {
);
},
verify() {
return ContentTask.spawn(gBrowser.selectedBrowser, null, async function(
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(
arg
) {
Assert.ok(
@ -51,10 +49,8 @@ add_task(async function() {
url: "http://mochi.test:8888/",
element: "img",
go() {
return ContentTask.spawn(
gBrowser.selectedBrowser,
{ writeDomainURL },
async function(arg) {
return SpecialPowers.spawn(
gBrowser.selectedBrowser, [{ writeDomainURL }], async function(arg) {
let doc = content.document;
let img = doc.createElement("img");
img.height = 100;
@ -67,7 +63,7 @@ add_task(async function() {
);
},
verify() {
return ContentTask.spawn(gBrowser.selectedBrowser, null, async function(
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(
arg
) {
Assert.ok(
@ -83,10 +79,8 @@ add_task(async function() {
element: "html",
frameIndex: 0,
go() {
return ContentTask.spawn(
gBrowser.selectedBrowser,
{ writeDomainURL },
async function(arg) {
return SpecialPowers.spawn(
gBrowser.selectedBrowser, [{ writeDomainURL }], async function(arg) {
let doc = content.document;
let iframe = doc.createElement("iframe");
iframe.setAttribute("src", arg.writeDomainURL);
@ -106,7 +100,7 @@ add_task(async function() {
);
},
verify() {
return ContentTask.spawn(gBrowser.selectedBrowser, null, async function(
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(
arg
) {
Assert.ok(

Просмотреть файл

@ -52,7 +52,7 @@ async function openNewTab(aWindow, aExpectedURL) {
false,
aExpectedURL
);
let alreadyLoaded = await ContentTask.spawn(browser, aExpectedURL, url => {
let alreadyLoaded = await SpecialPowers.spawn(browser, [aExpectedURL], url => {
let doc = content.document;
return doc && doc.readyState === "complete" && doc.location.href == url;
});

Просмотреть файл

@ -71,7 +71,7 @@ async function openNewTab(aWindow, aExpectedURL) {
false,
aExpectedURL
);
let alreadyLoaded = await ContentTask.spawn(browser, aExpectedURL, url => {
let alreadyLoaded = await SpecialPowers.spawn(browser, [aExpectedURL], url => {
let doc = content.document;
return doc && doc.readyState === "complete" && doc.location.href == url;
});

Просмотреть файл

@ -31,13 +31,13 @@ add_task(async function() {
);
let browser = tab.linkedBrowser;
await ContentTask.spawn(browser, {}, async function(arg) {
await SpecialPowers.spawn(browser, [], async function(arg) {
content.document.getElementById("input").focus();
});
await BrowserTestUtils.synthesizeKey("v", { accelKey: true }, browser);
let output = await ContentTask.spawn(browser, {}, async function(arg) {
let output = await SpecialPowers.spawn(browser, [], async function(arg) {
return content.document.getElementById("output").textContent;
});
is(output, "Passed", "Paste file");

Просмотреть файл

@ -35,7 +35,7 @@ async function test_decoder_doctor_notification(
"decoder-doctor-notification"
);
await ContentTask.spawn(browser, data, async function(aData) {
await SpecialPowers.spawn(browser, [data], async function(aData) {
Services.obs.notifyObservers(
content.window,
"decoder-doctor-notification",

Просмотреть файл

@ -160,7 +160,7 @@ add_task(async function() {
"basic focus content page with button focused"
);
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
return content.document.getElementById("button1").focus();
});
@ -182,7 +182,7 @@ add_task(async function() {
);
// Check to ensure that the root element is focused
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
Assert.ok(
content.document.activeElement == content.document.documentElement,
"basic focus again content page with button focused child root is focused"

Просмотреть файл

@ -80,7 +80,7 @@ registerCleanupFunction(async function() {
if (testTab.parentNode) {
// Remove the handler, or closing this tab will prove tricky:
try {
await ContentTask.spawn(testTab.linkedBrowser, null, function() {
await SpecialPowers.spawn(testTab.linkedBrowser, [], function() {
content.window.onbeforeunload = null;
});
} catch (ex) {}

Просмотреть файл

@ -276,10 +276,8 @@ function waitForWindowOpen(aOptions) {
}
function executeWindowOpenInContent(aParam) {
ContentTask.spawn(
newBrowser.selectedBrowser,
JSON.stringify(aParam),
async function(dataTestParam) {
SpecialPowers.spawn(
newBrowser.selectedBrowser, [JSON.stringify(aParam)], async function(dataTestParam) {
let testElm = content.document.getElementById("test");
testElm.setAttribute("data-test-param", dataTestParam);
testElm.click();

Просмотреть файл

@ -11,7 +11,7 @@ const kURL =
add_task(async function() {
await BrowserTestUtils.withNewTab(kURL, async function(browser) {
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let a = content.document.createElement("a");
// newTabPromise won't resolve until it has a URL that's not "about:blank".
// But doing document.open() from inside that same document does not change

Просмотреть файл

@ -25,7 +25,7 @@ add_task(async function() {
// Open new http window from JavaScript in file:// page and check that we get
// a new window with the correct page and features.
let promiseNewWindow = BrowserTestUtils.waitForNewWindow({ url: TEST_HTTP });
await ContentTask.spawn(browser, TEST_HTTP, uri => {
await SpecialPowers.spawn(browser, [TEST_HTTP], uri => {
content.open(uri, "_blank");
});
let win = await promiseNewWindow;

Просмотреть файл

@ -32,10 +32,8 @@ add_task(async function() {
checked: el.getAttribute("checked") == "true",
}));
let validLinks = await ContentTask.spawn(
gBrowser.selectedBrowser,
items,
function(contentItems) {
let validLinks = await SpecialPowers.spawn(
gBrowser.selectedBrowser, [items], function(contentItems) {
let contentValidLinks = 0;
Array.prototype.forEach.call(
content.document.querySelectorAll("link, style"),

Просмотреть файл

@ -19,7 +19,7 @@ add_task(async function() {
await SimpleTest.promiseFocus(gBrowser.selectedBrowser);
// Initial setup of the content area.
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function(arg) {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(arg) {
let doc = content.document;
let range = doc.createRange();
let selection = content.getSelection();
@ -173,10 +173,8 @@ add_task(async function() {
);
for (let testid = 0; testid < checks.length; testid++) {
let menuPosition = await ContentTask.spawn(
gBrowser.selectedBrowser,
{ testid },
async function(arg) {
let menuPosition = await SpecialPowers.spawn(
gBrowser.selectedBrowser, [{ testid }], async function(arg) {
let range = content.tests[arg.testid]();
// Get the range of the selection and determine its coordinates. These

Просмотреть файл

@ -20,7 +20,7 @@ const PREF = "accessibility.blockautorefresh";
* @returns Promise
*/
async function attemptFakeRefresh(browser, expectRefresh) {
await ContentTask.spawn(browser, expectRefresh, async function(
await SpecialPowers.spawn(browser, [expectRefresh], async function(
contentExpectRefresh
) {
let URI = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;

Просмотреть файл

@ -69,7 +69,7 @@ async function searchDiscovery() {
true
);
await ContentTask.spawn(gBrowser.selectedBrowser, testCase, test => {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [testCase], test => {
let doc = content.document;
let head = doc.getElementById("linkparent");
let link = doc.createElement("link");
@ -105,7 +105,7 @@ async function searchDiscovery() {
e => e.target.href == "http://second.mozilla.com/search.xml",
true
);
await ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
let doc = content.document;
let head = doc.getElementById("linkparent");
let link = doc.createElement("link");

Просмотреть файл

@ -108,7 +108,7 @@ async function testSetAutomatic(testURL, suffix, errorURISuffix) {
let statusPromise = createReportResponseStatusPromise(URL_REPORTS + suffix);
// Click the checkbox, enable automatic error reports.
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
content.document.getElementById("automaticallyReportInFuture").click();
});
@ -122,7 +122,7 @@ async function testSetAutomatic(testURL, suffix, errorURISuffix) {
ok(isAutomaticReportingEnabled(), "automatic SSL report submission enabled");
// Disable automatic error reports.
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
content.document.getElementById("automaticallyReportInFuture").click();
});
@ -153,7 +153,7 @@ async function testSendReportDisabled(testURL, errorURISuffix) {
await checkErrorPage(browser, errorURISuffix);
// Check that the error reporting section is hidden.
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let section = content.document.getElementById("certificateErrorReporting");
Assert.equal(
content.getComputedStyle(section).display,
@ -189,7 +189,7 @@ function createReportResponseStatusPromise(expectedURI) {
}
function checkErrorPage(browser, suffix) {
return ContentTask.spawn(browser, { suffix }, async function(args) {
return SpecialPowers.spawn(browser, [{ suffix }], async function(args) {
let uri = content.document.documentURI;
Assert.ok(
uri.startsWith(`about:${args.suffix}`),

Просмотреть файл

@ -3,7 +3,7 @@ function swapTabsAndCloseOther(a, b) {
}
var getClicks = function(tab) {
return ContentTask.spawn(tab.linkedBrowser, {}, function() {
return SpecialPowers.spawn(tab.linkedBrowser, [], function() {
return content.wrappedJSObject.clicks;
});
};
@ -11,7 +11,7 @@ var getClicks = function(tab) {
var clickTest = async function(tab) {
let clicks = await getClicks(tab);
await ContentTask.spawn(tab.linkedBrowser, {}, function() {
await SpecialPowers.spawn(tab.linkedBrowser, [], function() {
let target = content.document.body;
let rect = target.getBoundingClientRect();
let left = (rect.left + rect.right) / 2;

Просмотреть файл

@ -45,7 +45,7 @@ add_task(async function() {
// Run tests once again.
let promise = promiseTestsDone(win2);
let browser2 = win2.gBrowser.selectedBrowser;
await ContentTask.spawn(browser2, null, async () => {
await SpecialPowers.spawn(browser2, [], async () => {
content.test_panels();
});
await promise;

Просмотреть файл

@ -43,7 +43,7 @@ add_task(async function() {
);
});
info("Opening second tab using a click");
await ContentTask.spawn(firstTab.linkedBrowser, "", async function() {
await SpecialPowers.spawn(firstTab.linkedBrowser, [""], async function() {
content.document.getElementsByTagName("a")[0].click();
});
info("Waiting for the second tab to be opened");

Просмотреть файл

@ -24,7 +24,7 @@ function getParentTabState(aTab) {
}
function getChildTabState(aTab) {
return ContentTask.spawn(aTab.linkedBrowser, {}, async function() {
return SpecialPowers.spawn(aTab.linkedBrowser, [], async function() {
return docShell.isActive;
});
}

Просмотреть файл

@ -31,10 +31,10 @@ add_task(async function() {
await scrollPromise;
// Wait for one paint to ensure we've processed the previous key events and scrolling.
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
return new Promise(resolve => {
content.requestAnimationFrame(() => {
setTimeout(resolve, 0);
content.setTimeout(resolve, 0);
});
});
});
@ -46,7 +46,7 @@ add_task(async function() {
EventUtils.synthesizeKey("g", { accelKey: true });
await scrollPromise;
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
Assert.ok(
content.document.getElementById("s").getBoundingClientRect().left >= 0,
"scroll should include find result"

Просмотреть файл

@ -263,7 +263,7 @@ async function whenNewTabLoaded(aWindow, aCallback) {
let expectedURL = aboutNewTabService.newTabURL;
let browser = aWindow.gBrowser.selectedBrowser;
let loadPromise = BrowserTestUtils.browserLoaded(browser, false, expectedURL);
let alreadyLoaded = await ContentTask.spawn(browser, expectedURL, url => {
let alreadyLoaded = await SpecialPowers.spawn(browser, [expectedURL], url => {
let doc = content.document;
return doc && doc.readyState === "complete" && doc.location.href == url;
});
@ -523,7 +523,7 @@ async function loadBadCertPage(url) {
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
await loaded;
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
content.document.getElementById("exceptionDialogButton").click();
});
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URI);
let browser = tab.linkedBrowser;
let imageInfo = await ContentTask.spawn(browser, null, async () => {
let imageInfo = await SpecialPowers.spawn(browser, [], async () => {
let testImg = content.document.getElementById("test-image");
return {

Просмотреть файл

@ -59,7 +59,7 @@ add_task(async function test_ShowCertificate() {
viewCertButton.click();
await loaded;
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let certificateSection = await ContentTaskUtils.waitForCondition(() => {
return content.document.querySelector("certificate-section");
}, "Certificate section found");

Просмотреть файл

@ -209,7 +209,7 @@ add_task(async function testBFCache() {
// Not sure why using `gBrowser.goForward()` doesn't trigger document's
// visibility changes in some debug build on try server, which makes us not
// to receive the blocked event.
await ContentTask.spawn(browser, null, () => {
await SpecialPowers.spawn(browser, [], () => {
content.history.forward();
});
await blockedIconShown();

Просмотреть файл

@ -119,10 +119,10 @@ function testPermission() {
}
async function withNewTabNoInput(grantPermission, browser) {
await ContentTask.spawn(browser, null, initTab);
await SpecialPowers.spawn(browser, [], initTab);
await enableResistFingerprinting(false);
let popupShown = promisePopupShown();
await ContentTask.spawn(browser, null, extractCanvasData);
await SpecialPowers.spawn(browser, [], extractCanvasData);
await popupShown;
let popupHidden = promisePopupHidden();
if (grantPermission) {
@ -134,7 +134,7 @@ async function withNewTabNoInput(grantPermission, browser) {
await popupHidden;
is(testPermission(), Services.perms.DENY_ACTION, "permission denied");
}
await ContentTask.spawn(browser, grantPermission, extractCanvasData);
await SpecialPowers.spawn(browser, [grantPermission], extractCanvasData);
await SpecialPowers.popPrefEnv();
}
@ -154,7 +154,7 @@ add_task(doTestNoInput.bind(null, false));
add_task(doTestNoInput.bind(null, true));
async function withNewTabAutoBlockNoInput(browser) {
await ContentTask.spawn(browser, null, initTab);
await SpecialPowers.spawn(browser, [], initTab);
await enableResistFingerprinting(true);
let noShowHandler = () => {
@ -169,7 +169,7 @@ async function withNewTabAutoBlockNoInput(browser) {
);
// Try to extract canvas data without user inputs.
await ContentTask.spawn(browser, null, extractCanvasData);
await SpecialPowers.spawn(browser, [], extractCanvasData);
await promisePopupObserver;
info("There should be no popup shown on the panel.");
@ -220,10 +220,10 @@ function extractCanvasDataUserInput(grantPermission) {
}
async function withNewTabInput(grantPermission, browser) {
await ContentTask.spawn(browser, null, initTab);
await SpecialPowers.spawn(browser, [], initTab);
await enableResistFingerprinting(true);
let popupShown = promisePopupShown();
await ContentTask.spawn(browser, null, function(host) {
await SpecialPowers.spawn(browser, [], function(host) {
E10SUtils.wrapHandlingUserInput(content, true, function() {
var button = content.document.getElementById("clickme");
button.click();
@ -240,7 +240,7 @@ async function withNewTabInput(grantPermission, browser) {
await popupHidden;
is(testPermission(), Services.perms.DENY_ACTION, "permission denied");
}
await ContentTask.spawn(browser, grantPermission, extractCanvasDataUserInput);
await SpecialPowers.spawn(browser, [grantPermission], extractCanvasDataUserInput);
await SpecialPowers.popPrefEnv();
}

Просмотреть файл

@ -296,7 +296,7 @@ add_task(async function testPermissionShortcuts() {
async function tryKey(desc, expectedValue) {
await EventUtils.synthesizeAndWaitKey("c", { accelKey: true });
let result = await ContentTask.spawn(browser, null, function() {
let result = await SpecialPowers.spawn(browser, [], function() {
return {
keydowns: content.wrappedJSObject.gKeyDowns,
keypresses: content.wrappedJSObject.gKeyPresses,

Просмотреть файл

@ -14,7 +14,7 @@ async function showPermissionPrompt(browser) {
"popupshown"
);
await ContentTask.spawn(browser, null, function() {
await SpecialPowers.spawn(browser, [], function() {
E10SUtils.wrapHandlingUserInput(content, true, () => {
// We need to synthesize the click instead of calling .click(),
// otherwise the document will not correctly register the user gesture.

Просмотреть файл

@ -15,7 +15,7 @@ function assertShown(task) {
"popupshown"
);
await ContentTask.spawn(browser, null, task);
await SpecialPowers.spawn(browser, [], task);
await popupshown;
@ -30,7 +30,7 @@ function assertNotShown(task) {
"popupshown"
);
await ContentTask.spawn(browser, null, task);
await SpecialPowers.spawn(browser, [], task);
let sawPrompt = await Promise.race([
popupshown.then(() => true),

Просмотреть файл

@ -17,7 +17,7 @@ function testPostPrompt(task) {
"notifications icon is not visible at first"
);
await ContentTask.spawn(browser, null, task);
await SpecialPowers.spawn(browser, [], task);
await TestUtils.waitForCondition(
() => BrowserTestUtils.is_visible(icon),

Просмотреть файл

@ -170,7 +170,7 @@ add_task(async function test_backspace() {
"<input id='field' value='something'></body>";
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, uri);
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
content.document.getElementById("field").focus();
// Add a promise that resolves when the backspace key gets received
@ -188,10 +188,8 @@ add_task(async function test_backspace() {
EventUtils.synthesizeKey("KEY_ArrowRight", {});
EventUtils.synthesizeKey("KEY_Backspace", {});
let fieldValue = await ContentTask.spawn(
tab.linkedBrowser,
{},
async function() {
let fieldValue = await SpecialPowers.spawn(
tab.linkedBrowser, [], async function() {
return content.keysPromise;
}
);

Просмотреть файл

@ -81,7 +81,7 @@ add_task(async function testTempPermissionSubframes() {
});
// Request a permission.
await ContentTask.spawn(browser, uri.host, async function(host0) {
await SpecialPowers.spawn(browser, [uri.host], async function(host0) {
let frame = content.document.getElementById("frame");
await content.SpecialPowers.spawn(frame, [host0], async function(host) {

Просмотреть файл

@ -30,7 +30,7 @@ add_task(async function testTempPermissionOnReload() {
});
// Reload through the page (should not remove the temp permission).
await ContentTask.spawn(browser, {}, () =>
await SpecialPowers.spawn(browser, [], () =>
content.document.location.reload()
);
@ -181,10 +181,8 @@ add_task(async function testTempPermissionOnNavigation() {
);
// Navigate to another domain.
await ContentTask.spawn(
browser,
{},
() => (content.document.location = "https://example.org/")
await SpecialPowers.spawn(
browser, [], () => (content.document.location = "https://example.org/")
);
await loaded;
@ -201,10 +199,8 @@ add_task(async function testTempPermissionOnNavigation() {
loaded = BrowserTestUtils.browserLoaded(browser, false, origin);
// Navigate to the original domain.
await ContentTask.spawn(
browser,
{},
() => (content.document.location = "https://example.com/")
await SpecialPowers.spawn(
browser, [], () => (content.document.location = "https://example.com/")
);
await loaded;

Просмотреть файл

@ -51,7 +51,7 @@ add_task(async function() {
// Display a context menu on the test plugin so we can test
// activation menu options.
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let plugin = content.document.getElementById("test");
let bounds = plugin.getBoundingClientRect();
let left = (bounds.left + bounds.right) / 2;

Просмотреть файл

@ -88,7 +88,7 @@ add_task(async function() {
crashReportChecker
);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let plugin = content.document.getElementById("test");
await ContentTaskUtils.waitForCondition(() => {
@ -204,7 +204,7 @@ add_task(async function() {
crashReportChecker
);
await ContentTask.spawn(browser, null, async function() {
await SpecialPowers.spawn(browser, [], async function() {
let plugin = content.document.getElementById("test");
await ContentTaskUtils.waitForCondition(() => {

Просмотреть файл

@ -124,10 +124,8 @@ add_task(async function() {
);
ok(!pluginInfo.activated, "plugin should not be activated");
await ContentTask.spawn(
gNewWindow.gBrowser.selectedBrowser,
{},
async function() {
await SpecialPowers.spawn(
gNewWindow.gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let bounds = plugin.getBoundingClientRect();

Просмотреть файл

@ -67,10 +67,8 @@ add_task(async function() {
`${gTestRoot}plugin_favorfallback.html?testcase=${testcase.name}`
);
await ContentTask.spawn(
tab.linkedBrowser,
testcase.name,
async function testPlugins(name) {
await SpecialPowers.spawn(
tab.linkedBrowser, [testcase.name], async function testPlugins(name) {
let testcaseDiv = content.document.getElementById(`testcase_${name}`);
let ctpPlugins = testcaseDiv.querySelectorAll(".expected_ctp");

Просмотреть файл

@ -39,7 +39,7 @@ add_task(async function() {
await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
// Tests that the overlay can be hidden for plugins using the close icon.
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -74,7 +74,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");

Просмотреть файл

@ -32,7 +32,7 @@ add_task(async function() {
// Tests that the overlays are visible and actionable if the plugin is in an iframe.
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let frame = content.document.getElementById("frame");
let doc = frame.contentDocument;
let plugin = doc.getElementById("test");

Просмотреть файл

@ -48,7 +48,7 @@ add_task(async function() {
null,
true
);
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let plugin = content.document.getElementById("secondtestA");
plugin.remove();
plugin = content.document.getElementById("secondtestB");
@ -67,7 +67,7 @@ add_task(async function() {
);
ok(popupNotification, "Test 2, Should have a click-to-play notification");
await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
let plugin = content.document.getElementById("test");
plugin.remove();
});

Просмотреть файл

@ -49,7 +49,7 @@ add_task(async function() {
gTestRoot + "plugin_outsideScrollArea.html"
);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let p = doc.createElement("embed");
@ -66,7 +66,7 @@ add_task(async function() {
await promisePopupNotification("click-to-play-plugins");
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
Assert.ok(
@ -84,7 +84,7 @@ add_task(async function() {
gTestRoot + "plugin_outsideScrollArea.html"
);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let p = doc.createElement("embed");
@ -101,7 +101,7 @@ add_task(async function() {
await promisePopupNotification("click-to-play-plugins");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
Assert.ok(
@ -119,7 +119,7 @@ add_task(async function() {
gTestRoot + "plugin_outsideScrollArea.html"
);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let p = doc.createElement("embed");
@ -135,7 +135,7 @@ add_task(async function() {
await promiseUpdatePluginBindings(gTestBrowser);
await promisePopupNotification("click-to-play-plugins");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
Assert.ok(

Просмотреть файл

@ -80,7 +80,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, gTestcases, async function(testcases) {
await SpecialPowers.spawn(gTestBrowser, [gTestcases], async function(testcases) {
let doc = content.document;
for (let testcaseId of Object.keys(testcases)) {

Просмотреть файл

@ -55,7 +55,7 @@ add_task(async function() {
);
ok(popupNotification, "Test 2, Should have a click-to-play notification");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -67,7 +67,7 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
plugin.style.width = "300px";
});
@ -75,7 +75,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -87,16 +87,16 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
plugin.style.height = "300px";
});
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
content.document.getElementById("test").clientTop;
});
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -108,17 +108,17 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
plugin.style.width = "10px";
plugin.style.height = "10px";
});
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
content.document.getElementById("test").clientTop;
});
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -130,17 +130,17 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
plugin.style.height = "300px";
plugin.style.width = "300px";
});
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
content.document.getElementById("test").clientTop;
});
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");

Просмотреть файл

@ -55,7 +55,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let testcases = doc.querySelectorAll(".testcase");

Просмотреть файл

@ -64,7 +64,7 @@ add_task(async function() {
gTestRoot + "plugin_zoom.html"
);
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, { count }, async function(args) {
await SpecialPowers.spawn(gTestBrowser, [{ count }], async function(args) {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");

Просмотреть файл

@ -11,7 +11,7 @@ function updateAllTestPlugins(aState) {
}
function promisePluginActivated() {
return ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
return SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
return ContentTaskUtils.waitForCondition(
() => content.document.getElementById("test").activated,
"Wait for plugin to be activated"
@ -77,7 +77,7 @@ add_task(async function() {
);
ok(!pluginInfo.activated, "Test 18a, Plugin should not be activated");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -101,7 +101,7 @@ add_task(async function() {
true
);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let updateLink = plugin.openOrClosedShadowRoot.getElementById(
@ -135,7 +135,7 @@ add_task(async function() {
);
ok(!pluginInfo.activated, "Test 18b, Plugin should not be activated");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -177,7 +177,7 @@ add_task(async function() {
);
ok(!pluginInfo.activated, "Test 18c, Plugin should not be activated");
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let overlay = plugin.openOrClosedShadowRoot.getElementById("main");
@ -261,7 +261,7 @@ add_task(async function() {
oldEventCallback = null;
};
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let doc = content.document;
let plugin = doc.getElementById("test");
let bounds = plugin.getBoundingClientRect();
@ -427,7 +427,7 @@ add_task(async function() {
"Test 26, plugin fallback type should be PLUGIN_BLOCKLISTED"
);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
Assert.ok(!plugin.activated, "Plugin should not be activated.");
});

Просмотреть файл

@ -55,7 +55,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let test = content.document.getElementById("test");
Assert.ok(test.activated, "task 1a: test plugin should be activated!");
});
@ -76,7 +76,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let test = content.document.getElementById("test");
ok(!test.activated, "task 2a: test plugin shouldn't activate!");
});
@ -106,7 +106,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let test = content.document.getElementById("test");
Assert.ok(test.activated, "task 3a: test plugin should be activated!");
});
@ -127,7 +127,7 @@ add_task(async function() {
// Work around for delayed PluginBindingAttached
await promiseUpdatePluginBindings(gTestBrowser);
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let test = content.document.getElementById("test");
Assert.ok(!test.activated, "task 4a: test plugin shouldn't activate!");
});

Просмотреть файл

@ -58,7 +58,7 @@ add_task(async function() {
);
ok(!notification, "Test 1a, Should not have a click-to-play notification");
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
new XPCNativeWrapper(XPCNativeWrapper.unwrap(content).addPlugin());
});
@ -66,7 +66,7 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementsByTagName("embed")[0];
Assert.ok(!plugin.activated, "Test 1b, Plugin should not be activated");
});
@ -81,7 +81,7 @@ add_task(async function() {
PopupNotifications.panel.firstElementChild.button.click();
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementsByTagName("embed")[0];
Assert.ok(plugin.activated, "Test 1b, Plugin should be activated");
});
@ -94,7 +94,7 @@ add_task(async function() {
);
ok(notification, "Test 1c, Should still have a click-to-play notification");
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
new XPCNativeWrapper(XPCNativeWrapper.unwrap(content).addPlugin());
let plugin = content.document.getElementsByTagName("embed")[1];
Assert.ok(
@ -105,7 +105,7 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementsByTagName("embed")[1];
Assert.ok(plugin.activated, "Test 1d, Plugin should be activated");
@ -116,7 +116,7 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
new XPCNativeWrapper(XPCNativeWrapper.unwrap(content).addPlugin());
let plugin = content.document.getElementsByTagName("embed")[2];
Assert.ok(plugin.activated, "Test 1e, Plugin should be activated");
@ -124,7 +124,7 @@ add_task(async function() {
});
add_task(async function() {
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementsByTagName("embed")[2];
Assert.ok(plugin.activated, "Test 1f, Plugin should be activated");

Просмотреть файл

@ -39,7 +39,7 @@ add_task(async function() {
await promisePluginBindingAttached;
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("test");
if (!plugin) {
Assert.ok(false, "plugin element not available.");

Просмотреть файл

@ -45,7 +45,7 @@ add_task(async function() {
// click the overlay to prompt
let promise = promisePopupNotification("click-to-play-plugins");
await ContentTask.spawn(gTestBrowser, {}, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
let plugin = content.document.getElementById("plugin");
let bounds = plugin.getBoundingClientRect();
let left = (bounds.left + bounds.right) / 2;

Просмотреть файл

@ -44,7 +44,7 @@ add_task(async function() {
);
// simple cpows
await ContentTask.spawn(gTestBrowser, null, function() {
await SpecialPowers.spawn(gTestBrowser, [], function() {
let plugin = content.document.getElementById("plugin");
ok(plugin, "plugin should be in the page");
});

Просмотреть файл

@ -65,7 +65,7 @@ add_task(async function() {
"plugin should be marked as VULNERABLE"
);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
Assert.ok(
!!content.document.getElementById("test"),
"test part 1: plugin should not be activated"
@ -87,7 +87,7 @@ add_task(async function() {
!popupNotification,
"test part 2: Should not have a click-to-play notification"
);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
Assert.ok(
!content.document.getElementById("test"),
"test part 2: plugin should not be activated"
@ -122,7 +122,7 @@ add_task(async function() {
"plugin should be marked as VULNERABLE"
);
await ContentTask.spawn(gTestBrowser, null, async function() {
await SpecialPowers.spawn(gTestBrowser, [], async function() {
Assert.ok(
!!content.document.getElementById("test"),
"test part 3: plugin should not be activated"

Просмотреть файл

@ -46,7 +46,7 @@ add_task(async function() {
);
ok(!pluginInfo.activated, "plugin should not be activated");
await ContentTask.spawn(gTestBrowser, null, () => {
await SpecialPowers.spawn(gTestBrowser, [], () => {
let unknown = content.document.getElementById("unknown");
ok(unknown, "should have unknown plugin in page");
});

Просмотреть файл

@ -34,7 +34,7 @@ add_task(async function() {
// Have content request access to Widevine, UI should drop down to
// prompt user to enable DRM.
let result = await ContentTask.spawn(browser, {}, async function() {
let result = await SpecialPowers.spawn(browser, [], async function() {
try {
let config = [
{

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше