2018-03-12 09:16:51 +00:00
|
|
|
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
2019-02-14 20:20:20 +00:00
|
|
|
// Basic tests to verify that MacSharingService returns expected data
|
2018-03-12 09:16:51 +00:00
|
|
|
|
2019-02-14 20:20:20 +00:00
|
|
|
function test_getSharingProviders() {
|
2018-03-12 09:16:51 +00:00
|
|
|
let sharingService = Cc["@mozilla.org/widget/macsharingservice;1"].getService(
|
|
|
|
Ci.nsIMacSharingService
|
|
|
|
);
|
|
|
|
let providers = sharingService.getSharingProviders("http://example.org");
|
|
|
|
Assert.ok(providers.length > 1, "There are providers returned");
|
|
|
|
providers.forEach(provider => {
|
2018-04-25 07:23:32 +00:00
|
|
|
Assert.ok("name" in provider, "Provider has name");
|
2018-03-12 09:16:51 +00:00
|
|
|
Assert.ok("menuItemTitle" in provider, "Provider has menuItemTitle");
|
|
|
|
Assert.ok("image" in provider, "Provider has image");
|
2018-04-21 08:01:09 +00:00
|
|
|
|
|
|
|
Assert.notEqual(
|
|
|
|
provider.title,
|
|
|
|
"Mail",
|
|
|
|
"Known filtered provider not returned"
|
|
|
|
);
|
2018-03-12 09:16:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-02-14 20:20:20 +00:00
|
|
|
function run_test() {
|
2018-03-12 09:16:51 +00:00
|
|
|
test_getSharingProviders();
|
|
|
|
}
|