Bug 1372309 - fix browser_sync.js and browser_UITour_availableTargets.js to work with photon structure enabled, r?mikedeboer
MozReview-Commit-ID: 4bsqWScnRo2
--- a/browser/base/content/test/sync/browser_sync.js
+++ b/browser/base/content/test/sync/browser_sync.js
@@ -47,17 +47,18 @@ add_task(async function test_ui_state_sy
displayName: "Foo Bar",
avatarURL: "https://foo.bar",
lastSync: new Date(),
syncing: true
};
gSync.updateAllUI(state);
- checkSyncNowButton("PanelUI-fxa-icon", true);
+ let prefix = gPhotonStructure ? "appMenu" : "PanelUI";
+ checkSyncNowButton(`${prefix}-fxa-icon`, true);
checkSyncNowButton("PanelUI-remotetabs-syncnow", true);
// Be good citizens and remove the "syncing" state.
gSync.updateAllUI({
status: UIState.STATUS_SIGNED_IN,
email: "foo@bar.com",
lastSync: new Date(),
syncing: false
@@ -188,17 +189,17 @@ function checkMenuBarItem(expectedShownI
function checkSyncNowButton(buttonId, syncing, tooltip = null) {
const remoteTabsButton = document.getElementById(buttonId);
is(remoteTabsButton.getAttribute("syncstatus"), syncing ? "active" : "", "button active has the right value");
if (tooltip) {
is(remoteTabsButton.getAttribute("tooltiptext"), tooltip, "button tooltiptext is set to the right value");
}
- if (buttonId == "PanelUI-fxa-icon") {
+ if (buttonId.endsWith("-fxa-icon")) {
return;
}
is(remoteTabsButton.hasAttribute("disabled"), syncing, "disabled has the right value");
if (syncing) {
is(remoteTabsButton.getAttribute("label"), gSync.syncStrings.GetStringFromName("syncing2.label"), "label is set to the right value");
} else {
is(remoteTabsButton.getAttribute("label"), gSync.syncStrings.GetStringFromName("syncnow.label"), "label is set to the right value");
--- a/browser/components/uitour/test/browser_UITour_availableTargets.js
+++ b/browser/components/uitour/test/browser_UITour_availableTargets.js
@@ -2,17 +2,17 @@
var gTestTab;
var gContentAPI;
var gContentWindow;
var hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled");
var isPhoton = Services.prefs.getBoolPref("browser.photon.structure.enabled");
var hasQuit = !isPhoton ||
- false; // Update this with AppConstants.platform != "macosx" after bug 1368734 lands;
+ AppConstants.platform != "macosx";
var hasLibrary = isPhoton || false;
requestLongerTimeout(2);
add_task(setup_UITourTest);
add_UITour_task(async function test_availableTargets() {
let data = await getConfigurationPromise("availableTargets");
ok_targets(data, [