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: function run_test() { michael@0: // we are testing worker startup specifically michael@0: do_test_pending(); michael@0: add_test(testStartupDisabled); michael@0: add_test(testEnableAfterStartup); michael@0: do_initialize_social(false, run_next_test); michael@0: } michael@0: michael@0: function testStartupDisabled() { michael@0: // wait on startup before continuing michael@0: do_check_false(Social.enabled, "Social is disabled"); michael@0: do_check_eq(Social.providers.length, 0, "zero social providers available"); michael@0: run_next_test(); michael@0: } michael@0: michael@0: function testEnableAfterStartup() { michael@0: do_add_providers(function () { michael@0: do_check_true(Social.enabled, "Social is enabled"); michael@0: do_check_eq(Social.providers.length, 2, "two social providers available"); michael@0: do_check_true(Social.providers[0].enabled, "provider 0 is enabled"); michael@0: do_check_true(Social.providers[1].enabled, "provider 1 is enabled"); michael@0: do_test_finished(); michael@0: run_next_test(); michael@0: }); michael@0: }