summaryrefslogtreecommitdiffstats
path: root/dom/broadcastchannel/tests/test_dataCloning.html
blob: 26c1ce370a0d434adea5f702be934c3d0bbca24d (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 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>