diff --git a/services/sync/locales/en-US/errors.properties b/services/sync/locales/en-US/errors.properties index 8763a295d6c5..b722480e9aad 100644 --- a/services/sync/locales/en-US/errors.properties +++ b/services/sync/locales/en-US/errors.properties @@ -1,7 +1,5 @@ error.login.reason.network = Failed to connect to the server error.login.reason.synckey = Wrong Sync Key -# error.login.reason.password is deprecated. -error.login.reason.password = Incorrect username or password error.login.reason.account = Incorrect account name or password error.login.reason.no_password= No saved password to use error.login.reason.no_synckey = No saved Sync Key to use diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 529fb5150b02..a32d2215afad 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -1184,12 +1184,6 @@ WeaveSvc.prototype = { checkAccount: function checkAccount(account) { let username = this._usernameFromAccount(account); - return this.checkUsername(username); - }, - - // Backwards compat with the Firefox UI. Fold into checkAccount() once - // bug 595066 has landed. - checkUsername: function checkUsername(username) { let url = this.userAPI + username; let res = new Resource(url); res.authenticator = new NoOpAuthenticator(); @@ -1211,18 +1205,9 @@ WeaveSvc.prototype = { return this._errorStr(data); }, - createAccount: function createAccount() { - // Backwards compat with the Firefox UI. Change to signature to - // (email, password, captchaChallenge, captchaResponse) once - // bug 595066 has landed. - let username, email, password, captchaChallenge, captchaResponse; - if (arguments.length == 4) { - [email, password, captchaChallenge, captchaResponse] = arguments; - username = this._usernameFromAccount(email); - } else { - [username, password, email, captchaChallenge, captchaResponse] = arguments; - } - + createAccount: function createAccount(email, password, + captchaChallenge, captchaResponse) { + let username = this._usernameFromAccount(email); let payload = JSON.stringify({ "password": Utils.encodeUTF8(password), "email": email, diff --git a/services/sync/tests/unit/test_service_checkAccount.js b/services/sync/tests/unit/test_service_checkAccount.js index 0e8b3b8ecca5..f35e66c90663 100644 --- a/services/sync/tests/unit/test_service_checkAccount.js +++ b/services/sync/tests/unit/test_service_checkAccount.js @@ -15,7 +15,7 @@ function run_test() { Service.serverURL = "http://localhost:8080/"; _("A 404 will be recorded as 'generic-server-error'"); - do_check_eq(Service.checkUsername("jimdoe"), "generic-server-error"); + do_check_eq(Service.checkAccount("jimdoe"), "generic-server-error"); _("Account that's available."); do_check_eq(Service.checkAccount("john@doe.com"), "available"); @@ -23,13 +23,11 @@ function run_test() { _("Account that's not available."); do_check_eq(Service.checkAccount("jane@doe.com"), "notAvailable"); - // Backwards compat with the Firefox UI. Remove once bug 595066 has landed. + _("Username fallback: Account that's not available."); + do_check_eq(Service.checkAccount("johndoe"), "notAvailable"); - _("Account that's not available."); - do_check_eq(Service.checkUsername("johndoe"), "notAvailable"); - - _("Account that's available."); - do_check_eq(Service.checkUsername("janedoe"), "available"); + _("Username fallback: Account that's available."); + do_check_eq(Service.checkAccount("janedoe"), "available"); } finally { Svc.Prefs.resetBranch(""); diff --git a/services/sync/tests/unit/test_service_createAccount.js b/services/sync/tests/unit/test_service_createAccount.js index 29c6e41bf04b..b8cee9095e71 100644 --- a/services/sync/tests/unit/test_service_createAccount.js +++ b/services/sync/tests/unit/test_service_createAccount.js @@ -23,10 +23,7 @@ function run_test() { // jane@doe.com "/user/1.0/vuuf3eqgloxpxmzph27f5a6ve7gzlrms": send(400, "Bad Request", "2"), // jim@doe.com - "/user/1.0/vz6fhecgw5t3sgx3a4cektoiokyczkqd": send(500, "Server Error", "Server Error"), - "/user/1.0/johndoe": send(200, "OK", "0"), - "/user/1.0/janedoe": send(400, "Bad Request", "2"), - "/user/1.0/jimdoe": send(500, "Server Error", "Server Error") + "/user/1.0/vz6fhecgw5t3sgx3a4cektoiokyczkqd": send(500, "Server Error", "Server Error") }); try { Service.serverURL = "http://localhost:8080/"; @@ -65,24 +62,6 @@ function run_test() { "challenge", "response"); do_check_eq(secretHeader, "my-server-secret"); - - // Backwards compat with the Firefox UI. Remove once bug 595066 has landed. - - _("Create an old-style account."); - res = Service.createAccount("johndoe", "mysecretpw", "john@doe.com", - "challenge", "response"); - do_check_eq(res, null); - - _("Invalid captcha or other user-friendly error."); - res = Service.createAccount("janedoe", "anothersecretpw", "jane@doe.com", - "challenge", "response"); - do_check_eq(res, "invalid-captcha"); - - _("Generic server error."); - res = Service.createAccount("jimdoe", "preciousss", "jim@doe.com", - "challenge", "response"); - do_check_eq(res, "generic-server-error"); - } finally { Svc.Prefs.resetBranch(""); server.stop(do_test_finished); diff --git a/services/sync/tests/unit/test_utils_getErrorString.js b/services/sync/tests/unit/test_utils_getErrorString.js index 4dbc5d4229ac..4b8497dfa190 100644 --- a/services/sync/tests/unit/test_utils_getErrorString.js +++ b/services/sync/tests/unit/test_utils_getErrorString.js @@ -6,7 +6,7 @@ function run_test() { // we just test whether the returned string includes the // string "unknown", should be good enough - str = Utils.getErrorString("error.login.reason.password"); + str = Utils.getErrorString("error.login.reason.account"); do_check_true(str.match(/unknown/i) == null); str = Utils.getErrorString("foobar");