1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_579412_input_focus.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/* vim:set ts=2 sw=2 sts=2 et: */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +// Tests that the input field is focused when the console is opened. 1.10 + 1.11 +const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html"; 1.12 + 1.13 +function test() { 1.14 + addTab(TEST_URI); 1.15 + browser.addEventListener("DOMContentLoaded", testInputFocus, false); 1.16 +} 1.17 + 1.18 +function testInputFocus() { 1.19 + browser.removeEventListener("DOMContentLoaded", testInputFocus, false); 1.20 + 1.21 + openConsole(null, function(hud) { 1.22 + let inputNode = hud.jsterm.inputNode; 1.23 + ok(inputNode.getAttribute("focused"), "input node is focused"); 1.24 + 1.25 + finishTest(); 1.26 + }); 1.27 +} 1.28 +