OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="/inspector/inspector-test.js"></script> |
| 4 <script src="/inspector/network-test.js"></script> |
| 5 <script> |
| 6 async function test() { |
| 7 InspectorTest.recordNetwork(); |
| 8 |
| 9 const wsUrl = "ws://localhost:8880/echo"; |
| 10 const networkLogView = UI.panels.network._networkLogView; |
| 11 const dataGrid = networkLogView._dataGrid; |
| 12 await InspectorTest.evaluateInPagePromise("ws = new WebSocket('" + wsUrl + "
')"); |
| 13 var websocketRequest = InspectorTest.findRequestsByURLPattern(createPlainTex
tSearchRegex(wsUrl))[0]; |
| 14 await InspectorTest.waitForRequestResponse(websocketRequest); |
| 15 var node = await InspectorTest.waitForNetworkLogViewNodeForRequest(websocket
Request); |
| 16 networkLogView._refresh(); |
| 17 node.select(); |
| 18 logSelectedNode(); |
| 19 |
| 20 InspectorTest.addResult("Sending Websocket frame"); |
| 21 await InspectorTest.evaluateInPagePromise("ws.send('test')"); |
| 22 await InspectorTest.waitForWebsocketFrameReceived(websocketRequest, "test"); |
| 23 networkLogView._refresh(); |
| 24 InspectorTest.addResult("Websocket Frame Received"); |
| 25 logSelectedNode(); |
| 26 |
| 27 InspectorTest.completeTest(); |
| 28 |
| 29 function logSelectedNode() { |
| 30 InspectorTest.addResult("Selected Request: " + (dataGrid.selectedNode &&
dataGrid.selectedNode.request().url()) || ''); |
| 31 } |
| 32 } |
| 33 </script> |
| 34 </head> |
| 35 <body onload="runTest()"> |
| 36 <p>Tests that WebSocket network requests do not loose focus on frame being recei
ved.</p> |
| 37 </body> |
| 38 </html> |
OLD | NEW |