mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d
This commit is contained in:
parent
c45192614c
commit
775b784f79
2144 changed files with 58115 additions and 29658 deletions
|
@ -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()');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue