mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-12 23:12:21 +00:00
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:
parent
525200b457
commit
d4835402f9
@ -115,7 +115,13 @@ this.UITour = {
|
|||||||
// to automatically open the appMenu when annotating this target.
|
// to automatically open the appMenu when annotating this target.
|
||||||
widgetName: "appMenu-fxa-label",
|
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", {
|
["appMenu", {
|
||||||
addTargetListener: (aDocument, aCallback) => {
|
addTargetListener: (aDocument, aCallback) => {
|
||||||
let panelPopup = aDocument.defaultView.PanelUI.panel;
|
let panelPopup = aDocument.defaultView.PanelUI.panel;
|
||||||
@ -146,7 +152,13 @@ this.UITour = {
|
|||||||
}],
|
}],
|
||||||
["help", {query: "#appMenu-help-button"}],
|
["help", {query: "#appMenu-help-button"}],
|
||||||
["home", {query: "#home-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", {
|
["pocket", {
|
||||||
allowAdd: true,
|
allowAdd: true,
|
||||||
query: (aDocument) => {
|
query: (aDocument) => {
|
||||||
|
@ -6,7 +6,41 @@ var gContentWindow;
|
|||||||
|
|
||||||
add_task(setup_UITourTest);
|
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() {
|
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");
|
let highlight = document.getElementById("UITourHighlight");
|
||||||
is_element_hidden(highlight, "Highlight should initially be hidden");
|
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");
|
gContentAPI.hideMenu("appMenu");
|
||||||
await appMenuHiddenPromise;
|
await appMenuHiddenPromise;
|
||||||
is(appMenu.state, "closed", "Should close the app menu");
|
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;
|
await highlightOpenPromise;
|
||||||
is(highlight.state, "open", "Should show UITour highlight");
|
is(highlight.state, "open", "Should show UITour highlight");
|
||||||
is(highlight.getAttribute("targetName"), "library", "UITour should highlight library");
|
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);
|
await BrowserTestUtils.removeTab(tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user