Bug 957229 - Don't show about:accounts with FxA disabled r=markh

This commit is contained in:
Tim Taubert 2014-01-28 14:36:00 -08:00
parent 45b1cd9c59
commit 98bf23dbea
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,16 @@ let wrapper = {
iframe: null,
init: function () {
let weave = Cc["@mozilla.org/weave/service;1"]
.getService(Ci.nsISupports)
.wrappedJSObject;
// Don't show about:accounts with FxA disabled.
if (!weave.fxAccountsEnabled) {
document.body.remove();
return;
}
let iframe = document.getElementById("remote");
this.iframe = iframe;
iframe.addEventListener("load", this);

View File

@ -9,6 +9,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
registerCleanupFunction(function() {
// Ensure we don't pollute prefs for next tests.
Services.prefs.clearUserPref("identity.fxaccounts.enabled");
Services.prefs.clearUserPref("identity.fxaccounts.remote.uri");
});
@ -18,6 +19,7 @@ let gTests = [
desc: "Test the remote commands",
setup: function ()
{
Services.prefs.setBoolPref("identity.fxaccounts.enabled", true);
Services.prefs.setCharPref("identity.fxaccounts.remote.uri",
"https://example.com/browser/browser/base/content/test/general/accounts_testRemoteCommands.html");
},