Bug 1401942 - Rename and enable browser_bug664688_sandbox_update_after_navigation.js;r=nchevobbe

MozReview-Commit-ID: FbR1FoUp3qo

--HG--
extra : rebase_source : 77972dde83380bda72bd04e8b168ddf7af91fd82
This commit is contained in:
Julian Descottes 2017-11-29 16:56:18 +01:00
parent b39e9bcc55
commit 59241dd5d2
2 changed files with 43 additions and 53 deletions

View File

@ -384,7 +384,6 @@ skip-if = true # Bug 1401953
[browser_webconsole_repeated_messages_accuracy.js] [browser_webconsole_repeated_messages_accuracy.js]
skip-if = true # Bug 1403450 skip-if = true # Bug 1403450
[browser_webconsole_sandbox_update_after_navigation.js] [browser_webconsole_sandbox_update_after_navigation.js]
skip-if = true # Bug 1401942
[browser_webconsole_script_errordoc_urls.js] [browser_webconsole_script_errordoc_urls.js]
skip-if = true # Bug 1403454 skip-if = true # Bug 1403454
# old console skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s # old console skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s

View File

@ -9,68 +9,50 @@
"use strict"; "use strict";
add_task(function* () { const BASE_URI = "browser/devtools/client/webconsole/" +
const TEST_URI1 = "http://example.com/browser/devtools/client/webconsole/" + "new-console-output/test/mochitest/test-console.html";
"test/test-console.html"; const TEST_URI1 = "http://example.com/" + BASE_URI;
const TEST_URI2 = "http://example.org/browser/devtools/client/webconsole/" + const TEST_URI2 = "http://example.org/" + BASE_URI;
"test/test-console.html";
yield loadTab(TEST_URI1); add_task(async function () {
let hud = yield openConsole(); pushPref("devtools.webconsole.persistlog", false);
let hud = await openNewTabAndConsole(TEST_URI1);
let onMessages = waitForMessages({
hud,
messages: [
{ text: "window.location.href" },
{ text: TEST_URI1 },
],
});
hud.jsterm.clearOutput();
hud.jsterm.execute("window.location.href"); hud.jsterm.execute("window.location.href");
info("wait for window.location.href"); info("wait for window.location.href");
await onMessages;
let msgForLocation1 = {
webconsole: hud,
messages: [
{
name: "window.location.href jsterm input",
text: "window.location.href",
category: CATEGORY_INPUT,
},
{
name: "window.location.href result is displayed",
text: TEST_URI1,
category: CATEGORY_OUTPUT,
},
],
};
yield waitForMessages(msgForLocation1);
// load second url // load second url
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI2); BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI2);
yield loadBrowser(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
is(hud.outputNode.textContent.indexOf("Permission denied"), -1, ok(!findMessage(hud, "Permission denied"), "no permission denied errors");
"no permission denied errors");
onMessages = waitForMessages({
hud,
messages: [
{ text: "window.location.href" },
{ text: TEST_URI2 },
],
});
hud.jsterm.clearOutput(); hud.jsterm.clearOutput();
hud.jsterm.execute("window.location.href"); hud.jsterm.execute("window.location.href");
info("wait for window.location.href after page navigation"); info("wait for window.location.href after page navigation");
await onMessages;
yield waitForMessages({ ok(!findMessage(hud, "Permission denied"), "no permission denied errors");
webconsole: hud,
messages: [
{
name: "window.location.href jsterm input",
text: "window.location.href",
category: CATEGORY_INPUT,
},
{
name: "window.location.href result is displayed",
text: TEST_URI2,
category: CATEGORY_OUTPUT,
},
],
});
is(hud.outputNode.textContent.indexOf("Permission denied"), -1,
"no permission denied errors");
// Navigation clears messages. Wait for that clear to happen before // Navigation clears messages. Wait for that clear to happen before
// continuing the test or it might destroy messages we wait later on (Bug // continuing the test or it might destroy messages we wait later on (Bug
@ -79,14 +61,23 @@ add_task(function* () {
gBrowser.goBack(); gBrowser.goBack();
info("Waiting for messages to be cleared due to navigation"); info("Waiting for messages-cleared event due to navigation");
yield cleared; await cleared;
info("Messages cleared after navigation; checking location"); info("Messages cleared after navigation; checking location");
onMessages = waitForMessages({
hud,
messages: [
{ text: "window.location.href" },
{ text: TEST_URI1 },
],
});
hud.jsterm.execute("window.location.href"); hud.jsterm.execute("window.location.href");
info("wait for window.location.href after goBack()"); info("wait for window.location.href after goBack()");
yield waitForMessages(msgForLocation1); await onMessages;
is(hud.outputNode.textContent.indexOf("Permission denied"), -1,
"no permission denied errors"); ok(!findMessage(hud, "Permission denied"), "no permission denied errors");
}); });