test_tcpsocket_client_and_server_basics.html (1747B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 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. 7 8 https://bugzilla.mozilla.org/show_bug.cgi?id=1084245 9 --> 10 <head> 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); 18 } 19 20 function createSocket(host, port, options) { 21 return new TCPSocket(host, port, options); 22 } 23 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; 33 } 34 </script> 35 <script type="application/javascript" src="test_tcpsocket_client_and_server_basics.js"></script> 36 </head> 37 <body> 38 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1084245">Mozilla Bug 1084245</a> 39 <p id="display"></p> 40 <div id="content" style="display: none"> 41 42 </div> 43 <pre id="test"> 44 </pre> 45 </body> 46 </html>