diff options
Diffstat (limited to 'dom/broadcastchannel/tests/test_broadcastchannel_self.html')
-rw-r--r-- | dom/broadcastchannel/tests/test_broadcastchannel_self.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/dom/broadcastchannel/tests/test_broadcastchannel_self.html b/dom/broadcastchannel/tests/test_broadcastchannel_self.html new file mode 100644 index 000000000..32df390be --- /dev/null +++ b/dom/broadcastchannel/tests/test_broadcastchannel_self.html @@ -0,0 +1,38 @@ +<!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(); +runTest(); + +</script> +</body> +</html> + |