OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script type="text/javascript" src="../inspector-protocol-test.js"></script> |
| 4 <script type="text/javascript" src="interception-test.js"></script> |
| 5 |
| 6 <script> |
| 7 function appendIframe() |
| 8 { |
| 9 var iframe = document.createElement("iframe"); |
| 10 iframe.src = "resources/resource-iframe.html"; |
| 11 document.body.appendChild(iframe); |
| 12 } |
| 13 |
| 14 function test() |
| 15 { |
| 16 var numRequests = 0; |
| 17 var maybeDisableRequestInterception = function(event) { |
| 18 numRequests++; |
| 19 // To make this test non-flaky wait until the first three requests have |
| 20 // been made before disabling. We can't wait for all for because the |
| 21 // scripts are blocking. |
| 22 if (numRequests === 3) |
| 23 InspectorTest.disableRequestInterception(event); |
| 24 }; |
| 25 |
| 26 var requestInterceptedDict = { |
| 27 "resource-iframe.html": InspectorTest.allowRequest, |
| 28 "i-dont-exist.css": maybeDisableRequestInterception, |
| 29 "script.js": maybeDisableRequestInterception, |
| 30 "script2.js": maybeDisableRequestInterception, |
| 31 "post-echo.pl": maybeDisableRequestInterception, |
| 32 }; |
| 33 |
| 34 InspectorTest.startInterceptionTest(requestInterceptedDict, 1); |
| 35 } |
| 36 </script> |
| 37 </head> |
| 38 <body onload="runTest();"> |
| 39 <p>Tests interception blocking, modification of network fetches.</a> |
| 40 </p> |
| 41 </body> |
| 42 </html> |
OLD | NEW |