Bug 1425454 - The onboarding flow should end up focusing the awesomebar instead of the search box in the page. r?Gijs
MozReview-Commit-ID: Cu4bpk0ElTZ
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -1491,16 +1491,17 @@ this.UITour = {
aWindow.gURLBar.closePopup();
} else if (aMenuName == "pageActionPanel") {
aWindow.BrowserPageActions.panelNode.hidePopup();
}
},
showNewTab(aWindow, aBrowser) {
aWindow.openLinkIn("about:newtab", "current", {targetBrowser: aBrowser});
+ aWindow.gURLBar.focus();
},
_hideAnnotationsForPanel(aEvent, aShouldClosePanel, aTargetPositionCallback) {
let win = aEvent.target.ownerGlobal;
let hideHighlightMethod = null;
let hideInfoMethod = null;
if (aShouldClosePanel) {
hideHighlightMethod = aWin => this.hideHighlight(aWin);
--- a/browser/components/uitour/test/browser_UITour_showNewTab.js
+++ b/browser/components/uitour/test/browser_UITour_showNewTab.js
@@ -9,9 +9,10 @@ add_task(setup_UITourTest);
// Test that we can switch to about:newtab
add_UITour_task(async function test_aboutNewTab() {
let newTabLoaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, "about:newtab");
info("Showing about:newtab");
await gContentAPI.showNewTab();
info("Waiting for about:newtab to load");
await newTabLoaded;
is(gBrowser.selectedBrowser.currentURI.spec, "about:newtab", "Loaded about:newtab");
+ ok(gURLBar.focused, "Address bar gets focus");
});