Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..65a33dde8a667ad000c481de631b6a39450f3317 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception.html |
@@ -0,0 +1,42 @@ |
+<html> |
+<head> |
+<script type="text/javascript" src="../inspector-protocol-test.js"></script> |
+<script type="text/javascript" src="interception-test.js"></script> |
+ |
+<script> |
+function appendIframe() |
+{ |
+ var iframe = document.createElement("iframe"); |
+ iframe.src = "resources/resource-iframe.html"; |
+ document.body.appendChild(iframe); |
+} |
+ |
+function test() |
+{ |
+ var requestInterceptedDict = { |
+ "resource-iframe.html": InspectorTest.allowRequest, |
+ "i-dont-exist.css": function(event) { |
+ InspectorTest.modifyRequest(event, {"url": "test.css"}); |
+ }, |
+ "script.js": function(event) { |
+ InspectorTest.blockRequest(event, "ConnectionFailed"); |
+ }, |
+ "script2.js": function(event) { |
+ var rawResponse = |
+ "HTTP/1.1 200 OK\r\n" + |
+ "Content-Type: application/javascript\r\n\r\n" + |
+ "console.log('Hello from the mock resource');"; |
+ InspectorTest.mockResponse(event, rawResponse); |
+ }, |
+ "post-echo.pl": InspectorTest.allowRequest, |
+ }; |
+ |
+ InspectorTest.startInterceptionTest(requestInterceptedDict, 2); |
+} |
+</script> |
+</head> |
+<body onload="runTest();"> |
+<p>Tests interception blocking, modification of network fetches.</a> |
+</p> |
+</body> |
+</html> |