mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326
This commit is contained in:
parent
462c272380
commit
1f531f66ea
5377 changed files with 174916 additions and 84369 deletions
|
@ -9,14 +9,13 @@
|
|||
<script>
|
||||
async_test(function(t) {
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/handshake_protocol');
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(e => assert_unreached(e.type));
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
ws.onopen = ws.onmessage = ws.onclose = t.step_func(e => assert_unreached(e.type));
|
||||
ws.onerror = t.step_func(function(e) {
|
||||
ws.onclose = t.step_func(function(e) {
|
||||
ws.onclose = t.step_func(e => assert_unreached(e.type));
|
||||
t.step_timeout(() => t.done(), 50);
|
||||
})
|
||||
ws.close();
|
||||
assert_false(e.wasClean, 'e.wasClean should be false');
|
||||
assert_equals(e.code, 1006, 'e.code should be 1006');
|
||||
t.done();
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -8,20 +8,20 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
// Sub-protocol matching is case-sensitive.
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/handshake_protocol', 'FOOBAR');
|
||||
var gotOpen = false;
|
||||
var gotError = false;
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
gotOpen = true;
|
||||
})
|
||||
});
|
||||
ws.onerror = t.step_func(function(e) {
|
||||
gotError = true;
|
||||
})
|
||||
});
|
||||
ws.onclose = t.step_func(function(e) {
|
||||
assert_true(gotOpen, 'got open');
|
||||
assert_false(gotOpen, 'got open');
|
||||
assert_true(gotError, 'got error');
|
||||
ws.onclose = t.unreached_func();
|
||||
t.step_timeout(() => t.done(), 50);
|
||||
})
|
||||
t.done();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue