Backed out changeset bae28f445fad (bug 1410763) for failing browser_onboarding_uitour.js on Win7 debug non-e10s

MozReview-Commit-ID: 3HixjOyzjSg
This commit is contained in:
Phil Ringnalda 2017-10-25 21:43:02 -07:00
Родитель 525200b457
Коммит d4835402f9
3 изменённых файлов: 57 добавлений и 2 удалений

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

@ -115,7 +115,13 @@ this.UITour = {
// to automatically open the appMenu when annotating this target.
widgetName: "appMenu-fxa-label",
}],
["addons", {query: "#appMenu-addons-button"}],
["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");
},
}],
["appMenu", {
addTargetListener: (aDocument, aCallback) => {
let panelPopup = aDocument.defaultView.PanelUI.panel;
@ -146,7 +152,13 @@ this.UITour = {
}],
["help", {query: "#appMenu-help-button"}],
["home", {query: "#home-button"}],
["library", {query: "#appMenu-library-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");
},
}],
["pocket", {
allowAdd: true,
query: (aDocument) => {

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

@ -6,7 +6,41 @@ 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");
@ -37,4 +71,6 @@ 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);
});

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

@ -66,6 +66,13 @@ add_task(async function test_clean_up_uitour_after_closing_overlay() {
await highlightOpenPromise;
is(highlight.state, "open", "Should show UITour highlight");
is(highlight.getAttribute("targetName"), "library", "UITour should highlight library");
// Close the overlay by clicking the skip-tour button
highlightClosePromise = promisePopupChange(highlight, "closed");
BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-skip-tour-btn", {}, tab.linkedBrowser);
await promiseOnboardingOverlayClosed(tab.linkedBrowser);
await highlightClosePromise;
is(highlight.state, "closed", "Should close UITour highlight after closing the overlay by clicking the skip-tour button");
await BrowserTestUtils.removeTab(tab);
});