Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.html

Issue 2094903002: [Devtools] Fixed websocket initiators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More Flaky fixes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></s cript>
5 <script>
6 testRunner.setDumpConsoleMessages(false);
7 var ws;
8 function createSocket()
9 {
10 ws = new WebSocket("ws://localhost:0000/WillFailToConnect");
11 }
12
13 function test()
14 {
15 InspectorTest.eventHandler["Network.webSocketCreated"] = onWebSocketCreated;
16
17 function enableNetwork()
18 {
19 InspectorTest.log("Test started");
20 InspectorTest.sendCommand("Network.enable", {}, didEnableNetwork);
21 }
22
23 function didEnableNetwork(messageObject)
24 {
25 if (messageObject.error) {
26 InspectorTest.log("FAIL: Couldn't enable network agent" + messageObj ect.error.message);
27 InspectorTest.completeTest();
28 return;
29 }
30 InspectorTest.log("Network agent enabled");
31 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "createSoc ket()"});
32 }
33
34 function onWebSocketCreated(event)
35 {
36 var initiator = event.params.initiator;
37 InspectorTest.log("");
38 InspectorTest.log("Initiator Type: " + initiator.type);
39 var stackTrace = initiator.stack;
40 for (var i = 0; i < stackTrace.callFrames.length; ++i) {
41 var frame = stackTrace.callFrames[i];
42 InspectorTest.log("Stack #" + i);
43 if (frame.lineNumber) {
44 InspectorTest.log(" functionName: " + frame.functionName);
45 InspectorTest.log(" url: " + cleanUrl(frame.url));
46 InspectorTest.log(" lineNumber: " + frame.lineNumber);
47
48 break;
49 }
50 }
51 InspectorTest.completeTest();
52 }
53
54 function cleanUrl(url)
55 {
56 url = url.match(/\/[^\/]+$/);
57 if (url.length)
58 return url[0].substr(1);
59 return url;
60 }
61
62 enableNetwork();
63 }
64 </script>
65 </head>
66 <body onload="runTest();">
67 <p>Initiator for Websockets check fixes http://crbug.com/457811</p>
68 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698