Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/disable-interception-midway.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/disable-interception-midway.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/disable-interception-midway.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..11238ee53b251f263f0695ea2ed7a024eb1e3a66 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/disable-interception-midway.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 numRequests = 0; |
+ var maybeDisableRequestInterception = function(event) { |
+ numRequests++; |
+ // To make this test non-flaky wait until the first three requests have |
+ // been made before disabling. We can't wait for all for because the |
+ // scripts are blocking. |
+ if (numRequests === 3) |
+ InspectorTest.disableRequestInterception(event); |
+ }; |
+ |
+ var requestInterceptedDict = { |
+ "resource-iframe.html": InspectorTest.allowRequest, |
+ "i-dont-exist.css": maybeDisableRequestInterception, |
+ "script.js": maybeDisableRequestInterception, |
+ "script2.js": maybeDisableRequestInterception, |
+ "post-echo.pl": maybeDisableRequestInterception, |
+ }; |
+ |
+ InspectorTest.startInterceptionTest(requestInterceptedDict, 1); |
+} |
+</script> |
+</head> |
+<body onload="runTest();"> |
+<p>Tests interception blocking, modification of network fetches.</a> |
+</p> |
+</body> |
+</html> |