Bug 1425454 - The onboarding flow should end up focusing the awesomebar instead of the search box in the page. r=Gijs a=lizzard
authorEd Lee <edilee@mozilla.com>
Mon, 29 Jan 2018 19:28:49 -0800
changeset 454804 7c3d1a48781b90db6ab70a9abeaa4fcd612e581a
parent 454803 286bf1028f5bcfee5b018338c32513ef6f34c4a4
child 454805 a0c5b937edb5cc7a765a26df0ea80a676f42a2df
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, lizzard
bugs1425454
milestone59.0
Bug 1425454 - The onboarding flow should end up focusing the awesomebar instead of the search box in the page. r=Gijs a=lizzard 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");
 });