зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3397cb95fb95 (bug 1362047) for xpcshell timeouts in test_ext_i18n.js a=backout
MozReview-Commit-ID: Uvq3c8A1Ka
This commit is contained in:
Родитель
008dfae77d
Коммит
ed1be45aae
|
@ -50,10 +50,6 @@ add_task(async function testExecuteScript() {
|
|||
// Send the executeScript requests in the reverse order that we expect
|
||||
// them to execute in, to avoid them passing only because of timing
|
||||
// races.
|
||||
browser.tabs.executeScript({
|
||||
code: "document.readyState",
|
||||
// Testing default `runAt`.
|
||||
}),
|
||||
browser.tabs.executeScript({
|
||||
code: "document.readyState",
|
||||
runAt: "document_idle",
|
||||
|
@ -81,8 +77,7 @@ add_task(async function testExecuteScript() {
|
|||
// Otherwise, try again.
|
||||
success = (states[0] == "loading" &&
|
||||
states[1] == "interactive" &&
|
||||
states[2] == "complete" &&
|
||||
states[3] == "complete");
|
||||
states[2] == "complete");
|
||||
}
|
||||
|
||||
browser.test.assertTrue(success, "Got the earliest expected states at least once");
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
"runAt": {
|
||||
"$ref": "RunAt",
|
||||
"optional": true,
|
||||
"default": "document_idle",
|
||||
"description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
|
||||
},
|
||||
"cssOrigin": {
|
||||
|
|
|
@ -362,7 +362,6 @@
|
|||
"run_at": {
|
||||
"$ref": "extensionTypes.RunAt",
|
||||
"optional": true,
|
||||
"default": "document_idle",
|
||||
"description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ const BASE_URL = `http://localhost:${server.identity.primaryPort}/data`;
|
|||
|
||||
ExtensionTestUtils.mockAppInfo();
|
||||
|
||||
add_task(async function test_contentscript_runAt() {
|
||||
add_task(async function test_contentscript() {
|
||||
function background() {
|
||||
browser.runtime.onMessage.addListener(([msg, expectedStates, readyState], sender) => {
|
||||
if (msg == "chrome-namespace-ok") {
|
||||
|
@ -57,11 +57,6 @@ add_task(async function test_contentscript_runAt() {
|
|||
"js": ["content_script_idle.js"],
|
||||
"run_at": "document_idle",
|
||||
},
|
||||
{
|
||||
"matches": ["http://*/*/file_sample.html"],
|
||||
"js": ["content_script_idle.js"],
|
||||
// Test default `run_at`.
|
||||
},
|
||||
{
|
||||
"matches": ["http://*/*/file_sample.html"],
|
||||
"js": ["content_script.js"],
|
||||
|
@ -88,12 +83,7 @@ add_task(async function test_contentscript_runAt() {
|
|||
extension.onMessage("script-run-interactive", () => { interactiveCount++; });
|
||||
|
||||
let completePromise = new Promise(resolve => {
|
||||
extension.onMessage("script-run-complete", () => {
|
||||
completeCount++;
|
||||
if (completeCount > 1) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
extension.onMessage("script-run-complete", () => { completeCount++; resolve(); });
|
||||
});
|
||||
|
||||
let chromeNamespacePromise = extension.awaitMessage("chrome-namespace-ok");
|
||||
|
@ -108,7 +98,7 @@ add_task(async function test_contentscript_runAt() {
|
|||
|
||||
equal(loadingCount, 1, "document_start script ran exactly once");
|
||||
equal(interactiveCount, 1, "document_end script ran exactly once");
|
||||
equal(completeCount, 2, "document_idle script ran exactly twice");
|
||||
equal(completeCount, 1, "document_idle script ran exactly once");
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче