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 requestInterceptedDict = { |
| 17 "resource-iframe.html": InspectorTest.allowRequest, |
| 18 "i-dont-exist.css": function(event) { |
| 19 InspectorTest.modifyRequest(event, {"url": "test.css"}); |
| 20 }, |
| 21 "script.js": function(event) { |
| 22 InspectorTest.blockRequest(event, "ConnectionFailed"); |
| 23 }, |
| 24 "script2.js": function(event) { |
| 25 var rawResponse = |
| 26 "HTTP/1.1 200 OK\r\n" + |
| 27 "Content-Type: application/javascript\r\n\r\n" + |
| 28 "console.log('Hello from the mock resource');"; |
| 29 InspectorTest.mockResponse(event, rawResponse); |
| 30 }, |
| 31 "post-echo.pl": InspectorTest.allowRequest, |
| 32 }; |
| 33 |
| 34 InspectorTest.startInterceptionTest(requestInterceptedDict, 2); |
| 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 |