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

Unified 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, 6 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.html b/third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.html
new file mode 100644
index 0000000000000000000000000000000000000000..9bfaa640548fb37e10d49ce413aa99499c44b992
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+testRunner.setDumpConsoleMessages(false);
+var ws;
+function createSocket()
+{
+ ws = new WebSocket("ws://localhost:0000/WillFailToConnect");
+}
+
+function test()
+{
+ InspectorTest.eventHandler["Network.webSocketCreated"] = onWebSocketCreated;
+
+ function enableNetwork()
+ {
+ InspectorTest.log("Test started");
+ InspectorTest.sendCommand("Network.enable", {}, didEnableNetwork);
+ }
+
+ function didEnableNetwork(messageObject)
+ {
+ if (messageObject.error) {
+ InspectorTest.log("FAIL: Couldn't enable network agent" + messageObject.error.message);
+ InspectorTest.completeTest();
+ return;
+ }
+ InspectorTest.log("Network agent enabled");
+ InspectorTest.sendCommand("Runtime.evaluate", { "expression": "createSocket()"});
+ }
+
+ function onWebSocketCreated(event)
+ {
+ var initiator = event.params.initiator;
+ InspectorTest.log("");
+ InspectorTest.log("Initiator Type: " + initiator.type);
+ var stackTrace = initiator.stack;
+ for (var i = 0; i < stackTrace.callFrames.length; ++i) {
+ var frame = stackTrace.callFrames[i];
+ InspectorTest.log("Stack #" + i);
+ if (frame.lineNumber) {
+ InspectorTest.log(" functionName: " + frame.functionName);
+ InspectorTest.log(" url: " + cleanUrl(frame.url));
+ InspectorTest.log(" lineNumber: " + frame.lineNumber);
+
+ break;
+ }
+ }
+ InspectorTest.completeTest();
+ }
+
+ function cleanUrl(url)
+ {
+ url = url.match(/\/[^\/]+$/);
+ if (url.length)
+ return url[0].substr(1);
+ return url;
+ }
+
+ enableNetwork();
+}
+</script>
+</head>
+<body onload="runTest();">
+<p>Initiator for Websockets check fixes http://crbug.com/457811</p>
+</body>
« 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