| <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> |