4 Test of legacy navigator interface for opening TCPSocket/TCPServerSocket.
8 <title>Test for Bug
885982</title>
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1084245">Mozilla Bug
1084245</a>
15 <div id=
"content" style=
"display: none">
21 SimpleTest
.waitForExplicitFinish();
24 // See bug 903830; in e10s mode we never get to find out the localPort if we
25 // let it pick a free port by choosing 0. This is the same port the xpcshell
27 var serverPort
= 8085;
29 var listeningServer
= navigator
.mozTCPSocket
.listen(serverPort
,
30 { binaryType
: 'arraybuffer' },
32 listeningServer
.onconnect = function(ev
) {
33 ok(true, "got server connect");
34 listeningServer
.close();
35 listeningServer
= null;
39 var clientSocket
= navigator
.mozTCPSocket
.open('127.0.0.1', serverPort
,
40 { binaryType
: 'arraybuffer' });
41 clientSocket
.onopen = function() { ok(true, "got client open"); }
42 clientSocket
.onclose = function() {
43 ok(true, "got client close");
46 setTimeout(function() {
47 // This just helps the test harness clean up quickly
48 SpecialPowers
.forceCC();
49 SpecialPowers
.forceGC();
54 runTest(); // we used to invoke this as part of a moot pref-setting callback