summaryrefslogtreecommitdiffstats
path: root/browser/modules/test/unit/social/test_social.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /browser/modules/test/unit/social/test_social.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/modules/test/unit/social/test_social.js')
-rw-r--r--browser/modules/test/unit/social/test_social.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/browser/modules/test/unit/social/test_social.js b/browser/modules/test/unit/social/test_social.js
new file mode 100644
index 000000000..3117306c1
--- /dev/null
+++ b/browser/modules/test/unit/social/test_social.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function run_test() {
+ // we are testing worker startup specifically
+ do_test_pending();
+ add_test(testStartupEnabled);
+ add_test(testDisableAfterStartup);
+ do_initialize_social(true, run_next_test);
+}
+
+function testStartupEnabled() {
+ // wait on startup before continuing
+ do_check_eq(Social.providers.length, 2, "two social providers enabled");
+ do_check_true(Social.providers[0].enabled, "provider 0 is enabled");
+ do_check_true(Social.providers[1].enabled, "provider 1 is enabled");
+ run_next_test();
+}
+
+function testDisableAfterStartup() {
+ let SocialService = Cu.import("resource:///modules/SocialService.jsm", {}).SocialService;
+ SocialService.disableProvider(Social.providers[0].origin, function() {
+ do_wait_observer("social:providers-changed", function() {
+ do_check_eq(Social.enabled, false, "Social is disabled");
+ do_check_eq(Social.providers.length, 0, "no social providers available");
+ do_test_finished();
+ run_next_test();
+ });
+ SocialService.disableProvider(Social.providers[0].origin)
+ });
+}