Bug 1372309 - fix browser_sync.js and browser_UITour_availableTargets.js to work with photon structure enabled, r?mikedeboer draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 14 Jun 2017 10:18:27 +0100
changeset 594798 6a8d0b956dc064fa51f24c546e6cd0d035c8f6fc
parent 594797 8fe0866fa949baf1059c7d6159211caf29911bbd
child 594799 519cee927e2dbabbc69c0e45683b137f4f969df3
push id64146
push userbmo:gijskruitbosch+bugs@gmail.com
push dateThu, 15 Jun 2017 13:55:41 +0000
reviewersmikedeboer
bugs1372309
milestone56.0a1
Bug 1372309 - fix browser_sync.js and browser_UITour_availableTargets.js to work with photon structure enabled, r?mikedeboer MozReview-Commit-ID: 4bsqWScnRo2
browser/base/content/test/sync/browser_sync.js
browser/components/uitour/test/browser_UITour_availableTargets.js
--- 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, [