mirror of
https://github.com/servo/servo
synced 2026-04-29 10:57:43 +02:00
24 lines
687 B
HTML
24 lines
687 B
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>WebSockets: bufferedAmount for unicode data</title>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=../../../constants.js?pipe=sub></script>
|
|
<meta name="variant" content="">
|
|
<meta name="variant" content="?wss">
|
|
<div id=log></div>
|
|
<script>
|
|
async_test(function(t) {
|
|
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo');
|
|
var data = "¥¥¥¥¥¥";
|
|
ws.onopen = t.step_func(function(e) {
|
|
ws.send(data);
|
|
assert_equals(data.length * 2, ws.bufferedAmount);
|
|
});
|
|
ws.onmessage = t.step_func(function(e) {
|
|
assert_equals(e.data, data);
|
|
t.done();
|
|
});
|
|
});
|
|
</script>
|