summaryrefslogtreecommitdiffstats
path: root/dom/broadcastchannel/tests/test_dataCloning.html
blob: 6aa164e944bdc14de2d1c4b5b5d555c5b7b7e53f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for BroadcastChannel.postMessage invalid State</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">


let c = new BroadcastChannel("foo");

try  {
  c.postMessage(Symbol());
  ok(false, "This should throw!");
} catch(e) {
  ok(true, "This should throw!");
  is(e.name, "DataCloneError", "Correct DataCloneError exception thrown");
}

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