summaryrefslogtreecommitdiffstats
path: root/testing/mochitest/tests/Harness_sanity/SpecialPowersLoadChromeScript.js
blob: 731081832980b3002a58f4220999a49d48790a10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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.";
});