michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* ***** BEGIN LICENSE BLOCK ***** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: * michael@0: * Contributor(s): michael@0: * Mihai Șucan michael@0: * michael@0: * ***** END LICENSE BLOCK ***** */ michael@0: michael@0: const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 588342"; michael@0: let fm; michael@0: michael@0: function test() { michael@0: fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager); michael@0: addTab(TEST_URI); michael@0: browser.addEventListener("load", function onLoad() { michael@0: browser.removeEventListener("load", onLoad, true); michael@0: openConsole(null, consoleOpened); michael@0: }, true); michael@0: } michael@0: michael@0: function consoleOpened(hud) { michael@0: waitForFocus(function() { michael@0: is(hud.jsterm.inputNode.getAttribute("focused"), "true", michael@0: "jsterm input is focused on web console open"); michael@0: isnot(fm.focusedWindow, content, "content document has no focus"); michael@0: closeConsole(null, consoleClosed); michael@0: }, hud.iframeWindow); michael@0: } michael@0: michael@0: function consoleClosed() { michael@0: is(fm.focusedWindow, browser.contentWindow, michael@0: "content document has focus"); michael@0: michael@0: fm = null; michael@0: finishTest(); michael@0: } michael@0: