diff options
Diffstat (limited to 'devtools/client/webconsole/test/browser/browser_webconsole_init.js')
-rw-r--r-- | devtools/client/webconsole/test/browser/browser_webconsole_init.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_init.js b/devtools/client/webconsole/test/browser/browser_webconsole_init.js new file mode 100644 index 0000000000..a3df830cdd --- /dev/null +++ b/devtools/client/webconsole/test/browser/browser_webconsole_init.js @@ -0,0 +1,39 @@ +/* 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" + ); +}); |