| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="/inspector/inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="/inspector/timeline-test.js"></script> | 4 <script src="../timeline-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function performActions() | 7 function performActions(callback) |
| 8 { | 8 { |
| 9 var ws = new WebSocket("ws://127.0.0.1:8880/simple"); | 9 var ws = new WebSocket("ws://127.0.0.1:8880/simple"); |
| 10 ws.onclose = callback; |
| 10 } | 11 } |
| 11 | 12 |
| 12 function test() | 13 function test() |
| 13 { | 14 { |
| 14 InspectorTest.startTimeline(function() { | 15 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 15 InspectorTest.evaluateInPage("performActions()"); | |
| 16 }); | |
| 17 | |
| 18 InspectorTest.waitForRecordType("WebSocketDestroy", finish); | |
| 19 | 16 |
| 20 function finish() | 17 function finish() |
| 21 { | 18 { |
| 22 InspectorTest.printTimelineRecords("WebSocketCreate"); | 19 InspectorTest.printTimelineRecords("WebSocketCreate"); |
| 23 InspectorTest.printTimelineRecords("WebSocketSendHandshakeRequest"); | 20 InspectorTest.printTimelineRecords("WebSocketSendHandshakeRequest"); |
| 24 InspectorTest.printTimelineRecords("WebSocketReceiveHandshakeResponse"); | 21 InspectorTest.printTimelineRecords("WebSocketReceiveHandshakeResponse"); |
| 25 InspectorTest.printTimelineRecords("WebSocketDestroy"); | 22 InspectorTest.printTimelineRecords("WebSocketDestroy"); |
| 26 InspectorTest.completeTest(); | 23 InspectorTest.completeTest(); |
| 27 } | 24 } |
| 28 } | 25 } |
| 29 | 26 |
| 30 if (!window.testRunner) | 27 if (!window.testRunner) |
| 31 setTimeout(performActions, 2000); | 28 setTimeout(performActions, 2000); |
| 32 | 29 |
| 33 </script> | 30 </script> |
| 34 </head> | 31 </head> |
| 35 | 32 |
| 36 <body onload="runTest()"> | 33 <body onload="runTest()"> |
| 37 <p> | 34 <p> |
| 38 Tests the Timeline events for WebSocket | 35 Tests the Timeline events for WebSocket |
| 39 </p> | 36 </p> |
| 40 | 37 |
| 41 </body> | 38 </body> |
| 42 </html> | 39 </html> |
| OLD | NEW |