Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /direct-sockets/disabled-by-permissions-policy.https.sub.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
'use strict';
test(() => {
assert_throws_dom("NotAllowedError", () => {
new TCPSocket("127.0.0.1", 53);
}, "constructor should throw");
}, "TCPSocket disabled by permissions-policy");
test(() => {
assert_throws_dom("NotAllowedError", () => {
new UDPSocket({ remoteAddress: "127.0.0.1", remotePort: 53 });
}, "constructor should throw");
}, "UDPSocket disabled by permissions-policy");
test(() => {
assert_throws_dom("NotAllowedError", () => {
new TCPServerSocket("127.0.0.1");
}, "constructor should throw");
}, "TCPServerSocket disabled by permissions-policy");
</script>