browser_bug832435.js (850B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => { 6 const { UrlbarTestUtils: module } = ChromeUtils.importESModule( 7 "resource://testing-common/UrlbarTestUtils.sys.mjs" 8 ); 9 module.init(this); 10 return module; 11 }); 12 13 add_task(async function test() { 14 gBrowser.selectedBrowser.focus(); 15 await UrlbarTestUtils.inputIntoURLBar( 16 window, 17 "javascript: var foo = '11111111'; " 18 ); 19 ok(gURLBar.focused, "Address bar is focused"); 20 EventUtils.synthesizeKey("VK_RETURN"); 21 22 // javscript: URIs are evaluated async. 23 await new Promise(resolve => SimpleTest.executeSoon(resolve)); 24 ok(true, "Evaluated without crashing"); 25 });