Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / handshake-fail-by-prepended-null.html
blob11423ffb1415256b608815121b3320405c5d8a15
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description('Connection should fail immediately, rather than succeeding or staying in limbo until timeout, if a null byte is received before the handshake.');
12 window.jsTestIsAsync = true;
14 var timedOut = false;
15 var connected = false;
16 var origin;
18 function endTest() {
19 shouldBeFalse('timedOut');
20 shouldBeFalse('connected');
21 shouldBeUndefined('origin');
22 clearTimeout(timeoutID);
23 finishJSTest();
26 var url = 'ws://localhost:8880/handshake-fail-by-prepended-null';
27 var ws = new WebSocket(url);
29 ws.onopen = function()
31 debug('Connected');
32 connected = true;
35 ws.onmessage = function(messageEvent)
37 origin = messageEvent.data;
38 debug('origin = ' + origin);
39 ws.close();
42 ws.onclose = function()
44 endTest();
47 ws.onerror = function(errorEvent)
49 testPassed("onerror() was called");
52 function timeoutCallback()
54 debug('Timed out (state = ' + ws.readyState + ')');
55 timedOut = true;
56 endTest();
59 var timeoutID = setTimeout(timeoutCallback, 3000);
61 </script>
62 </body>
63 </html>