michael@0: michael@0: "use strict"; michael@0: michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: Cu.import('resource://gre/modules/Services.jsm'); michael@0: Cu.import('resource://gre/modules/identity/IdentityUtils.jsm'); michael@0: michael@0: function test_check_deprecated() { michael@0: let options = { michael@0: id: 123, michael@0: loggedInEmail: "jed@foo.com", michael@0: pies: 42 michael@0: }; michael@0: michael@0: do_check_true(checkDeprecated(options, "loggedInEmail")); michael@0: do_check_false(checkDeprecated(options, "flans")); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: function test_check_renamed() { michael@0: let options = { michael@0: id: 123, michael@0: loggedInEmail: "jed@foo.com", michael@0: pies: 42 michael@0: }; michael@0: michael@0: checkRenamed(options, "loggedInEmail", "loggedInUser"); michael@0: michael@0: // It moves loggedInEmail to loggedInUser michael@0: do_check_false(!!options.loggedInEmail); michael@0: do_check_eq(options.loggedInUser, "jed@foo.com"); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: let TESTS = [ michael@0: test_check_deprecated, michael@0: test_check_renamed michael@0: ]; michael@0: michael@0: TESTS.forEach(add_test); michael@0: michael@0: function run_test() { michael@0: run_next_test(); michael@0: }