mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1081158 - ensure we report all login related errors. r=rnewman
This commit is contained in:
parent
714a802bc7
commit
6608577711
@ -737,6 +737,12 @@ ErrorHandler.prototype = {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Status.login == LOGIN_FAILED_LOGIN_REJECTED) {
|
||||||
|
// An explicit LOGIN_REJECTED state is always reported (bug 1081158)
|
||||||
|
this._log.trace("shouldReportError: true (login was rejected)");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
let lastSync = Svc.Prefs.get("lastSync");
|
let lastSync = Svc.Prefs.get("lastSync");
|
||||||
if (lastSync && ((Date.now() - Date.parse(lastSync)) >
|
if (lastSync && ((Date.now() - Date.parse(lastSync)) >
|
||||||
Svc.Prefs.get("errorhandler.networkFailureReportTimeout") * 1000)) {
|
Svc.Prefs.get("errorhandler.networkFailureReportTimeout") * 1000)) {
|
||||||
|
@ -468,6 +468,24 @@ add_identity_test(this, function test_shouldReportError_master_password() {
|
|||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Test that even if we don't have a cluster URL, a login failure due to
|
||||||
|
// authentication errors is always reported.
|
||||||
|
add_identity_test(this, function test_shouldReportLoginFailureWithNoCluster() {
|
||||||
|
// Ensure no clusterURL - any error not specific to login should not be reported.
|
||||||
|
Service.serverURL = "";
|
||||||
|
Service.clusterURL = "";
|
||||||
|
|
||||||
|
// Test explicit "login rejected" state.
|
||||||
|
Status.resetSync();
|
||||||
|
// If we have a LOGIN_REJECTED state, we always report the error.
|
||||||
|
Status.login = LOGIN_FAILED_LOGIN_REJECTED;
|
||||||
|
do_check_true(errorHandler.shouldReportError());
|
||||||
|
// But any other status with a missing clusterURL is treated as a mid-sync
|
||||||
|
// 401 (ie, should be treated as a node reassignment)
|
||||||
|
Status.login = LOGIN_SUCCEEDED;
|
||||||
|
do_check_false(errorHandler.shouldReportError());
|
||||||
|
});
|
||||||
|
|
||||||
// XXX - how to arrange for 'Service.identity.basicPassword = null;' in
|
// XXX - how to arrange for 'Service.identity.basicPassword = null;' in
|
||||||
// an fxaccounts environment?
|
// an fxaccounts environment?
|
||||||
add_task(function test_login_syncAndReportErrors_non_network_error() {
|
add_task(function test_login_syncAndReportErrors_non_network_error() {
|
||||||
|
Loading…
Reference in New Issue
Block a user