summaryrefslogtreecommitdiffstats
path: root/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_default_browser.js
blob: 2d919456cd458ba02c1d961efa37dc6e8f5e7294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_task(async function test_set_default_browser() {
  const sandbox = sinon.createSandbox();
  const stub = sandbox.stub();

  await SMATestUtils.executeAndValidateAction(
    { type: "SET_DEFAULT_BROWSER" },
    {
      ownerGlobal: {
        getShellService: () => ({
          setAsDefault: stub,
        }),
      },
    }
  );

  Assert.equal(stub.callCount, 1, "setAsDefault was called by the action");
});