summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html')
-rw-r--r--testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html b/testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html
new file mode 100644
index 000000000..f4a4850d6
--- /dev/null
+++ b/testing/web-platform/tests/websockets/interfaces/WebSocket/events/010.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>WebSockets: setting event handlers to undefined</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=../../../constants.js?pipe=sub></script>
+<meta name="variant" content="">
+<meta name="variant" content="?wss">
+<div id=log></div>
+<script>
+var events = ['onclose', 'onopen', 'onerror', 'onmessage'];
+for (var i = 0; i < events.length; ++i) {
+ test(function(){
+ var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/empty-message');
+ var foo = function() {}
+ ws[events[i]] = foo;
+ assert_equals(ws[events[i]], foo, events[i]);
+ ws[events[i]] = undefined;
+ assert_equals(ws[events[i]], null, events[i]);
+ });
+}
+</script>