Loading dom/base/test/test_websocket5.html +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ var tests = [ test45, // Test sending/receving binary Blob test46, // Test that we don't dispatch incoming msgs once in CLOSING state test47, // Make sure onerror/onclose aren't called during close() test48, // see bug 1227136 - client calls close() from onopen() and waits // until WebSocketChannel::mSocketIn is nulled out on socket thread ]; function testWebSocket() { Loading dom/base/test/websocket_tests.js +29 −0 Original line number Diff line number Diff line Loading @@ -1213,3 +1213,32 @@ function test47() { + ws.readyState); }); } // test48: see bug 1227136 - client calls close() from onopen() and waits until // WebSocketChannel::mSocketIn is nulled out on socket thread. function test48() { return new Promise(function(resolve, reject) { const pref_close = "network.websocket.timeout.close"; SpecialPowers.setIntPref(pref_close, 1); var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-48"); ws.onopen = function() { ws.close(); var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < 1500); } ws.onclose = function(e) { ok(true, "ws close in test 48"); resolve(); } SpecialPowers.clearUserPref(pref_close); }); } Loading
dom/base/test/test_websocket5.html +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ var tests = [ test45, // Test sending/receving binary Blob test46, // Test that we don't dispatch incoming msgs once in CLOSING state test47, // Make sure onerror/onclose aren't called during close() test48, // see bug 1227136 - client calls close() from onopen() and waits // until WebSocketChannel::mSocketIn is nulled out on socket thread ]; function testWebSocket() { Loading
dom/base/test/websocket_tests.js +29 −0 Original line number Diff line number Diff line Loading @@ -1213,3 +1213,32 @@ function test47() { + ws.readyState); }); } // test48: see bug 1227136 - client calls close() from onopen() and waits until // WebSocketChannel::mSocketIn is nulled out on socket thread. function test48() { return new Promise(function(resolve, reject) { const pref_close = "network.websocket.timeout.close"; SpecialPowers.setIntPref(pref_close, 1); var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-48"); ws.onopen = function() { ws.close(); var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < 1500); } ws.onclose = function(e) { ok(true, "ws close in test 48"); resolve(); } SpecialPowers.clearUserPref(pref_close); }); }