Files
firefox/devtools/client/webconsole/test/browser/browser_webconsole_init.js
T
Kris Maglione 8c0d38f33d 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
2019-12-13 20:36:16 +00:00

40 lines
968 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI =
"http://example.com/browser/devtools/client/webconsole/" +
"test/browser/test-console.html";
add_task(async function() {
const hud = await openNewTabAndConsole(TEST_URI);
const { ui } = hud;
ok(ui.jsterm, "jsterm exists");
ok(ui.wrapper, "wrapper exists");
const receievedMessages = waitForMessages({
hud,
messages: [{ text: "19" }],
});
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
content.wrappedJSObject.doLogs(20);
});
await receievedMessages;
const outputContainer = ui.outputNode.querySelector(".webconsole-output");
is(
outputContainer.querySelectorAll(".message.console-api").length,
20,
"Correct number of messages appear"
);
is(
outputContainer.scrollWidth,
outputContainer.clientWidth,
"No horizontal overflow"
);
});