summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests/Harness_sanity/SpecialPowersLoadChromeScript.js
blob: 92a84e1ffa0cdab2883a5ada11bfd324f30960a2 (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 () {
  assert.ok(true, "valid assertion");
  assert.equal(1, 1, "another valid assertion");
  sendAsyncMessage("valid-assert-done");
});

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