summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests/Harness_sanity/SpecialPowersLoadChromeScript.js
blob: 9591f3bca483e667e8634a48bd6375f67e6c6b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* eslint-env mozilla/chrome-script */

// Just receive 'foo' message and forward it back
// as 'bar' message
addMessageListener("foo", function (message) {
  sendAsyncMessage("bar", message);
});

addMessageListener("valid-assert", function (message) {
  assert.ok(true, "valid assertion");
  assert.equal(1, 1, "another valid assertion");
  sendAsyncMessage("valid-assert-done");
});

addMessageListener("sync-message", () => {
  return "Received a synchronous message.";
});