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

// 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.";
});