Revision a72a06f7e3d919f8d4f08cb3171291cf6482fd85 authored by Simon Pieters on 08 June 2018, 15:54:45 UTC, committed by Simon Pieters on 08 June 2018, 15:54:45 UTC
Part of https://github.com/whatwg/html/pull/3499. This does not yet test :heading().
1 parent 7684fe3
Secure-Close-1000-verify-code.any.js
// META: script=websocket.sub.js
var testOpen = async_test("W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - Connection should be opened");
var testClose = async_test("W3C WebSocket API - Create Secure WebSocket - Close the Connection - close(1000, reason) - event.code == 1000 and event.reason = 'Clean Close'");
var wsocket = CreateWebSocket(true, false, false);
var isOpenCalled = false;
wsocket.addEventListener('open', testOpen.step_func(function(evt) {
wsocket.close(1000, "Clean Close");
isOpenCalled = true;
testOpen.done();
}), true);
wsocket.addEventListener('close', testClose.step_func(function(evt) {
assert_true(isOpenCalled, "WebSocket connection should be open");
assert_equals(evt.code, 1000, "CloseEvent.code should be 1000");
assert_equals(evt.reason, "Clean Close", "CloseEvent.reason should be the same as the reason sent in close");
testClose.done();
}), true);
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...