1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/modules/test/unit/social/test_socialDisabledStartup.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +function run_test() { 1.9 + // we are testing worker startup specifically 1.10 + do_test_pending(); 1.11 + add_test(testStartupDisabled); 1.12 + add_test(testEnableAfterStartup); 1.13 + do_initialize_social(false, run_next_test); 1.14 +} 1.15 + 1.16 +function testStartupDisabled() { 1.17 + // wait on startup before continuing 1.18 + do_check_false(Social.enabled, "Social is disabled"); 1.19 + do_check_eq(Social.providers.length, 0, "zero social providers available"); 1.20 + run_next_test(); 1.21 +} 1.22 + 1.23 +function testEnableAfterStartup() { 1.24 + do_add_providers(function () { 1.25 + do_check_true(Social.enabled, "Social is enabled"); 1.26 + do_check_eq(Social.providers.length, 2, "two social providers available"); 1.27 + do_check_true(Social.providers[0].enabled, "provider 0 is enabled"); 1.28 + do_check_true(Social.providers[1].enabled, "provider 1 is enabled"); 1.29 + do_test_finished(); 1.30 + run_next_test(); 1.31 + }); 1.32 +}