Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 Cu.import("resource://services-sync/constants.js");
5 Cu.import("resource://services-sync/status.js");
6 Cu.import("resource://services-sync/util.js");
7 Cu.import("resource://testing-common/services/sync/utils.js");
9 function run_test() {
10 initTestLogging("Trace");
11 ensureLegacyIdentityManager();
13 try {
14 _("Ensure fresh config.");
15 Status._authManager.deleteSyncCredentials();
17 _("Fresh setup, we're not configured.");
18 do_check_eq(Status.checkSetup(), CLIENT_NOT_CONFIGURED);
19 do_check_eq(Status.login, LOGIN_FAILED_NO_USERNAME);
20 Status.resetSync();
22 _("Let's provide a username.");
23 Status._authManager.username = "johndoe";
24 do_check_eq(Status.checkSetup(), CLIENT_NOT_CONFIGURED);
25 do_check_eq(Status.login, LOGIN_FAILED_NO_PASSWORD);
26 Status.resetSync();
28 do_check_neq(Status._authManager.username, null);
30 _("Let's provide a password.");
31 Status._authManager.basicPassword = "carotsalad";
32 do_check_eq(Status.checkSetup(), CLIENT_NOT_CONFIGURED);
33 do_check_eq(Status.login, LOGIN_FAILED_NO_PASSPHRASE);
34 Status.resetSync();
36 _("Let's provide a passphrase");
37 Status._authManager.syncKey = "a-bcdef-abcde-acbde-acbde-acbde";
38 _("checkSetup()");
39 do_check_eq(Status.checkSetup(), STATUS_OK);
40 Status.resetSync();
42 } finally {
43 Svc.Prefs.resetBranch("");
44 }
45 }