Bug 1101999 - Fix/add UITour highlighting for the new search UI. r=florian
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 20 Nov 2014 12:13:21 -0800
changeset 242162 c922c2fb6cf8ce9914863bdd87b4a5a682d110e7
parent 242161 7c408a498d6c89ef4a1e5a5bfd7114d569e4f0f7
child 242163 6bcf7110d616fdf560cc1ae2df9a58950be6f16e
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1101999
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1101999 - Fix/add UITour highlighting for the new search UI. r=florian
browser/modules/UITour.jsm
browser/modules/test/browser_UITour_availableTargets.js
browser/modules/test/browser_UITour_panel_close_annotation.js
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -123,22 +123,59 @@ this.UITour = {
     ["quit",        {query: "#PanelUI-quit"}],
     ["search",      {
       query: "#searchbar",
       widgetName: "search-container",
     }],
     ["searchProvider", {
       query: (aDocument) => {
         let searchbar = aDocument.getElementById("searchbar");
+        if (searchbar.hasAttribute("oneoffui")) {
+          return null;
+        }
         return aDocument.getAnonymousElementByAttribute(searchbar,
                                                         "anonid",
                                                         "searchbar-engine-button");
       },
       widgetName: "search-container",
     }],
+    ["searchIcon", {
+      query: (aDocument) => {
+        let searchbar = aDocument.getElementById("searchbar");
+        if (!searchbar.hasAttribute("oneoffui")) {
+          return null;
+        }
+        return aDocument.getAnonymousElementByAttribute(searchbar,
+                                                        "anonid",
+                                                        "searchbar-search-button");
+      },
+      widgetName: "search-container",
+    }],
+    ["searchPrefsLink", {
+      query: (aDocument) => {
+        let element = null;
+        let searchbar = aDocument.getElementById("searchbar");
+        if (searchbar.hasAttribute("oneoffui")) {
+          let popup = aDocument.getElementById("PopupSearchAutoComplete");
+          if (popup.state != "open")
+            return null;
+          element = aDocument.getAnonymousElementByAttribute(popup,
+                                                             "anonid",
+                                                             "search-settings");
+        } else {
+          element = aDocument.getAnonymousElementByAttribute(searchbar,
+                                                             "anonid",
+                                                             "open-engine-manager");
+        }
+        if (!element || !UITour.isElementVisible(element)) {
+          return null;
+        }
+        return element;
+      },
+    }],
     ["selectedTabIcon", {
       query: (aDocument) => {
         let selectedtab = aDocument.defaultView.gBrowser.selectedTab;
         let element = aDocument.getAnonymousElementByAttribute(selectedtab,
                                                                "anonid",
                                                                "tab-icon-image");
         if (!element || !UITour.isElementVisible(element)) {
           return null;
--- a/browser/modules/test/browser_UITour_availableTargets.js
+++ b/browser/modules/test/browser_UITour_availableTargets.js
@@ -36,17 +36,17 @@ let tests = [
         "help",
         "home",
         "loop",
         "devtools",
         "pinnedTab",
         "privateWindow",
         "quit",
         "search",
-        "searchProvider",
+        "searchIcon",
         "urlbar",
         ...searchEngineTargets(),
         ...(hasWebIDE ? ["webide"] : [])
       ]);
 
       ok(UITour.availableTargetsCache.has(window),
          "Targets should now be cached");
       done();
@@ -67,17 +67,17 @@ let tests = [
         "help",
         "loop",
         "devtools",
         "home",
         "pinnedTab",
         "privateWindow",
         "quit",
         "search",
-        "searchProvider",
+        "searchIcon",
         "urlbar",
         ...searchEngineTargets(),
         ...(hasWebIDE ? ["webide"] : [])
       ]);
 
       ok(UITour.availableTargetsCache.has(window),
          "Targets should now be cached again");
       CustomizableUI.reset();
@@ -87,17 +87,17 @@ let tests = [
     });
   },
 
   function test_availableTargets_exceptionFromGetTarget(done) {
     // The query function for the "search" target will throw if it's not found.
     // Make sure the callback still fires with the other available targets.
     CustomizableUI.removeWidgetFromArea("search-container");
     gContentAPI.getConfiguration("availableTargets", (data) => {
-      // Default minus "search" and "searchProvider"
+      // Default minus "search" and "searchProvider" and "searchIcon"
       ok_targets(data, [
         "accountStatus",
         "addons",
         "appMenu",
         "backForward",
         "bookmarks",
         "customize",
         "help",
--- a/browser/modules/test/browser_UITour_panel_close_annotation.js
+++ b/browser/modules/test/browser_UITour_panel_close_annotation.js
@@ -55,17 +55,17 @@ let tests = [
         ok(tooltip.state == "showing" || tooltip.state == "open", "The info panel should have remained open");
         done();
       }, "Highlight should have disappeared when panel closed");
     }, "Highlight should be shown after showHighlight() for fixed panel items");
   },
 
   function test_highlight_panel_click_find(done) {
     gContentAPI.showHighlight("help");
-    gContentAPI.showInfo("searchProvider", "test title", "test text");
+    gContentAPI.showInfo("searchIcon", "test title", "test text");
     waitForElementToBeVisible(highlight, function checkPanelIsOpen() {
       isnot(PanelUI.panel.state, "closed", "Panel should have opened");
 
       // Click the find button which should close the panel.
       let findButton = document.getElementById("find-button");
       EventUtils.synthesizeMouseAtCenter(findButton, {});
       waitForElementToBeHidden(highlight, function checkPanelIsClosed() {
         isnot(PanelUI.panel.state, "open",