test_tcpsocket_not_exposed_to_content.html (804B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test to ensure TCPSocket permission enabled and no tcp-socket perm does not allow open</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 7 </head> 8 <body> 9 <p id="display"></p> 10 <div id="content" style="display: none"> 11 </div> 12 <pre id="test"> 13 <script type="application/javascript"> 14 /** 15 * TCPSocket and its legacy mozTCPSocket variant should never be exposed to 16 * content. 17 */ 18 19 is('TCPSocket' in this, false, "TCPSocket should not be accessible to content"); 20 is('TCPServerSocket' in this, false, "TCPServerSocket should not be accessible to content"); 21 is('mozTCPSocket' in navigator, false, "mozTCPSocket should not be accessible to content"); 22 </script> 23 </pre> 24 </body> 25 </html>