diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/base/test/test_bug1081686.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/test_bug1081686.html')
-rw-r--r-- | dom/base/test/test_bug1081686.html | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/dom/base/test/test_bug1081686.html b/dom/base/test/test_bug1081686.html new file mode 100644 index 000000000..bd00c3f64 --- /dev/null +++ b/dom/base/test/test_bug1081686.html @@ -0,0 +1,71 @@ +<!DOCTYPE HTML> +<html> +<!-- +--> +<head> + <title>bug 1081686</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body onload="testWebSocket()"> +<p id="display"></p> +<div id="content" style="display: none"> +</div> +<pre id="test"> +<script class="testbody" type="text/javascript"> + +var ws; + +function forcegc() +{ + SpecialPowers.forceGC(); + SpecialPowers.gc(); + setTimeout(function() + { + SpecialPowers.gc(); + }, 0); +} + +function testWebSocket () { + ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello"); + ws.onopen = function(e) { + ws.send("data"); + } + ws.onclose = function(e) { + forcegc(); + setTimeout(function() { + is(ws.readyState, 3, 'WebSocket is closed'); + is(ws.bufferedAmount, 0, 'WebSocket.bufferedAmount should be empty.'); + is(ws.binaryType, 'blob', 'WebSocket.binaryType is blob'); + ws.binaryType = 'arraybuffer'; + is(ws.binaryType, 'arraybuffer', 'WebSocket.binaryType is arraybuffer'); + is(ws.url, 'ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello', 'WebSocket.url is correct'); + ws.close(); + ws.send('foobar'); + SimpleTest.finish(); + }, 1000); + } + + ws.onerror = function(e) { + ok(false, "onerror called!"); + SimpleTest.finish(); + } + ws.onmessage = function(e) { + is(e.data, "Hello world!", "Wrong data"); + ws.close(); + } +} + +SimpleTest.waitForExplicitFinish(); +SimpleTest.requestFlakyTimeout("untriaged"); + +</script> +</pre> +<div> + + +</div> + + +</body> +</html> |