Implement WebSocket#onmessage.

This commit is contained in:
Ms2ger 2015-08-07 11:12:22 +02:00
parent 2a97ab36f7
commit 352229b6fa
28 changed files with 10 additions and 151 deletions

View file

@ -26,7 +26,7 @@ interface WebSocket : EventTarget {
[Throws] void close([Clamp] optional unsigned short code, optional USVString reason);
//messaging
//attribute EventHandler onmessage;
attribute EventHandler onmessage;
//attribute BinaryType binaryType;
[Throws] void send(optional USVString data);
//void send(Blob data);

View file

@ -224,6 +224,7 @@ impl<'a> WebSocketMethods for &'a WebSocket {
event_handler!(open, GetOnopen, SetOnopen);
event_handler!(close, GetOnclose, SetOnclose);
event_handler!(error, GetOnerror, SetOnerror);
event_handler!(message, GetOnmessage, SetOnmessage);
// https://html.spec.whatwg.org/multipage/#dom-websocket-url
fn Url(self) -> DOMString {

View file

@ -8322,9 +8322,6 @@
[WebSocket interface: attribute protocol]
expected: FAIL
[WebSocket interface: attribute onmessage]
expected: FAIL
[WebSocket interface: attribute binaryType]
expected: FAIL

View file

@ -1,6 +1,5 @@
[001.html]
type: testharness
expected: TIMEOUT
[WebSockets: Send/Receive blob, blob size less than network array buffer]
expected: TIMEOUT
expected: FAIL

View file

@ -1,5 +1,5 @@
[002.html]
type: testharness
[WebSockets: Send/Receive blob, blob size greater than network array buffer]
expected: TIMEOUT
expected: FAIL

View file

@ -1,5 +1,5 @@
[004.html]
type: testharness
[WebSockets: Send/Receive ArrayBuffer, size greater than network array buffer]
expected: TIMEOUT
expected: FAIL

View file

@ -1,6 +1,5 @@
[005.html]
type: testharness
expected: TIMEOUT
[WebSockets: Send/Receive ArrayBuffer, size less than network array buffer]
expected: TIMEOUT
expected: FAIL

View file

@ -1,5 +0,0 @@
[013.html]
type: testharness
[WebSockets: multiple WebSocket objects]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[018.html]
type: testharness
[WebSockets: NULL char in url]
expected: FAIL

View file

@ -1,6 +1,5 @@
[005.html]
type: testharness
expected: TIMEOUT
[WebSockets: setting HttpOnly cookies in ws response, checking ws request]
expected: TIMEOUT
expected: FAIL

View file

@ -1,5 +0,0 @@
[006.html]
type: testharness
[WebSockets: setting Secure cookie with document.cookie, checking ws request]
expected: FAIL

View file

@ -1,5 +0,0 @@
[eventhandlers.html]
type: testharness
[Event handler for message should have [TreatNonCallableAsNull\]]
expected: FAIL

View file

@ -1,14 +0,0 @@
[extended-payload-length.html]
type: testharness
[Application data is 125 byte which means any 'Extended payload length' field isn't used at all.]
expected: TIMEOUT
[Application data is 126 byte which starts to use the 16 bit 'Extended payload length' field.]
expected: TIMEOUT
[Application data is 0xFFFF byte which means the upper bound of the 16 bit 'Extended payload length' field.]
expected: TIMEOUT
[Application data is (0xFFFF + 1) byte which starts to use the 64 bit 'Extended payload length' field]
expected: TIMEOUT

View file

@ -15,9 +15,6 @@
[WebSocket interface: attribute protocol]
expected: FAIL
[WebSocket interface: attribute onmessage]
expected: FAIL
[WebSocket interface: attribute binaryType]
expected: FAIL
@ -45,9 +42,6 @@
[WebSocket interface: new WebSocket("ws://foo") must inherit property "protocol" with the proper type (11)]
expected: FAIL
[WebSocket interface: new WebSocket("ws://foo") must inherit property "onmessage" with the proper type (13)]
expected: FAIL
[WebSocket interface: new WebSocket("ws://foo") must inherit property "binaryType" with the proper type (14)]
expected: FAIL

View file

@ -1,5 +0,0 @@
[clean-close.html]
type: testharness
[WebSockets: wasClean, true]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[001.html]
type: testharness
[WebSockets: getting on* 1]
expected: FAIL

View file

@ -1,5 +0,0 @@
[006.html]
type: testharness
[WebSockets: 'on*' in ws]
expected: FAIL

View file

@ -1,5 +0,0 @@
[007.html]
type: testharness
[WebSockets: listening for events with onmessage]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[010.html]
type: testharness
[WebSockets: setting event handlers to undefined 3]
expected: FAIL

View file

@ -1,5 +0,0 @@
[011.html]
type: testharness
[onmessage]
expected: FAIL

View file

@ -1,5 +0,0 @@
[012.html]
type: testharness
[onmessage]
expected: FAIL

View file

@ -9,3 +9,6 @@
[onerror]
expected: FAIL
[onmessage]
expected: FAIL

View file

@ -1,5 +0,0 @@
[016.html]
type: testharness
[WebSockets: addEventListener]
expected: FAIL

View file

@ -1,6 +0,0 @@
[006.html]
type: testharness
expected: TIMEOUT
[WebSockets: send() with unpaired surrogate when readyState is OPEN]
expected: TIMEOUT

View file

@ -1,36 +0,0 @@
[010.html]
type: testharness
expected: TIMEOUT
[Constructor succeeds]
expected: TIMEOUT
[WebSockets: sending non-strings (null)]
expected: NOTRUN
[WebSockets: sending non-strings (undefined)]
expected: NOTRUN
[WebSockets: sending non-strings (1)]
expected: NOTRUN
[WebSockets: sending non-strings ([object Window\])]
expected: NOTRUN
[WebSockets: sending non-strings ([object HTMLBodyElement\])]
expected: NOTRUN
[WebSockets: sending non-strings ([object Object\])]
expected: NOTRUN
[WebSockets: sending non-strings ()]
expected: NOTRUN
[WebSockets: sending non-strings ([object WebSocket\])]
expected: NOTRUN
[WebSockets: sending non-strings (function (){})]
expected: NOTRUN
[WebSockets: sending non-strings (Error)]
expected: NOTRUN

View file

@ -1,6 +0,0 @@
[011.html]
type: testharness
expected: TIMEOUT
[WebSockets: sending non-ascii, combining chars and non-BMP]
expected: TIMEOUT

View file

@ -1,6 +0,0 @@
[012.html]
type: testharness
expected: TIMEOUT
[WebSockets: sending null]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[001.html]
type: testharness
[WebSockets: 20s inactivity after handshake]
expected: TIMEOUT