mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
f7ffcd09fb
Differential Revision: https://phabricator.services.mozilla.com/D99595
38 lines
679 B
HTML
38 lines
679 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Test for BroadcastChannel</title>
|
|
<script 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() {
|
|
let x = new BroadcastChannel("foo");
|
|
let 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();
|
|
runTest();
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|