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

"use strict";

add_task(async function test_unknown_event() {
  let error;
  try {
    await SpecialMessageActions.handleAction(
      { type: "UNKNOWN_EVENT_123" },
      gBrowser
    );
  } catch (e) {
    error = e;
  }
  ok(error, "should throw if an unexpected event is handled");
  Assert.equal(
    error.message,
    "Special message action with type UNKNOWN_EVENT_123 is unsupported."
  );
});