Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/base/test/chrome/chrome.toml
<?xml version="1.0"?>
<!--
-->
    onload="start();">
  <!-- test code goes here -->
  <script type="application/javascript">
  <![CDATA[
  SimpleTest.waitForExplicitFinish();
  SimpleTest.expectUncaughtException();
  // Tell the test to expect exactly one console error with the given parameters,
  // with SimpleTest.finish as a continuation function.
  SimpleTest.monitorConsole(SimpleTest.finish, [{errorMessage: new RegExp('acopia')}]);
  var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
  globalMM.addMessageListener("flimfniffle", function onMessage(msg) {
    globalMM.removeMessageListener("flimfniffle", onMessage);
    is(msg.data, "teufeltor", "correct message");
    // Cleanup the monitor after we throw.
    SimpleTest.executeSoon(SimpleTest.endMonitorConsole);
    // eslint-disable-next-line no-throw-literal
    throw "acopia";
  });
  function start() {
    globalMM.loadFrameScript("data:,sendAsyncMessage('flimfniffle', 'teufeltor')", true);
  }
  ]]>
  </script>
  <!-- test results are displayed in the html:body -->
  </body>
</window>