browser_focus_after_restore.js (692B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 add_task(async function test() { 5 gURLBar.focus(); 6 is( 7 document.activeElement, 8 gURLBar.inputField, 9 "urlbar is focused before restoring" 10 ); 11 12 await promiseBrowserState({ 13 windows: [ 14 { 15 tabs: [ 16 { 17 entries: [ 18 { 19 url: "http://example.org/", 20 triggeringPrincipal_base64, 21 }, 22 ], 23 }, 24 ], 25 selected: 1, 26 }, 27 ], 28 }); 29 is( 30 document.activeElement, 31 gBrowser.selectedBrowser, 32 "content area is focused after restoring" 33 ); 34 });