summaryrefslogtreecommitdiffstats
path: root/dom/network/tests/test_tcpsocket_not_exposed_to_content.html
blob: 4154eeca5cf87f467a6f975dd4a30946fe10e787 (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
<!DOCTYPE HTML>
<html>
<head>
  <title>Test to ensure TCPSocket permission enabled and no tcp-socket perm does not allow open</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/**
 * TCPSocket and its legacy mozTCPSocket variant should never be exposed to
 * content.
 */

is('TCPSocket' in this, false, "TCPSocket should not be accessible to content");
is('TCPServerSocket' in this, false, "TCPServerSocket should not be accessible to content");
is('mozTCPSocket' in navigator, false, "mozTCPSocket should not be accessible to content");
</script>
</pre>
</body>
</html>