зеркало из https://github.com/mozilla/gecko-dev.git
merge autoland to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 2Uy29fNzn62
This commit is contained in:
Коммит
dcf34ac4d5
|
@ -224,6 +224,7 @@ this.PageActions = {
|
|||
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);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -109,6 +109,9 @@ add_task(async function simple() {
|
|||
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");
|
||||
|
@ -179,6 +182,29 @@ add_task(async function simple() {
|
|||
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);
|
||||
|
@ -191,6 +217,9 @@ add_task(async function simple() {
|
|||
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(
|
||||
|
|
|
@ -19,6 +19,10 @@ public class testSessionOOMSave extends SessionTest {
|
|||
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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче