|
1 |
|
2 "use strict"; |
|
3 |
|
4 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
|
5 Cu.import('resource://gre/modules/Services.jsm'); |
|
6 Cu.import('resource://gre/modules/identity/IdentityUtils.jsm'); |
|
7 |
|
8 function test_check_deprecated() { |
|
9 let options = { |
|
10 id: 123, |
|
11 loggedInEmail: "jed@foo.com", |
|
12 pies: 42 |
|
13 }; |
|
14 |
|
15 do_check_true(checkDeprecated(options, "loggedInEmail")); |
|
16 do_check_false(checkDeprecated(options, "flans")); |
|
17 |
|
18 run_next_test(); |
|
19 } |
|
20 |
|
21 function test_check_renamed() { |
|
22 let options = { |
|
23 id: 123, |
|
24 loggedInEmail: "jed@foo.com", |
|
25 pies: 42 |
|
26 }; |
|
27 |
|
28 checkRenamed(options, "loggedInEmail", "loggedInUser"); |
|
29 |
|
30 // It moves loggedInEmail to loggedInUser |
|
31 do_check_false(!!options.loggedInEmail); |
|
32 do_check_eq(options.loggedInUser, "jed@foo.com"); |
|
33 |
|
34 run_next_test(); |
|
35 } |
|
36 |
|
37 let TESTS = [ |
|
38 test_check_deprecated, |
|
39 test_check_renamed |
|
40 ]; |
|
41 |
|
42 TESTS.forEach(add_test); |
|
43 |
|
44 function run_test() { |
|
45 run_next_test(); |
|
46 } |