1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <link rel="stylesheet" href="../../../../js-test-resources/js-test-style.css">
5 <script src="../../../../js-test-resources/js-test-pre.js"></script>
8 <div id="description"></div>
9 <div id="console"></div>
10 <script type="text/javascript">
11 description("Make sure handshake with URL with credentail info success.");
13 window.jsTestIsAsync = true;
14 if (window.layoutTestController)
15 layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
17 var url = "ws://user:pass@127.0.0.1:8880/websocket/tests/hybi/echo-location";
18 var handshake_success = false;
23 clearTimeout(timeoutID);
24 shouldBeTrue("handshake_success");
25 shouldBe("ws_location", '"ws://127.0.0.1:8880/websocket/tests/hybi/echo-location"');
30 var ws = new WebSocket(url);
31 ws.onopen = function () {
32 debug("WebSocket is open");
33 handshake_success = true;
35 ws.onmessage = function (evt) {
36 ws_location = evt.data;
37 debug("received:" + ws_location);
40 ws.onclose = function () {
41 debug("WebSocket is closed");
44 var timeoutID = setTimeout("endTest()", 2000);
46 var successfullyParsed = true;
48 <script src="../../../../js-test-resources/js-test-post.js"></script>