Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d

This commit is contained in:
WPT Sync Bot 2018-07-18 15:43:58 +00:00 committed by Tom Servo
parent c45192614c
commit 775b784f79
2144 changed files with 58115 additions and 29658 deletions

View file

@ -4,7 +4,15 @@ async_test(t => {
function workerCode() {
close();
var ws = new WebSocket(self.location.origin.replace('http', 'ws'));
postMessage(ws.readyState == WebSocket.CONNECTING);
var data = {
originalState: ws.readyState,
afterCloseState: null
};
ws.close();
data.afterCloseState = ws.readyState;
postMessage(data);
}
var workerBlob = new Blob([workerCode.toString() + ";workerCode();"], {
@ -12,8 +20,9 @@ async_test(t => {
});
var w = new Worker(URL.createObjectURL(workerBlob));
w.onmessage = function(e) {
assert_true(e.data, "WebSocket created on worker shutdown.");
w.onmessage = t.step_func(function(e) {
assert_equals(e.data.originalState, WebSocket.CONNECTING, "WebSocket created on worker shutdown is in connecting state.");
assert_equals(e.data.afterCloseState, WebSocket.CLOSING, "Closed WebSocket created on worker shutdown is in closing state.");
t.done();
}
});
}, 'WebSocket created after a worker self.close()');