michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: ok(true, "Starting up"); michael@0: michael@0: gBrowser.selectedBrowser.focus(); michael@0: gURLBar.addEventListener("focus", function onFocus() { michael@0: gURLBar.removeEventListener("focus", onFocus); michael@0: ok(true, "Invoked onfocus handler"); michael@0: EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }); michael@0: michael@0: // javscript: URIs are evaluated async. michael@0: SimpleTest.executeSoon(function() { michael@0: ok(true, "Evaluated without crashing"); michael@0: finish(); michael@0: }); michael@0: }); michael@0: gURLBar.inputField.value = "javascript: var foo = '11111111'; "; michael@0: gURLBar.focus(); michael@0: }