| <html> |
| <head> |
| <script src="../inspector-test.js"></script> |
| <script src="../network-test.js"></script> |
| <script> |
| function loadData() |
| { |
| var image = new Image(); |
| image.src = "resources/404.php"; |
| image.onerror = resourceLoaded; |
| } |
| |
| function resourceLoaded() |
| { |
| console.log("Done."); |
| } |
| |
| function test() |
| { |
| // Since this test could be run together with other inspector backend cache |
| // tests, we need to reset size limits to default ones. |
| InspectorTest.resetInspectorResourcesData(step1); |
| |
| function step1() |
| { |
| InspectorTest.addConsoleSniffer(step2); |
| InspectorTest.evaluateInPage("loadData()"); |
| } |
| |
| function step2() |
| { |
| var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1]; |
| InspectorTest.addResult(request1.url); |
| InspectorTest.addResult("resource.type: " + request1.type); |
| InspectorTest.addResult("resource.content before requesting content: " + request1.content); |
| InspectorTest.assertTrue(!request1.failed, "Resource loading failed."); |
| request1.requestContent(step3); |
| } |
| |
| function step3() |
| { |
| var request1 = WebInspector.panel("network").requests[WebInspector.panel("network").requests.length - 1]; |
| InspectorTest.addResult("resource.content after requesting content: " + request1.content); |
| |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>Tests content is available for failed image request.</p> |
| <a href="https://bugs.webkit.org/show_bug.cgi?id=84265">Bug 84265</a> |
| </body> |
| </html> |