Bug 1425454 - The onboarding flow should end up focusing the awesomebar instead of the search box in the page. r?Gijs draft
authorEd Lee <edilee@mozilla.com>
Mon, 29 Jan 2018 19:28:49 -0800
changeset 748607 7b9ea4c72f6a18302c6f597d6d6c8e2792a9b966
parent 748520 9a3b6d64a64b328ed0de3d6503b99f20d1c94cfb
push id97216
push userbmo:edilee@mozilla.com
push dateTue, 30 Jan 2018 04:47:05 +0000
reviewersGijs
bugs1425454
milestone60.0a1
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
browser/components/uitour/UITour.jsm
browser/components/uitour/test/browser_UITour_showNewTab.js
--- 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");
 });