зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1205286 - Make about:home Sync icon always link to about:preferences#sync r=markh
This commit is contained in:
Родитель
48bb3e0096
Коммит
844ee8a3a2
|
@ -472,15 +472,24 @@ var gTests = [
|
|||
})
|
||||
},
|
||||
{
|
||||
desc: "Sync button should open about:accounts page with `abouthome` entrypoint",
|
||||
desc: "Sync button should open about:preferences#sync",
|
||||
setup: function () {},
|
||||
run: Task.async(function* () {
|
||||
let syncButton = gBrowser.selectedBrowser.contentDocument.getElementById("sync");
|
||||
let oldOpenPrefs = window.openPreferences;
|
||||
let openPrefsPromise = new Promise(resolve => {
|
||||
window.openPreferences = function (pane, params) {
|
||||
resolve({ pane: pane, params: params });
|
||||
};
|
||||
});
|
||||
|
||||
yield EventUtils.synthesizeMouseAtCenter(syncButton, {}, gBrowser.contentWindow);
|
||||
|
||||
yield promiseTabLoadEvent(gBrowser.selectedTab, null, "load");
|
||||
is(gBrowser.currentURI.spec, "about:accounts?entrypoint=abouthome",
|
||||
"Entry point should be `abouthome`.");
|
||||
let result = yield openPrefsPromise;
|
||||
window.openPreferences = oldOpenPrefs;
|
||||
|
||||
is(result.pane, "paneSync", "openPreferences should be called with paneSync");
|
||||
is(result.params.urlParams.entrypoint, "abouthome", "openPreferences should be called with abouthome entrypoint");
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -143,21 +143,7 @@ var AboutHome = {
|
|||
break;
|
||||
|
||||
case "AboutHome:Sync":
|
||||
let weave = Cc["@mozilla.org/weave/service;1"]
|
||||
.getService(Ci.nsISupports)
|
||||
.wrappedJSObject;
|
||||
|
||||
if (weave.fxAccountsEnabled) {
|
||||
fxAccounts.getSignedInUser().then(userData => {
|
||||
if (userData) {
|
||||
window.openPreferences("paneSync");
|
||||
} else {
|
||||
window.loadURI("about:accounts?entrypoint=abouthome");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
window.openPreferences("paneSync");
|
||||
}
|
||||
window.openPreferences("paneSync", { urlParams: { entrypoint: "abouthome" } });
|
||||
break;
|
||||
|
||||
case "AboutHome:Settings":
|
||||
|
|
Загрузка…
Ссылка в новой задаче