|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 function run_test() { |
|
6 // we are testing worker startup specifically |
|
7 do_test_pending(); |
|
8 add_test(testStartupDisabled); |
|
9 add_test(testEnableAfterStartup); |
|
10 do_initialize_social(false, run_next_test); |
|
11 } |
|
12 |
|
13 function testStartupDisabled() { |
|
14 // wait on startup before continuing |
|
15 do_check_false(Social.enabled, "Social is disabled"); |
|
16 do_check_eq(Social.providers.length, 0, "zero social providers available"); |
|
17 run_next_test(); |
|
18 } |
|
19 |
|
20 function testEnableAfterStartup() { |
|
21 do_add_providers(function () { |
|
22 do_check_true(Social.enabled, "Social is enabled"); |
|
23 do_check_eq(Social.providers.length, 2, "two social providers available"); |
|
24 do_check_true(Social.providers[0].enabled, "provider 0 is enabled"); |
|
25 do_check_true(Social.providers[1].enabled, "provider 1 is enabled"); |
|
26 do_test_finished(); |
|
27 run_next_test(); |
|
28 }); |
|
29 } |