Bug 1246460 - re-add pocket bookmarks button menuitem now that its original insertion point is gone, r=MattN
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 08 Feb 2016 10:08:43 +0000
changeset 329836 e0be6880f8e00767529ba5562ae862b7f29d66c2
parent 329835 1aca4f26143989f5491d94a51390de20fca8f76a
child 329837 a5daf170c09a2cb138a3edcba915e7b2037cbeae
push id10617
push userdtownsend@mozilla.com
push dateTue, 09 Feb 2016 16:30:19 +0000
reviewersMattN
bugs1246460
milestone47.0a1
Bug 1246460 - re-add pocket bookmarks button menuitem now that its original insertion point is gone, r=MattN
browser/extensions/pocket/bootstrap.js
browser/extensions/pocket/moz.build
browser/extensions/pocket/test/browser.ini
browser/extensions/pocket/test/browser_pocket_ui_check.js
--- a/browser/extensions/pocket/bootstrap.js
+++ b/browser/extensions/pocket/bootstrap.js
@@ -417,17 +417,17 @@ var PocketOverlay = {
       let sep = createElementWithAttrs(document, "menuseparator", {
         "id": "menu_pocketSeparator"
       });
       sib.parentNode.insertBefore(menu, sib);
       sib.parentNode.insertBefore(sep, sib);
     }
 
     // add to bookmarks-menu-button
-    sib = document.getElementById("BMB_subscribeToPageMenuitem");
+    sib = document.getElementById("BMB_bookmarksToolbar");
     if (sib && !document.getElementById("BMB_pocket")) {
       let menu = createElementWithAttrs(document, "menuitem", {
         "id": "BMB_pocket",
         "label": gPocketBundle.GetStringFromName("pocketMenuitem.label"),
         "class": "menuitem-iconic bookmark-item subviewbutton",
         "oncommand": "openUILink(Pocket.listURL, event);"
       });
       let sep = createElementWithAttrs(document, "menuseparator", {
--- a/browser/extensions/pocket/moz.build
+++ b/browser/extensions/pocket/moz.build
@@ -9,9 +9,11 @@ DIRS += ['locales']
 FINAL_TARGET_FILES.features['firefox@getpocket.com'] += [
   'bootstrap.js'
 ]
 
 FINAL_TARGET_PP_FILES.features['firefox@getpocket.com'] += [
   'install.rdf.in'
 ]
 
+BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
+
 JAR_MANIFESTS += ['jar.mn']
new file mode 100644
--- /dev/null
+++ b/browser/extensions/pocket/test/browser.ini
@@ -0,0 +1,1 @@
+[browser_pocket_ui_check.js]
new file mode 100644
--- /dev/null
+++ b/browser/extensions/pocket/test/browser_pocket_ui_check.js
@@ -0,0 +1,21 @@
+"use strict";
+
+add_task(function*() {
+  let pocketAddon = yield new Promise(resolve => {
+    AddonManager.getAddonByID("firefox@getpocket.com", resolve);
+  });
+  if (!pocketAddon) {
+    ok(true, "Pocket is not installed");
+    return;
+  }
+  if (!Services.prefs.getBoolPref("extensions.pocket.enabled")) {
+    ok(true, "Pocket add-on is not enabled");
+    return;
+  }
+
+  for (let id of ["panelMenu_pocket", "menu_pocket", "BMB_pocket",
+                  "panelMenu_pocketSeparator", "menu_pocketSeparator",
+                  "BMB_pocketSeparator"]) {
+    ok(document.getElementById(id), "Should see element with id " + id);
+  }
+});