dom/broadcastchannel/tests/test_broadcastchannel_self.html
author Ehsan Akhgari <ehsan@mozilla.com>
Mon, 20 Jul 2015 09:47:15 -0400
changeset 287131 ed821611548724bbde98387d7012ab22d7919a77
parent 252532 bdc9a031003445227cf7c6625330cd851929fd51
child 287921 4c0e2c42c17128fbe5c4a0af2dc474d4a79cf559
permissions -rw-r--r--
Bug 1185515 - Don't hold the observer service alive from nsDNSService; r=mcmanus

<!DOCTYPE HTML>
<html>
<head>
  <title>Test for BroadcastChannel</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>

<div id="content"></div>

<script type="application/javascript">

function runTest() {
  x = new BroadcastChannel('foo');
  y = new BroadcastChannel('foo');

  function func(e) {
    is(e.target, y, "The target is !x");

    SimpleTest.executeSoon(function() {
      SimpleTest.finish();
    });
  }

  x.onmessage = func;
  y.onmessage = func;

  x.postMessage('foo');
}

SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["dom.broadcastChannel.enabled", true]]}, runTest);

</script>
</body>
</html>