Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | } |