gecko-dev/dom/network/tests/test_tcpsocket_enabled_no_p...

30 строки
963 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Test to ensure TCPSocket permission enabled and no tcp-socket perm does not allow open</title>
<script type="application/javascript" 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">
/** Test to ensure TCPSocket preference being turned on does not enable
navigator.mozTCPSocket.
**/
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [['dom.mozTCPSocket.enabled', true]]}, runTest);
function runTest() {
is('TCPSocket' in this, false, "TCPSocket should not be accessible if dom.mozTCPSocket.enabled is true");
is('mozTCPSocket' in navigator, false, "mozTCPSocket should be accessible if dom.mozTCPSocket.enabled is true");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>