4 Core tests for TCPSocket and TCPServerSocket that replace their previous
5 separate xpcshell incarnations. This migration and cleanup occurred as part
6 of bug 1084245 in order to get coverage of the tests from content.
8 https://bugzilla.mozilla.org/show_bug.cgi?id=1084245
11 <meta charset=
"utf-8">
12 <title>Test for Bug
1084245</title>
13 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
14 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"/>
15 <script type=
"application/javascript">
16 function createServer(port, options, backlog) {
17 return new TCPServerSocket(port, options, backlog);
20 function createSocket(host, port, options) {
21 return new TCPSocket(host, port, options);
24 // In the JSM case, ArrayBuffers will be created in the compartment of the
25 // JSM with different globals than the
26 // test_tcpsocket_client_and_server_basics.js test logic sees, so we (and
27 // tcpsocket_test.sys.mjs) need to do something. To avoid complexity relating
28 // to wrappers and the varying nuances of the module scope and global scope
29 // in JSM's (they differ on B2G), we hardcode ArrayBuffer rather than taking
30 // a string that we look up, etc.
31 function socketCompartmentInstanceOfArrayBuffer(obj) {
32 return obj instanceof ArrayBuffer;
35 <script type=
"application/javascript" src=
"test_tcpsocket_client_and_server_basics.js"></script>
38 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1084245">Mozilla Bug
1084245</a>
40 <div id=
"content" style=
"display: none">