Send ArrayBuffer, not Uint8Array in tests

This matches the true contents of a WebSocket 'message' event, so should
be a more realistic test.
This commit is contained in:
Pierre Ossman 2023-05-15 20:01:10 +02:00
parent 775ccaa74c
commit 9b115a4485
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ export default class FakeWebSocket {
// Break apart the data to expose bugs where we assume data is
// neatly packaged
for (let i = 0;i < data.length;i++) {
let buf = data.subarray(i, i+1);
this.onmessage(new MessageEvent("message", { 'data': buf }));
let buf = data.slice(i, i+1);
this.onmessage(new MessageEvent("message", { 'data': buf.buffer }));
}
}
}