summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/shell/test/unit/test_shellService.js
blob: ebd9f855327f5a303170911723f47e3e1bd33900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* 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/. */

/**
 * Test setDefaultClient works for all supported types.
 */
add_task(function test_setDefaultClient() {
  let shellSvc = Cc["@mozilla.org/mail/shell-service;1"].getService(
    Ci.nsIShellService
  );

  let types = ["MAIL", "NEWS", "RSS", "CALENDAR"];

  for (let type of types) {
    shellSvc.setDefaultClient(false, shellSvc[type]);
    ok(
      shellSvc.isDefaultClient(false, shellSvc[type]),
      `setDefaultClient works for type ${type}`
    );
  }
});