michael@0: // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: Components.utils.import("resource://gre/modules/Accounts.jsm"); michael@0: michael@0: add_task(function test_Accounts() { michael@0: let syncExists = yield Accounts.syncAccountsExist(); michael@0: dump("Sync account exists? " + syncExists + "\n"); michael@0: let firefoxExists = yield Accounts.firefoxAccountsExist(); michael@0: dump("Firefox account exists? " + firefoxExists + "\n"); michael@0: let anyExists = yield Accounts.anySyncAccountsExist(); michael@0: dump("Any accounts exist? " + anyExists + "\n"); michael@0: michael@0: // Only one account should exist. michael@0: do_check_true(!syncExists || !firefoxExists); michael@0: do_check_eq(anyExists, firefoxExists || syncExists); michael@0: michael@0: dump("Launching setup.\n"); michael@0: Accounts.launchSetup(); michael@0: }); michael@0: michael@0: run_next_test();