browser/devtools/scratchpad/test/browser_scratchpad_open_error_console.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 function test()
michael@0 6 {
michael@0 7 waitForExplicitFinish();
michael@0 8
michael@0 9 gBrowser.selectedTab = gBrowser.addTab();
michael@0 10 gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
michael@0 11 gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
michael@0 12 openScratchpad(runTests);
michael@0 13 }, true);
michael@0 14
michael@0 15 content.location = "data:text/html;charset=utf8,test Scratchpad." +
michael@0 16 "openErrorConsole()";
michael@0 17 }
michael@0 18
michael@0 19 function runTests()
michael@0 20 {
michael@0 21 Services.obs.addObserver(function observer(aSubject) {
michael@0 22 Services.obs.removeObserver(observer, "web-console-created");
michael@0 23 aSubject.QueryInterface(Ci.nsISupportsString);
michael@0 24
michael@0 25 let hud = HUDService.getBrowserConsole();
michael@0 26 ok(hud, "browser console is open");
michael@0 27 is(aSubject.data, hud.hudId, "notification hudId is correct");
michael@0 28
michael@0 29 HUDService.toggleBrowserConsole().then(finish);
michael@0 30 }, "web-console-created", false);
michael@0 31
michael@0 32 let hud = HUDService.getBrowserConsole();
michael@0 33 ok(!hud, "browser console is not open");
michael@0 34 info("wait for the browser console to open from Scratchpad");
michael@0 35
michael@0 36 gScratchpadWindow.Scratchpad.openErrorConsole();
michael@0 37 }

mercurial