Bug 1410763 - Backout bug 1390055;r=Fischer

MozReview-Commit-ID: IjbP0niKb1z

--HG--
extra : rebase_source : 466bd14ec57f7878c34870b046312b0f9eaac631
This commit is contained in:
gasolin 2017-10-24 13:39:26 +08:00
Родитель 209f32ada1
Коммит e2b61dee10
2 изменённых файлов: 2 добавлений и 50 удалений

Просмотреть файл

@ -115,13 +115,7 @@ this.UITour = {
// to automatically open the appMenu when annotating this target.
widgetName: "appMenu-fxa-label",
}],
["addons", {
query: (aDocument) => {
// select toolbar icon if exist, fallback to appMenu item
let node = aDocument.getElementById("add-ons-button");
return node ? node : aDocument.getElementById("appMenu-addons-button");
},
}],
["addons", {query: "#appMenu-addons-button"}],
["appMenu", {
addTargetListener: (aDocument, aCallback) => {
let panelPopup = aDocument.defaultView.PanelUI.panel;
@ -152,13 +146,7 @@ this.UITour = {
}],
["help", {query: "#appMenu-help-button"}],
["home", {query: "#home-button"}],
["library", {
query: (aDocument) => {
// select toolbar icon if exist, fallback to appMenu item
let node = aDocument.getElementById("library-button");
return node ? node : aDocument.getElementById("appMenu-library-button");
},
}],
["library", {query: "#appMenu-library-button"}],
["pocket", {
allowAdd: true,
query: (aDocument) => {

Просмотреть файл

@ -6,41 +6,7 @@ var gContentWindow;
add_task(setup_UITourTest);
add_UITour_task(async function test_highlight_library_icon_in_toolbar() {
let highlight = document.getElementById("UITourHighlight");
is_element_hidden(highlight, "Highlight should initially be hidden");
// Test highlighting the library button
let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
gContentAPI.showHighlight("library");
await highlightVisiblePromise;
UITour.getTarget(window, "library").then((target) => {
is("library-button", target.node.id, "Should highlight the right target");
});
});
add_UITour_task(async function test_highlight_addons_icon_in_toolbar() {
CustomizableUI.addWidgetToArea("add-ons-button", CustomizableUI.AREA_NAVBAR, 0);
ok(!UITour.availableTargetsCache.has(window),
"Targets should be evicted from cache after widget change");
let highlight = document.getElementById("UITourHighlight");
is_element_hidden(highlight, "Highlight should initially be hidden");
// Test highlighting the addons button on toolbar
let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
gContentAPI.showHighlight("addons");
await highlightVisiblePromise;
UITour.getTarget(window, "addons").then((target) => {
is("add-ons-button", target.node.id, "Should highlight the right target");
CustomizableUI.removeWidgetFromArea("add-ons-button");
});
});
add_UITour_task(async function test_highlight_library_and_show_library_subview() {
CustomizableUI.removeWidgetFromArea("library-button");
ok(!UITour.availableTargetsCache.has(window),
"Targets should be evicted from cache after widget change");
let highlight = document.getElementById("UITourHighlight");
is_element_hidden(highlight, "Highlight should initially be hidden");
@ -71,6 +37,4 @@ add_UITour_task(async function test_highlight_library_and_show_library_subview()
gContentAPI.hideMenu("appMenu");
await appMenuHiddenPromise;
is(appMenu.state, "closed", "Should close the app menu");
CustomizableUI.addWidgetToArea("library", CustomizableUI.AREA_NAVBAR, 0);
});