blob: faf824c55c1585cbbca9f16a98b800e97fe67da5 [file] [log] [blame]
Philip Jägenstedtc053f402014-01-22 17:02:181<!DOCTYPE html>
2<html>
3<head>
4 <title>W3C WebSocket API - Close WebSocket - Reason with unpaired surrogates</title>
5 <script type="text/javascript" src="/resources/testharness.js"></script>
6 <script type="text/javascript" src="/resources/testharnessreport.js"></script>
7 <script type="text/javascript" src="websocket.js?pipe=sub"></script>
8</head>
9<body>
10 <div id="log"></div>
11 <script type="text/javascript">
12
13 var testOpen = async_test("W3C WebSocket API - Create WebSocket - Close the Connection - close(reason with unpaired surrogates) - connection should get opened");
14 var testClose = async_test("W3C WebSocket API - Create WebSocket - Close the Connection - close(reason with unpaired surrogates) - connection should get closed");
15
16 var wsocket = CreateWebSocket(false, false, false);
17 var isOpenCalled = false;
18 var reason = "\uD807";
19
20 wsocket.addEventListener('open', testOpen.step_func(function (evt) {
21 wsocket.close(1000, reason);
22 isOpenCalled = true;
23 testOpen.done();
24 }), true);
25
26 wsocket.addEventListener('close', testClose.step_func(function (evt) {
27 assert_true(isOpenCalled, "WebSocket connection should be opened");
28 testClose.done();
29 }), true);
30
31 </script>
32
33</body>
34</html>