Bug 1101999 - Fix/add UITour highlighting for the new search UI. r=florian

This commit is contained in:
Dave Townsend 2014-11-20 12:13:21 -08:00
parent 8730c90560
commit f8901eae35
3 changed files with 41 additions and 4 deletions

View File

@ -128,12 +128,49 @@ this.UITour = {
["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;

View File

@ -41,7 +41,7 @@ let tests = [
"privateWindow",
"quit",
"search",
"searchProvider",
"searchIcon",
"urlbar",
...searchEngineTargets(),
...(hasWebIDE ? ["webide"] : [])
@ -72,7 +72,7 @@ let tests = [
"privateWindow",
"quit",
"search",
"searchProvider",
"searchIcon",
"urlbar",
...searchEngineTargets(),
...(hasWebIDE ? ["webide"] : [])
@ -92,7 +92,7 @@ let tests = [
// 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",

View File

@ -60,7 +60,7 @@ let tests = [
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");