mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1448165 p4 - Remove skipDeviceRegistration pref. r=markh,tcsc
MozReview-Commit-ID: Ktibgc7SPfo --HG-- extra : rebase_source : 2282bfd450baf1f1937d8bcbb9d7faff85100eba
This commit is contained in:
parent
42772c47b0
commit
9c4356e89b
@ -24,8 +24,6 @@ registerCleanupFunction(async function() {
|
||||
|
||||
var tests = [
|
||||
taskify(async function test_highlight_accountStatus_loggedOut() {
|
||||
let userData = await fxAccounts.getSignedInUser();
|
||||
is(userData, null, "Not logged in initially");
|
||||
await showMenuPromise("appMenu");
|
||||
await showHighlightPromise("accountStatus");
|
||||
let highlight = document.getElementById("UITourHighlightContainer");
|
||||
@ -33,9 +31,6 @@ var tests = [
|
||||
}),
|
||||
|
||||
taskify(async function test_highlight_accountStatus_loggedIn() {
|
||||
await setSignedInUser();
|
||||
let userData = await fxAccounts.getSignedInUser();
|
||||
isnot(userData, null, "Logged in now");
|
||||
gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, lastSync: new Date(), email: "foo@example.com" });
|
||||
await showMenuPromise("appMenu");
|
||||
await showHighlightPromise("accountStatus");
|
||||
@ -46,25 +41,6 @@ var tests = [
|
||||
}),
|
||||
];
|
||||
|
||||
// Watch out - these will fire observers which if you aren't careful, may
|
||||
// interfere with the tests.
|
||||
function setSignedInUser(data) {
|
||||
if (!data) {
|
||||
data = {
|
||||
email: "foo@example.com",
|
||||
uid: "1234@lcip.org",
|
||||
assertion: "foobar",
|
||||
sessionToken: "dead",
|
||||
kSync: "beef",
|
||||
kXCS: "cafe",
|
||||
kExtSync: "bacon",
|
||||
kExtKbHash: "cheese",
|
||||
verified: true
|
||||
};
|
||||
}
|
||||
return fxAccounts.setSignedInUser(data);
|
||||
}
|
||||
|
||||
function signOut() {
|
||||
// we always want a "localOnly" signout here...
|
||||
return fxAccounts.signOut(true);
|
||||
|
@ -1644,12 +1644,6 @@ FxAccountsInternal.prototype = {
|
||||
// you'll have to bump the DEVICE_REGISTRATION_VERSION number to force older
|
||||
// devices to re-register when Firefox updates
|
||||
async _registerOrUpdateDevice(signedInUser) {
|
||||
// Allow tests to skip device registration because it makes remote requests
|
||||
// to the auth server and _getDeviceName does not work from xpcshell.
|
||||
if (Services.prefs.getBoolPref("identity.fxaccounts.skipDeviceRegistration", false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {sessionToken, device: currentDevice} = signedInUser;
|
||||
if (!sessionToken) {
|
||||
throw new Error("_registerOrUpdateDevice called without a session token");
|
||||
|
@ -141,7 +141,6 @@ add_task(async function networkErrorResponse() {
|
||||
serverURL: "https://domain.dummy",
|
||||
client_id: "abc123"
|
||||
});
|
||||
Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true);
|
||||
client.getTokenFromAssertion("assertion", "scope")
|
||||
.catch(function(e) {
|
||||
Assert.equal(e.name, "FxAccountsOAuthGrantClientError");
|
||||
@ -149,8 +148,7 @@ add_task(async function networkErrorResponse() {
|
||||
Assert.equal(e.errno, ERRNO_NETWORK);
|
||||
Assert.equal(e.error, ERROR_NETWORK);
|
||||
run_next_test();
|
||||
}).catch(() => {}).then(() =>
|
||||
Services.prefs.clearUserPref("identity.fxaccounts.skipDeviceRegistration"));
|
||||
});
|
||||
});
|
||||
|
||||
add_test(function unsupportedMethod() {
|
||||
@ -271,7 +269,6 @@ add_test(function networkErrorResponse() {
|
||||
serverURL: "https://domain.dummy",
|
||||
client_id: "abc123"
|
||||
});
|
||||
Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true);
|
||||
client.getTokenFromAssertion("assertion", "scope")
|
||||
.catch(function(e) {
|
||||
Assert.equal(e.name, "FxAccountsOAuthGrantClientError");
|
||||
@ -279,8 +276,7 @@ add_test(function networkErrorResponse() {
|
||||
Assert.equal(e.errno, ERRNO_NETWORK);
|
||||
Assert.equal(e.error, ERROR_NETWORK);
|
||||
run_next_test();
|
||||
}).catch(() => {}).then(() =>
|
||||
Services.prefs.clearUserPref("identity.fxaccounts.skipDeviceRegistration"));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -267,9 +267,6 @@ user_pref("identity.fxaccounts.auth.uri", "https://%(server)s/fxa-dummy/");
|
||||
// Ditto for all the FxA content root URI.
|
||||
user_pref("identity.fxaccounts.remote.root", "https://%(server)s/");
|
||||
|
||||
// We don't want browser tests to perform FxA device registration.
|
||||
user_pref("identity.fxaccounts.skipDeviceRegistration", true);
|
||||
|
||||
// Increase the APZ content response timeout in tests to 1 minute.
|
||||
// This is to accommodate the fact that test environments tends to be slower
|
||||
// than production environments (with the b2g emulator being the slowest of them
|
||||
|
Loading…
Reference in New Issue
Block a user