Bug 1460566 - [devtools] Fix intermittent on browser_console_webconsole_iframe_messages.js. r=Honza.

Also the test skipped checking iframe messages in the Browser Console, but it's
been a while since we fixed the issue mentionned there, so we can safely also
test the Browser Console.

Differential Revision: https://phabricator.services.mozilla.com/D138781
This commit is contained in:
Nicolas Chevobbe 2022-02-16 10:47:06 +00:00
Родитель 5ce75066a6
Коммит 7268203455
2 изменённых файлов: 9 добавлений и 18 удалений

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

@ -12,6 +12,8 @@ const TEST_URI =
const expectedMessages = ["main file", "blah", "iframe 2", "iframe 3"];
// This log comes from test-iframe1.html, which is included from test-console-iframes.html
// __and__ from test-iframe3.html as well, so we should see it twice.
const expectedDupedMessage = "iframe 1";
add_task(async function() {
@ -27,8 +29,10 @@ add_task(async function() {
await closeConsole();
info("web console closed");
await pushPref("devtools.browserconsole.contentMessages", true);
hud = await BrowserConsoleManager.toggleBrowserConsole();
await testBrowserConsole(hud);
ok(hud, "browser console opened");
await testMessages(hud);
// clear the browser console.
await clearOutput(hud);
@ -42,21 +46,8 @@ async function testMessages(hud) {
await waitFor(() => findMessage(hud, message));
}
info("first messages matched");
ok(true, "Found expected unique messages");
const messages = await findMessages(hud, expectedDupedMessage);
is(messages.length, 2, `${expectedDupedMessage} is present twice`);
}
async function testBrowserConsole(hud) {
ok(hud, "browser console opened");
// TODO: The browser console doesn't show page's console.log statements
// in e10s windows. See Bug 1241289.
if (Services.appinfo.browserTabsRemoteAutostart) {
todo(false, "Bug 1241289");
return;
}
await testMessages(hud);
await waitFor(() => findMessages(hud, expectedDupedMessage).length == 2);
ok(true, `${expectedDupedMessage} is present twice`);
}

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

@ -4,7 +4,7 @@
<meta charset="utf-8">
<script>
/* eslint-disable */
console.log("iframe 1");
console.log("iframe 1", Date.now());
</script>
</head>
<body>