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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/ping-redirect.html

Issue 2586063002: DevTools: Show redirects from navigator.sendBeacon() (Closed)
Patch Set: corrected m_frame->frame() Created 3 years, 11 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
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/ping-redirect.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/ping-redirect.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/ping-redirect.html
new file mode 100644
index 0000000000000000000000000000000000000000..ac1c4564db71f8d95ed1fd700abe1008f954aa82
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/ping-redirect.html
@@ -0,0 +1,46 @@
+<html>
+<head>
+<script src="inspector-protocol-test.js"></script>
+<script>
+function sendBeacon()
+{
+ navigator.sendBeacon("resources/ping-redirect.php", "foo");
+}
+
+function test()
+{
+ var requestSent = 0;
+ InspectorTest.eventHandler["Network.requestWillBeSent"] = onRequestWillBeSent;
+ enableNetwork();
+
+ function enableNetwork()
+ {
+ InspectorTest.sendCommandOrDie("Network.enable", {}, didEnableNetwork);
+ }
+
+ function didEnableNetwork()
+ {
+ InspectorTest.evaluateInPage("sendBeacon()");
+ }
+
+ function onRequestWillBeSent(event)
+ {
+ requestSent++;
+ var params = event.params;
+ InspectorTest.log("Request Sent: " + InspectorTest.parseURL(params.request.url).path);
+ if (requestSent == 2) {
+ var redirectSource = "";
+ if (params.redirectResponse)
+ redirectSource = InspectorTest.parseURL(params.redirectResponse.url).path;
+ InspectorTest.log("Redirect Source: " + redirectSource);
+ InspectorTest.completeTest();
+ }
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests that redirect from navigator.sendBeacon() is recorded.</p>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698