Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ArrayBuffer and ArrayBufferView variants of WebSocket::Send #14761

Closed
jdm opened this issue Dec 28, 2016 · 4 comments
Closed

Implement ArrayBuffer and ArrayBufferView variants of WebSocket::Send #14761

jdm opened this issue Dec 28, 2016 · 4 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Dec 28, 2016

https://dxr.mozilla.org/servo/source/tests/wpt/web-platform-tests/websockets/binary/004.html fails with:

WebSockets: Send/Receive ArrayBuffer, size greater than network array buffer
----------------------------------------------------------------------------
Expected PASS, got FAIL
assert_equals: expected (number) 100000 but got (undefined) undefined

This corresponds to assert_equals(e.data.byteLength, datasize); in the test, where e.data is supposed to be an ArrayBuffer object. console.log(e.data) shows [object ArrayBuffer], while console.log(e.data.byteLength) shows undefined, and console.log(Object.getPrototypeOf(e.data)) shows the empty string. I am very confused by these results.

@jdm
Copy link
Member Author

@jdm jdm commented Dec 28, 2016

I figured it out - all of the arraybuffer tests provide arraybuffers as input, but we haven't implemented that yet so they get converted to strings. This means that the tests all send input which is the stringified arraybuffer object, so they receive a string like [object ArrayBuffer] instead of binary data that gets converted into an arraybuffer object.

@jdm jdm changed the title Websocket tests that use arraybuffers fail because the result objects don't behave correctly Implement ArrayBuffer and ArrayBufferView variants of WebSocket::Send Dec 28, 2016
@jdm jdm added E-less easy and removed E-less easy labels Dec 28, 2016
@jdm
Copy link
Member Author

@jdm jdm commented Dec 28, 2016

This needs to wait until #5014, unfortunately. I don't think we can handle overloads of webidl methods that include object types.

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Dec 28, 2016

We probably could, but would need to handle interface types manually... Not sure if the distinction would be detectable.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 23, 2018

Duplicate of #20347.

@jdm jdm closed this Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.