Backed out changeset d11aec13b38e (bug 1365375) for eslint failures.

This commit is contained in:
Ryan VanderMeulen 2017-05-23 13:36:50 -04:00
Родитель b860fe5648
Коммит c92175874c
4 изменённых файлов: 1 добавлений и 55 удалений

Просмотреть файл

@ -52,7 +52,6 @@ var publicProperties = [
"getSignedInUser",
"getSignedInUserProfile",
"handleDeviceDisconnection",
"handleAccountDestroyed",
"invalidateCertificate",
"loadAndPoll",
"localtimeOffsetMsec",
@ -1569,7 +1568,7 @@ FxAccountsInternal.prototype = {
return null;
}
if (deviceId == localDeviceId) {
this.notifyObservers(ON_DEVICE_DISCONNECTED_NOTIFICATION);
this.notifyObservers(ON_DEVICE_DISCONNECTED_NOTIFICATION, deviceId);
return this.signOut(true);
}
log.error(
@ -1579,25 +1578,6 @@ FxAccountsInternal.prototype = {
});
},
handleAccountDestroyed(uid) {
return this.currentAccountState.getUserAccountData()
.then(data => data ? data.uid : null)
.then(localUid => {
if (!localUid) {
log.info(`Account destroyed push notification received, but we're already logged-out`);
return null;
}
if (uid == localUid) {
this.notifyObservers(ON_DEVICE_DISCONNECTED_NOTIFICATION);
return this.signOut(true);
}
log.info(
`The destroyed account uid doesn't match with the local uid. ` +
`Local: ${localUid}, account uid destroyed: ${uid}`);
return null;
});
},
/**
* Delete all the cached persisted credentials we store for FxA.
*

Просмотреть файл

@ -94,7 +94,6 @@ exports.ON_DEVICE_DISCONNECTED_NOTIFICATION = "fxaccounts:device_disconnected";
exports.ON_PROFILE_UPDATED_NOTIFICATION = "fxaccounts:profile_updated"; // Push
exports.ON_PASSWORD_CHANGED_NOTIFICATION = "fxaccounts:password_changed";
exports.ON_PASSWORD_RESET_NOTIFICATION = "fxaccounts:password_reset";
exports.ON_ACCOUNT_DESTROYED_NOTIFICATION = "fxaccounts:account_destroyed";
exports.ON_COLLECTION_CHANGED_NOTIFICATION = "sync:collection_changed";
exports.FXA_PUSH_SCOPE_ACCOUNT_UPDATE = "chrome://fxa-device-update";

Просмотреть файл

@ -179,9 +179,6 @@ FxAccountsPushService.prototype = {
case ON_PASSWORD_RESET_NOTIFICATION:
this._onPasswordChanged();
return;
case ON_ACCOUNT_DESTROYED_NOTIFICATION:
this.fxAccounts.handleAccountDestroyed(payload.data.uid);
return;
case ON_COLLECTION_CHANGED_NOTIFICATION:
Services.obs.notifyObservers(null, ON_COLLECTION_CHANGED_NOTIFICATION, payload.data.collections);
default:

Просмотреть файл

@ -201,36 +201,6 @@ add_test(function observePushTopicDeviceDisconnected() {
pushService.observe(msg, mockPushService.pushTopic, FXA_PUSH_SCOPE_ACCOUNT_UPDATE);
});
add_test(function observePushTopicAccountDestroyed() {
const uid = "bogusuid";
let msg = {
data: {
json: () => ({
command: ON_ACCOUNT_DESTROYED_NOTIFICATION,
data: {
uid: uid
}
})
},
QueryInterface() {
return this;
}
};
let customAccounts = Object.assign(mockFxAccounts, {
handleAccountDestroyed() {
// checking verification status on push messages without data
run_next_test();
}
});
let pushService = new FxAccountsPushService({
pushService: mockPushService,
fxAccounts: customAccounts,
});
pushService.observe(msg, mockPushService.pushTopic, FXA_PUSH_SCOPE_ACCOUNT_UPDATE);
});
add_test(function observePushTopicProfileUpdated() {
let msg = {
data: {