mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1508985 - Enable ESLint for dom/tests/browser (manual changes) r=Standard8,qdot
Differential Revision: https://phabricator.services.mozilla.com/D14018 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
3b243b7e27
commit
a3846471d6
@ -208,7 +208,7 @@ dom/security/test/sri/**
|
|||||||
dom/serviceworkers/**
|
dom/serviceworkers/**
|
||||||
dom/smil/**
|
dom/smil/**
|
||||||
dom/svg/**
|
dom/svg/**
|
||||||
dom/tests/browser/**
|
|
||||||
dom/tests/html/**
|
dom/tests/html/**
|
||||||
dom/tests/mochitest/**
|
dom/tests/mochitest/**
|
||||||
dom/u2f/**
|
dom/u2f/**
|
||||||
|
@ -101,6 +101,8 @@ async function consoleAPISanityTest(browser) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// These globals are all defined in spawnWithObserver in a sub-process.
|
||||||
|
/* global gWindow, gArgs:true, gLevel:true, gStyle:true, expect, resolve */
|
||||||
function testConsoleData(aMessageObject) {
|
function testConsoleData(aMessageObject) {
|
||||||
let messageWindow = Services.wm.getOuterWindowWithId(aMessageObject.ID);
|
let messageWindow = Services.wm.getOuterWindowWithId(aMessageObject.ID);
|
||||||
is(messageWindow, gWindow, "found correct window by window ID");
|
is(messageWindow, gWindow, "found correct window by window ID");
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
const TEST_URI = "http://example.com/browser/dom/tests/browser/test_largeAllocation.html";
|
const TEST_URI = "http://example.com/browser/dom/tests/browser/test_largeAllocation.html";
|
||||||
|
|
||||||
function expectProcessCreated() {
|
function expectProcessCreated() {
|
||||||
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
let os = Services.obs;
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let topic = "ipc:content-created";
|
let topic = "ipc:content-created";
|
||||||
function observer() {
|
function observer() {
|
||||||
|
@ -41,6 +41,7 @@ SpecialPowers.pushPrefEnv(
|
|||||||
* Test navigation from a content page to a chrome page. Also check that only
|
* Test navigation from a content page to a chrome page. Also check that only
|
||||||
* one beforeunload event is fired.
|
* one beforeunload event is fired.
|
||||||
*/
|
*/
|
||||||
|
/* global messageManager */
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
let beforeUnloadCount = 0;
|
let beforeUnloadCount = 0;
|
||||||
messageManager.addMessageListener("Test:OnBeforeUnloadReceived", function() {
|
messageManager.addMessageListener("Test:OnBeforeUnloadReceived", function() {
|
||||||
|
@ -273,6 +273,7 @@ async function newTabTest(location) {
|
|||||||
async function(browser) {
|
async function(browser) {
|
||||||
await ContentTask.spawn(browser, { location, testInDocument_: testInDocument.toSource() },
|
await ContentTask.spawn(browser, { location, testInDocument_: testInDocument.toSource() },
|
||||||
async function({ location, testInDocument_ }) {
|
async function({ location, testInDocument_ }) {
|
||||||
|
// eslint-disable-next-line no-eval
|
||||||
let testInDocument = eval(`(() => (${testInDocument_}))()`);
|
let testInDocument = eval(`(() => (${testInDocument_}))()`);
|
||||||
testInDocument(content.document, location);
|
testInDocument(content.document, location);
|
||||||
});
|
});
|
||||||
|
@ -50,6 +50,7 @@ add_task(async function() {
|
|||||||
function f() {
|
function f() {
|
||||||
let e = content.document.activeElement;
|
let e = content.document.activeElement;
|
||||||
if (e.tagName != test.tagName) {
|
if (e.tagName != test.tagName) {
|
||||||
|
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||||
setTimeout(f, 10);
|
setTimeout(f, 10);
|
||||||
} else {
|
} else {
|
||||||
is(Services.focus.focusedElement, e,
|
is(Services.focus.focusedElement, e,
|
||||||
@ -68,6 +69,7 @@ add_task(async function() {
|
|||||||
function f() {
|
function f() {
|
||||||
let e = content.document.activeElement;
|
let e = content.document.activeElement;
|
||||||
if (e.tagName != test.tagName) {
|
if (e.tagName != test.tagName) {
|
||||||
|
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||||
setTimeout(f, 10);
|
setTimeout(f, 10);
|
||||||
} else {
|
} else {
|
||||||
isnot(Services.focus.focusedElement, e,
|
isnot(Services.focus.focusedElement, e,
|
||||||
@ -110,6 +112,7 @@ add_task(async function() {
|
|||||||
function f() {
|
function f() {
|
||||||
let e = content.document.activeElement;
|
let e = content.document.activeElement;
|
||||||
if (e.tagName != test.tagName) {
|
if (e.tagName != test.tagName) {
|
||||||
|
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||||
setTimeout(f, 10);
|
setTimeout(f, 10);
|
||||||
} else {
|
} else {
|
||||||
isnot(Services.focus.focusedElement, e,
|
isnot(Services.focus.focusedElement, e,
|
||||||
@ -128,6 +131,7 @@ add_task(async function() {
|
|||||||
function f() {
|
function f() {
|
||||||
let e = content.document.activeElement;
|
let e = content.document.activeElement;
|
||||||
if (e.tagName != test.tagName) {
|
if (e.tagName != test.tagName) {
|
||||||
|
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||||
setTimeout(f, 10);
|
setTimeout(f, 10);
|
||||||
} else {
|
} else {
|
||||||
isnot(Services.focus.focusedElement, e,
|
isnot(Services.focus.focusedElement, e,
|
||||||
|
@ -13,8 +13,7 @@ add_task(async function test() {
|
|||||||
|
|
||||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kTestURI);
|
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kTestURI);
|
||||||
|
|
||||||
let fm = Cc["@mozilla.org/focus-manager;1"].
|
let fm = Services.focus;
|
||||||
getService(Ci.nsIFocusManager);
|
|
||||||
|
|
||||||
for (var button = 0; button < 3; button++) {
|
for (var button = 0; button < 3; button++) {
|
||||||
// Set focus to a chrome element before synthesizing a mouse down event.
|
// Set focus to a chrome element before synthesizing a mouse down event.
|
||||||
@ -31,8 +30,7 @@ add_task(async function test() {
|
|||||||
"Failed to move focus away from search bar: button=" + button);
|
"Failed to move focus away from search bar: button=" + button);
|
||||||
|
|
||||||
await ContentTask.spawn(tab.linkedBrowser, button, async function(button) {
|
await ContentTask.spawn(tab.linkedBrowser, button, async function(button) {
|
||||||
let fm = Cc["@mozilla.org/focus-manager;1"].
|
let fm = Services.focus;
|
||||||
getService(Ci.nsIFocusManager);
|
|
||||||
|
|
||||||
let attempts = 10;
|
let attempts = 10;
|
||||||
await new Promise(resolve => {
|
await new Promise(resolve => {
|
||||||
|
@ -8,23 +8,21 @@ var PaintListener = {};
|
|||||||
Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
|
Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
|
||||||
const { ContentTaskUtils } = ChromeUtils.import("resource://testing-common/ContentTaskUtils.jsm", {});
|
const { ContentTaskUtils } = ChromeUtils.import("resource://testing-common/ContentTaskUtils.jsm", {});
|
||||||
|
|
||||||
function getRecordedKeypressCount()
|
function getRecordedKeypressCount() {
|
||||||
{
|
|
||||||
let snapshot = Services.telemetry.getSnapshotForHistograms("main", false);
|
let snapshot = Services.telemetry.getSnapshotForHistograms("main", false);
|
||||||
|
|
||||||
var totalCount = 0;
|
var totalCount = 0;
|
||||||
for (var prop in snapshot) {
|
for (var prop in snapshot) {
|
||||||
if (snapshot[prop]["KEYPRESS_PRESENT_LATENCY"]) {
|
if (snapshot[prop].KEYPRESS_PRESENT_LATENCY) {
|
||||||
dump("found snapshot");
|
dump("found snapshot");
|
||||||
totalCount += Object.values(snapshot[prop]["KEYPRESS_PRESENT_LATENCY"].values).reduce((a, b) => a + b, 0);
|
totalCount += Object.values(snapshot[prop].KEYPRESS_PRESENT_LATENCY.values).reduce((a, b) => a + b, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalCount;
|
return totalCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function()
|
add_task(async function() {
|
||||||
{
|
|
||||||
await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.ipcBatchTimeout", 10]]});
|
await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.ipcBatchTimeout", 10]]});
|
||||||
let histogram = Services.telemetry.getHistogramById("KEYPRESS_PRESENT_LATENCY");
|
let histogram = Services.telemetry.getHistogramById("KEYPRESS_PRESENT_LATENCY");
|
||||||
histogram.clear();
|
histogram.clear();
|
||||||
@ -33,17 +31,17 @@ add_task(async function()
|
|||||||
|
|
||||||
gURLBar.focus();
|
gURLBar.focus();
|
||||||
await SimpleTest.promiseFocus(window);
|
await SimpleTest.promiseFocus(window);
|
||||||
EventUtils.sendChar('x');
|
EventUtils.sendChar("x");
|
||||||
|
|
||||||
await ContentTaskUtils.waitForCondition(() => { return getRecordedKeypressCount() > 0; }, "waiting for telemetry", 200, 600)
|
await ContentTaskUtils.waitForCondition(() => { return getRecordedKeypressCount() > 0; }, "waiting for telemetry", 200, 600);
|
||||||
let result = getRecordedKeypressCount();
|
let result = getRecordedKeypressCount();
|
||||||
ok(result == 1, "One keypress recorded");
|
ok(result == 1, "One keypress recorded");
|
||||||
|
|
||||||
gURLBar.focus();
|
gURLBar.focus();
|
||||||
await SimpleTest.promiseFocus(window);
|
await SimpleTest.promiseFocus(window);
|
||||||
EventUtils.sendChar('x');
|
EventUtils.sendChar("x");
|
||||||
|
|
||||||
await ContentTaskUtils.waitForCondition(() => { return getRecordedKeypressCount() > 1; }, "waiting for telemetry", 200, 600)
|
await ContentTaskUtils.waitForCondition(() => { return getRecordedKeypressCount() > 1; }, "waiting for telemetry", 200, 600);
|
||||||
result = getRecordedKeypressCount();
|
result = getRecordedKeypressCount();
|
||||||
ok(result == 2, "Two keypresses recorded");
|
ok(result == 2, "Two keypresses recorded");
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
||||||
|
/* import-globals-from helper_largeAllocation.js */
|
||||||
Services.scriptloader.loadSubScript(testDir + "/helper_largeAllocation.js", this);
|
Services.scriptloader.loadSubScript(testDir + "/helper_largeAllocation.js", this);
|
||||||
|
|
||||||
// Force-enabling the Large-Allocation header
|
// Force-enabling the Large-Allocation header
|
||||||
|
@ -12,7 +12,7 @@ add_task(async function() {
|
|||||||
["dom.ipc.processCount.webLargeAllocation", 20],
|
["dom.ipc.processCount.webLargeAllocation", 20],
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
/* global largeAllocSuccessTests */
|
||||||
await largeAllocSuccessTests();
|
await largeAllocSuccessTests();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -5,74 +5,6 @@ const HELPER_PAGE_ORIGIN = "http://example.com/";
|
|||||||
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
||||||
Services.scriptloader.loadSubScript(testDir + "/helper_localStorage_e10s.js",
|
Services.scriptloader.loadSubScript(testDir + "/helper_localStorage_e10s.js",
|
||||||
this);
|
this);
|
||||||
// Simple tab wrapper abstracting our messaging mechanism;
|
|
||||||
class KnownTab {
|
|
||||||
constructor(name, tab) {
|
|
||||||
this.name = name;
|
|
||||||
this.tab = tab;
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
this.tab = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Simple data structure class to help us track opened tabs and their pids.
|
|
||||||
class KnownTabs {
|
|
||||||
constructor() {
|
|
||||||
this.byPid = new Map();
|
|
||||||
this.byName = new Map();
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
this.byPid = null;
|
|
||||||
this.byName = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open our helper page in a tab in its own content process, asserting that it
|
|
||||||
* really is in its own process. We initially load and wait for about:blank to
|
|
||||||
* load, and only then loadURI to our actual page. This is to ensure that
|
|
||||||
* LocalStorageManager has had an opportunity to be created and populate
|
|
||||||
* mOriginsHavingData.
|
|
||||||
*
|
|
||||||
* (nsGlobalWindow will reliably create LocalStorageManager as a side-effect of
|
|
||||||
* the unconditional call to nsGlobalWindow::PreloadLocalStorage. This will
|
|
||||||
* reliably create the StorageDBChild instance, and its corresponding
|
|
||||||
* StorageDBParent will send the set of origins when it is constructed.)
|
|
||||||
*/
|
|
||||||
async function openTestTabInOwnProcess(name, knownTabs) {
|
|
||||||
let realUrl = HELPER_PAGE_URL + "?" + encodeURIComponent(name);
|
|
||||||
// Load and wait for about:blank.
|
|
||||||
let tab = await BrowserTestUtils.openNewForegroundTab({
|
|
||||||
gBrowser, opening: "about:blank", forceNewProcess: true,
|
|
||||||
});
|
|
||||||
let pid = tab.linkedBrowser.frameLoader.tabParent.osPid;
|
|
||||||
ok(!knownTabs.byName.has(name), "tab needs its own name: " + name);
|
|
||||||
ok(!knownTabs.byPid.has(pid), "tab needs to be in its own process: " + pid);
|
|
||||||
|
|
||||||
let knownTab = new KnownTab(name, tab);
|
|
||||||
knownTabs.byPid.set(pid, knownTab);
|
|
||||||
knownTabs.byName.set(name, knownTab);
|
|
||||||
|
|
||||||
// Now trigger the actual load of our page.
|
|
||||||
BrowserTestUtils.loadURI(tab.linkedBrowser, realUrl);
|
|
||||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
|
||||||
is(tab.linkedBrowser.frameLoader.tabParent.osPid, pid, "still same pid");
|
|
||||||
return knownTab;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close all the tabs we opened.
|
|
||||||
*/
|
|
||||||
async function cleanupTabs(knownTabs) {
|
|
||||||
for (let knownTab of knownTabs.byName.values()) {
|
|
||||||
BrowserTestUtils.removeTab(knownTab.tab);
|
|
||||||
knownTab.cleanup();
|
|
||||||
}
|
|
||||||
knownTabs.cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait for a LocalStorage flush to occur. This notification can occur as a
|
* Wait for a LocalStorage flush to occur. This notification can occur as a
|
||||||
@ -81,6 +13,9 @@ async function cleanupTabs(knownTabs) {
|
|||||||
* - InsertDBOp seeing a preload op for an origin with outstanding changes.
|
* - InsertDBOp seeing a preload op for an origin with outstanding changes.
|
||||||
* - Us generating a "domstorage-test-flush-force" observer notification.
|
* - Us generating a "domstorage-test-flush-force" observer notification.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* import-globals-from helper_localStorage_e10s.js */
|
||||||
|
|
||||||
function waitForLocalStorageFlush() {
|
function waitForLocalStorageFlush() {
|
||||||
if (Services.lsm.nextGenLocalStorageEnabled) {
|
if (Services.lsm.nextGenLocalStorageEnabled) {
|
||||||
return new Promise(resolve => executeSoon(resolve));
|
return new Promise(resolve => executeSoon(resolve));
|
||||||
|
@ -2,6 +2,8 @@ const HELPER_PAGE_URL =
|
|||||||
"http://example.com/browser/dom/tests/browser/page_localstorage_snapshotting_e10s.html";
|
"http://example.com/browser/dom/tests/browser/page_localstorage_snapshotting_e10s.html";
|
||||||
const HELPER_PAGE_ORIGIN = "http://example.com/";
|
const HELPER_PAGE_ORIGIN = "http://example.com/";
|
||||||
|
|
||||||
|
/* import-globals-from helper_localStorage_e10s.js */
|
||||||
|
|
||||||
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
||||||
Services.scriptloader.loadSubScript(testDir + "/helper_localStorage_e10s.js",
|
Services.scriptloader.loadSubScript(testDir + "/helper_localStorage_e10s.js",
|
||||||
this);
|
this);
|
||||||
@ -94,7 +96,7 @@ add_task(async function() {
|
|||||||
// Enable LocalStorage's testing API so we can explicitly create
|
// Enable LocalStorage's testing API so we can explicitly create
|
||||||
// snapshots when needed.
|
// snapshots when needed.
|
||||||
["dom.storage.testing", true],
|
["dom.storage.testing", true],
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure that there is no localstorage data by forcing the origin to be
|
// Ensure that there is no localstorage data by forcing the origin to be
|
||||||
@ -120,7 +122,7 @@ add_task(async function() {
|
|||||||
["key5", "initial5"],
|
["key5", "initial5"],
|
||||||
["key6", "initial6"],
|
["key6", "initial6"],
|
||||||
["key7", "initial7"],
|
["key7", "initial7"],
|
||||||
["key8", "initial8"]
|
["key8", "initial8"],
|
||||||
];
|
];
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
@ -130,11 +132,10 @@ add_task(async function() {
|
|||||||
key5: "initial5",
|
key5: "initial5",
|
||||||
key6: "initial6",
|
key6: "initial6",
|
||||||
key7: "initial7",
|
key7: "initial7",
|
||||||
key8: "initial8"
|
key8: "initial8",
|
||||||
};
|
};
|
||||||
|
|
||||||
function getPartialPrefill()
|
function getPartialPrefill() {
|
||||||
{
|
|
||||||
let size = 0;
|
let size = 0;
|
||||||
let entries = Object.entries(initialState);
|
let entries = Object.entries(initialState);
|
||||||
for (let i = 0; i < entries.length / 2; i++) {
|
for (let i = 0; i < entries.length / 2; i++) {
|
||||||
@ -147,7 +148,7 @@ add_task(async function() {
|
|||||||
const prefillValues = [
|
const prefillValues = [
|
||||||
0, // no prefill
|
0, // no prefill
|
||||||
getPartialPrefill(), // partial prefill
|
getPartialPrefill(), // partial prefill
|
||||||
-1 // full prefill
|
-1, // full prefill
|
||||||
];
|
];
|
||||||
|
|
||||||
for (let prefillValue of prefillValues) {
|
for (let prefillValue of prefillValues) {
|
||||||
@ -155,8 +156,8 @@ add_task(async function() {
|
|||||||
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [
|
||||||
["dom.storage.snapshot_prefill", prefillValue]
|
["dom.storage.snapshot_prefill", prefillValue],
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
info("Stage 1");
|
info("Stage 1");
|
||||||
@ -171,7 +172,7 @@ add_task(async function() {
|
|||||||
["key6", "setRemove16"],
|
["key6", "setRemove16"],
|
||||||
["key7", "setRemove17"],
|
["key7", "setRemove17"],
|
||||||
["key8", null],
|
["key8", null],
|
||||||
["key9", "setRemove19"]
|
["key9", "setRemove19"],
|
||||||
];
|
];
|
||||||
|
|
||||||
const setRemoveState1 = {
|
const setRemoveState1 = {
|
||||||
@ -182,7 +183,7 @@ add_task(async function() {
|
|||||||
key5: "setRemove15",
|
key5: "setRemove15",
|
||||||
key6: "setRemove16",
|
key6: "setRemove16",
|
||||||
key7: "setRemove17",
|
key7: "setRemove17",
|
||||||
key9: "setRemove19"
|
key9: "setRemove19",
|
||||||
};
|
};
|
||||||
|
|
||||||
const setRemoveMutations2 = [
|
const setRemoveMutations2 = [
|
||||||
@ -195,7 +196,7 @@ add_task(async function() {
|
|||||||
["key6", "setRemove26"],
|
["key6", "setRemove26"],
|
||||||
["key7", null],
|
["key7", null],
|
||||||
["key8", "setRemove28"],
|
["key8", "setRemove28"],
|
||||||
["key9", "setRemove29"]
|
["key9", "setRemove29"],
|
||||||
];
|
];
|
||||||
|
|
||||||
const setRemoveState2 = {
|
const setRemoveState2 = {
|
||||||
@ -206,7 +207,7 @@ add_task(async function() {
|
|||||||
key5: "setRemove25",
|
key5: "setRemove25",
|
||||||
key6: "setRemove26",
|
key6: "setRemove26",
|
||||||
key8: "setRemove28",
|
key8: "setRemove28",
|
||||||
key9: "setRemove29"
|
key9: "setRemove29",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Apply initial mutations using an explicit snapshot. The explicit
|
// Apply initial mutations using an explicit snapshot. The explicit
|
||||||
@ -259,7 +260,7 @@ add_task(async function() {
|
|||||||
const setRemoveClearMutations1 = [
|
const setRemoveClearMutations1 = [
|
||||||
["key0", "setRemoveClear10"],
|
["key0", "setRemoveClear10"],
|
||||||
["key1", null],
|
["key1", null],
|
||||||
[null, null]
|
[null, null],
|
||||||
];
|
];
|
||||||
|
|
||||||
const setRemoveClearState1 = {
|
const setRemoveClearState1 = {
|
||||||
@ -268,7 +269,7 @@ add_task(async function() {
|
|||||||
const setRemoveClearMutations2 = [
|
const setRemoveClearMutations2 = [
|
||||||
["key8", null],
|
["key8", null],
|
||||||
["key9", "setRemoveClear29"],
|
["key9", "setRemoveClear29"],
|
||||||
[null, null]
|
[null, null],
|
||||||
];
|
];
|
||||||
|
|
||||||
const setRemoveClearState2 = {
|
const setRemoveClearState2 = {
|
||||||
@ -318,7 +319,7 @@ add_task(async function() {
|
|||||||
["key5", "initial5"],
|
["key5", "initial5"],
|
||||||
["key3", "initial3"],
|
["key3", "initial3"],
|
||||||
["key2", "initial2"],
|
["key2", "initial2"],
|
||||||
["key1", "initial1"]
|
["key1", "initial1"],
|
||||||
];
|
];
|
||||||
|
|
||||||
// Apply initial mutations using an explicit snapshot. The explicit
|
// Apply initial mutations using an explicit snapshot. The explicit
|
||||||
|
@ -12,7 +12,7 @@ function awaitAndClosePrompt() {
|
|||||||
Services.obs.addObserver(onDialogShown, "tabmodal-dialog-loaded");
|
Services.obs.addObserver(onDialogShown, "tabmodal-dialog-loaded");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/* global messageManager */
|
||||||
let lastMessageReceived = "";
|
let lastMessageReceived = "";
|
||||||
function waitForMessage(message) {
|
function waitForMessage(message) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -115,7 +115,6 @@ function prepareForResult(aBrowser, aExpectation) {
|
|||||||
await BrowserTestUtils.loadURI(aBrowser, kContentDoc);
|
await BrowserTestUtils.loadURI(aBrowser, kContentDoc);
|
||||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||||
})();
|
})();
|
||||||
break;
|
|
||||||
case kNewWin:
|
case kNewWin:
|
||||||
return (async function() {
|
return (async function() {
|
||||||
let newWin = await BrowserTestUtils.waitForNewWindow({url: expectedSpec});
|
let newWin = await BrowserTestUtils.waitForNewWindow({url: expectedSpec});
|
||||||
@ -123,7 +122,6 @@ function prepareForResult(aBrowser, aExpectation) {
|
|||||||
is(newBrowser.currentURI.spec, expectedSpec, "Should be at dummy.html");
|
is(newBrowser.currentURI.spec, expectedSpec, "Should be at dummy.html");
|
||||||
await BrowserTestUtils.closeWindow(newWin);
|
await BrowserTestUtils.closeWindow(newWin);
|
||||||
})();
|
})();
|
||||||
break;
|
|
||||||
case kNewTab:
|
case kNewTab:
|
||||||
return (async function() {
|
return (async function() {
|
||||||
let newTab = await BrowserTestUtils.waitForNewTab(gBrowser);
|
let newTab = await BrowserTestUtils.waitForNewTab(gBrowser);
|
||||||
@ -131,13 +129,10 @@ function prepareForResult(aBrowser, aExpectation) {
|
|||||||
"Should be at dummy.html");
|
"Should be at dummy.html");
|
||||||
BrowserTestUtils.removeTab(newTab);
|
BrowserTestUtils.removeTab(newTab);
|
||||||
})();
|
})();
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ok(false, "prepareForResult can't handle an expectation of " + aExpectation);
|
ok(false, "prepareForResult can't handle an expectation of " + aExpectation);
|
||||||
return;
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return deferred.promise;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +11,7 @@ add_task(async function testNotActivated() {
|
|||||||
// we call requestPerformanceMetrics()
|
// we call requestPerformanceMetrics()
|
||||||
let failed = false;
|
let failed = false;
|
||||||
try {
|
try {
|
||||||
let promise = await ChromeUtils.requestPerformanceMetrics();
|
await ChromeUtils.requestPerformanceMetrics();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,7 @@ var sandboxCode = (function() {
|
|||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
let appShell = Cc["@mozilla.org/appshell/appShellService;1"]
|
let appShell = Services.appShell;
|
||||||
.getService(Ci.nsIAppShellService);
|
|
||||||
let doc = appShell.hiddenDOMWindow.document;
|
let doc = appShell.hiddenDOMWindow.document;
|
||||||
let frame = doc.createElement("iframe");
|
let frame = doc.createElement("iframe");
|
||||||
frame.setAttribute("type", "content");
|
frame.setAttribute("type", "content");
|
||||||
|
@ -6,7 +6,7 @@ const TEST_URI = "http://example.com/browser/dom/tests/browser/test_largeAllocat
|
|||||||
const TEST_URI_2 = "http://example.com/browser/dom/tests/browser/test_largeAllocation2.html";
|
const TEST_URI_2 = "http://example.com/browser/dom/tests/browser/test_largeAllocation2.html";
|
||||||
|
|
||||||
function expectProcessCreated() {
|
function expectProcessCreated() {
|
||||||
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
let os = Services.obs;
|
||||||
let kill; // A kill function which will disable the promise.
|
let kill; // A kill function which will disable the promise.
|
||||||
let promise = new Promise((resolve, reject) => {
|
let promise = new Promise((resolve, reject) => {
|
||||||
let topic = "ipc:content-created";
|
let topic = "ipc:content-created";
|
||||||
@ -27,7 +27,7 @@ function expectProcessCreated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function expectNoProcess() {
|
function expectNoProcess() {
|
||||||
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
let os = Services.obs;
|
||||||
let topic = "ipc:content-created";
|
let topic = "ipc:content-created";
|
||||||
function observer() {
|
function observer() {
|
||||||
ok(false, "A process was created!");
|
ok(false, "A process was created!");
|
||||||
@ -40,9 +40,7 @@ function expectNoProcess() {
|
|||||||
|
|
||||||
function getPID(aBrowser) {
|
function getPID(aBrowser) {
|
||||||
return ContentTask.spawn(aBrowser, null, () => {
|
return ContentTask.spawn(aBrowser, null, () => {
|
||||||
const appinfo = Cc["@mozilla.org/xre/app-info;1"]
|
return Services.appinfo.processID;
|
||||||
.getService(Ci.nsIXULRuntime);
|
|
||||||
return appinfo.processID;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +101,7 @@ async function largeAllocSuccessTests() {
|
|||||||
let stopExpectNoProcess = expectNoProcess();
|
let stopExpectNoProcess = expectNoProcess();
|
||||||
|
|
||||||
await ContentTask.spawn(aBrowser, TEST_URI, TEST_URI => {
|
await ContentTask.spawn(aBrowser, TEST_URI, TEST_URI => {
|
||||||
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
content.document.body.innerHTML = `<iframe src='${TEST_URI}'></iframe>`;
|
content.document.body.innerHTML = `<iframe src='${TEST_URI}'></iframe>`;
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
@ -182,7 +181,6 @@ async function largeAllocSuccessTests() {
|
|||||||
|
|
||||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||||
|
|
||||||
let pid3 = await getPID(aBrowser);
|
|
||||||
|
|
||||||
// We should have been kicked out of the large-allocation process by the
|
// We should have been kicked out of the large-allocation process by the
|
||||||
// load, meaning we're back in a non-fresh process
|
// load, meaning we're back in a non-fresh process
|
||||||
|
@ -40,10 +40,10 @@ class KnownTabs {
|
|||||||
* StorageDBParent will send the set of origins when it is constructed.)
|
* StorageDBParent will send the set of origins when it is constructed.)
|
||||||
*/
|
*/
|
||||||
async function openTestTabInOwnProcess(helperPageUrl, name, knownTabs) {
|
async function openTestTabInOwnProcess(helperPageUrl, name, knownTabs) {
|
||||||
let realUrl = helperPageUrl + '?' + encodeURIComponent(name);
|
let realUrl = helperPageUrl + "?" + encodeURIComponent(name);
|
||||||
// Load and wait for about:blank.
|
// Load and wait for about:blank.
|
||||||
let tab = await BrowserTestUtils.openNewForegroundTab({
|
let tab = await BrowserTestUtils.openNewForegroundTab({
|
||||||
gBrowser, opening: 'about:blank', forceNewProcess: true
|
gBrowser, opening: "about:blank", forceNewProcess: true,
|
||||||
});
|
});
|
||||||
let pid = tab.linkedBrowser.frameLoader.tabParent.osPid;
|
let pid = tab.linkedBrowser.frameLoader.tabParent.osPid;
|
||||||
ok(!knownTabs.byName.has(name), "tab needs its own name: " + name);
|
ok(!knownTabs.byName.has(name), "tab needs its own name: " + name);
|
||||||
|
@ -70,7 +70,6 @@ add_task(async function test() {
|
|||||||
let isTopLevel = false;
|
let isTopLevel = false;
|
||||||
let aboutMemoryFound = false;
|
let aboutMemoryFound = false;
|
||||||
let parentProcessEvent = false;
|
let parentProcessEvent = false;
|
||||||
let workerEvent = false;
|
|
||||||
let subFrameIds = [];
|
let subFrameIds = [];
|
||||||
let topLevelIds = [];
|
let topLevelIds = [];
|
||||||
let sharedWorker = false;
|
let sharedWorker = false;
|
||||||
@ -108,7 +107,6 @@ add_task(async function test() {
|
|||||||
parentProcessEvent = true;
|
parentProcessEvent = true;
|
||||||
}
|
}
|
||||||
if (entry.isWorker) {
|
if (entry.isWorker) {
|
||||||
workerEvent = true;
|
|
||||||
workerDuration += entry.duration;
|
workerDuration += entry.duration;
|
||||||
} else {
|
} else {
|
||||||
duration += entry.duration;
|
duration += entry.duration;
|
||||||
|
@ -5,10 +5,12 @@
|
|||||||
var result = null;
|
var result = null;
|
||||||
|
|
||||||
function handlePosition(position) {
|
function handlePosition(position) {
|
||||||
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
result.innerHTML = position.coords.latitude + " " + position.coords.longitude;
|
result.innerHTML = position.coords.latitude + " " + position.coords.longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleError(error) {
|
function handleError(error) {
|
||||||
|
// eslint-disable-next-line no-unsanitized/property
|
||||||
result.innerHTML = error.message;
|
result.innerHTML = error.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
aEvent.preventDefault();
|
aEvent.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}, {once: true});
|
}, {once: true});
|
||||||
|
|
||||||
let form = document.getElementById("form");
|
let form = document.getElementById("form");
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
|
let onconnect = function(e) {
|
||||||
onconnect = function(e) {
|
|
||||||
var port = e.ports[0];
|
var port = e.ports[0];
|
||||||
|
|
||||||
port.onmessage = function(e) {
|
port.onmessage = function(e) {
|
||||||
var workerResult = "Result: " + (e.data[0] * e.data[1]);
|
|
||||||
port.postMessage(e.data[0]);
|
port.postMessage(e.data[0]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
return a + "c";
|
return a + "c";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* global foobar585956c */
|
||||||
function foobar585956b(a) {
|
function foobar585956b(a) {
|
||||||
return foobar585956c(a + "b");
|
return foobar585956c(a + "b");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user