merge autoland to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 10 Sep 2017 23:15:18 +0200
changeset 429446 bf3d75d48631b9bc3da253ee9af55c8d03856598
parent 429440 fd87bb184e299fec695f69bd2977276c25719b98 (current diff)
parent 429445 73ad672a411f900715c6a1fb49c8ffe133f627a2 (diff)
child 429459 a5f163da8a9be5d2e86138c57d59be69723b5457
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge autoland to mozilla-central. r=merge a=merge MozReview-Commit-ID: 2Uy29fNzn62
--- a/browser/modules/PageActions.jsm
+++ b/browser/modules/PageActions.jsm
@@ -219,16 +219,17 @@ this.PageActions = {
       // The action has been seen before.  Override its shownInUrlbar value
       // with the persisted value.  Set the private version of that property
       // so that onActionToggledShownInUrlbar isn't called, which happens when
       // the public version is set.
       action._shownInUrlbar =
         this._persistedActions.idsInUrlbar.includes(action.id);
     } else {
       // The action is new.  Store it in the persisted actions.
+      this._persistedActions.ids.push(action.id);
       this._updateIDsInUrlbarForAction(action);
     }
   },
 
   _updateIDsInUrlbarForAction(action) {
     let index = this._persistedActions.idsInUrlbar.indexOf(action.id);
     if (action.shownInUrlbar) {
       if (index < 0) {
--- a/browser/modules/test/browser/browser_PageActions.js
+++ b/browser/modules/test/browser/browser_PageActions.js
@@ -104,16 +104,19 @@ add_task(async function simple() {
                    "Last page action should be action");
   Assert.equal(PageActions.actions[PageActions.actions.length - 2].id,
                PageActions.ACTION_ID_BUILT_IN_SEPARATOR,
                "2nd-to-last page action should be separator");
 
   Assert.deepEqual(PageActions.actionForID(action.id), action,
                    "actionForID should be action");
 
+  Assert.ok(PageActions._persistedActions.ids.includes(action.id),
+            "PageActions should record action in its list of seen actions");
+
   // The action's panel button should have been created.
   let panelButtonNode = document.getElementById(panelButtonID);
   Assert.notEqual(panelButtonNode, null, "panelButtonNode");
   Assert.equal(panelButtonNode.getAttribute("label"), action.title, "label");
   for (let name in action.nodeAttributes) {
     Assert.ok(panelButtonNode.hasAttribute(name), "Has attribute: " + name);
     Assert.equal(panelButtonNode.getAttribute(name),
                  action.nodeAttributes[name],
@@ -174,28 +177,54 @@ add_task(async function simple() {
   Assert.equal(onCommandCallCount, 2, "onCommandCallCount should be inc'ed");
 
   // Set a new title.
   let newTitle = title + " new title";
   action.title = newTitle;
   Assert.equal(action.title, newTitle, "New title");
   Assert.equal(panelButtonNode.getAttribute("label"), action.title, "New label");
 
+  // Now that shownInUrlbar has been toggled, make sure that it sticks across
+  // app restarts.  Simulate that by "unregistering" the action (not by removing
+  // it, which is more permanent) and then registering it again.
+
+  // unregister
+  PageActions._actionsByID.delete(action.id);
+  let index = PageActions._nonBuiltInActions.findIndex(a => a.id == action.id);
+  Assert.ok(index >= 0, "Action should be in _nonBuiltInActions to begin with");
+  PageActions._nonBuiltInActions.splice(index, 1);
+
+  // register again
+  PageActions._registerAction(action);
+
+  // check relevant properties
+  Assert.ok(PageActions._persistedActions.ids.includes(action.id),
+            "PageActions should have 'seen' the action");
+  Assert.ok(PageActions._persistedActions.idsInUrlbar.includes(action.id),
+            "idsInUrlbar should still include the action");
+  Assert.ok(action.shownInUrlbar,
+            "shownInUrlbar should still be true");
+  Assert.ok(action._shownInUrlbar,
+            "_shownInUrlbar should still be true, for good measure");
+
   // Remove the action.
   action.remove();
   panelButtonNode = document.getElementById(panelButtonID);
   Assert.equal(panelButtonNode, null, "panelButtonNode");
   urlbarButtonNode = document.getElementById(urlbarButtonID);
   Assert.equal(urlbarButtonNode, null, "urlbarButtonNode");
 
   Assert.deepEqual(PageActions.actions, initialActions,
                    "Actions should go back to initial");
   Assert.equal(PageActions.actionForID(action.id), null,
                "actionForID should be null");
 
+  Assert.ok(!PageActions._persistedActions.ids.includes(action.id),
+            "PageActions should remove action from its list of seen actions");
+
   // The separator between the built-in actions and non-built-in actions should
   // be gone now, too.
   let separatorNode = document.getElementById(
     BrowserPageActions._panelButtonNodeIDForActionID(
       PageActions.ACTION_ID_BUILT_IN_SEPARATOR
     )
   );
   Assert.equal(separatorNode, null, "No separator");
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testSessionOOMSave.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testSessionOOMSave.java
@@ -14,16 +14,20 @@ public class testSessionOOMSave extends 
 
     private HomeConfig.Editor mEditor;
     private String mDefaultPanelId;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
 
+        // Having the Activity Stream home panel active during this test seems to cause relatively
+        // frequent intermittent crashes, so for now, we avoid loading it by setting a different
+        // default panel for this test (bug 1396324).
+        // TODO: Remove the workaround once crashes have been fixed (bug 1398532).
         final HomeConfig homeConfig = HomeConfig.getDefault(getInstrumentation().getTargetContext());
         final HomeConfig.State state = homeConfig.load();
         mEditor = state.edit();
         mDefaultPanelId = mEditor.getDefaultPanelId();
         mEditor.setDefault(HomeConfig.getIdForBuiltinPanelType(HomeConfig.PanelType.BOOKMARKS));
         mEditor.apply();
     }