| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../network-test.js"></script> | 4 <script src="../network-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 var image; | 6 var image; |
| 7 function loadFirstImage() { | 7 function loadFirstImage() { |
| 8 if (!window.internals) { | 8 if (!window.internals) { |
| 9 console.log("This test can not be run as window.internals is not availab
le."); | 9 console.log("This test can not be run as window.internals is not availab
le."); |
| 10 return; | 10 return; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 function step2() | 43 function step2() |
| 44 { | 44 { |
| 45 imageRequest = InspectorTest.networkRequests().pop(); | 45 imageRequest = InspectorTest.networkRequests().pop(); |
| 46 imageRequest.requestContent(step3); | 46 imageRequest.requestContent(step3); |
| 47 } | 47 } |
| 48 | 48 |
| 49 function step3() | 49 function step3() |
| 50 { | 50 { |
| 51 InspectorTest.addResult(imageRequest.url); | 51 InspectorTest.addResult(imageRequest.url); |
| 52 InspectorTest.addResult("request.type: " + imageRequest.type); | 52 InspectorTest.addResult("request.type: " + imageRequest.resourceType()); |
| 53 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); | 53 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); |
| 54 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); | 54 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); |
| 55 | 55 |
| 56 InspectorTest.addResult("Releasing cached resource."); | 56 InspectorTest.addResult("Releasing cached resource."); |
| 57 // Loading another image to the same image element so that the original
image cached resource is released. | 57 // Loading another image to the same image element so that the original
image cached resource is released. |
| 58 InspectorTest.addConsoleSniffer(step4); | 58 InspectorTest.addConsoleSniffer(step4); |
| 59 InspectorTest.evaluateInPage("loadSecondImage()"); | 59 InspectorTest.evaluateInPage("loadSecondImage()"); |
| 60 } | 60 } |
| 61 | 61 |
| 62 function step4(msg) | 62 function step4(msg) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 </script> | 94 </script> |
| 95 </head> | 95 </head> |
| 96 <body onload="runTest()"> | 96 <body onload="runTest()"> |
| 97 <p>Tests cached resource content is discarded when cached resource is destroyed
if content size is too big for the resource agent's data storage.</p> | 97 <p>Tests cached resource content is discarded when cached resource is destroyed
if content size is too big for the resource agent's data storage.</p> |
| 98 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> | 98 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> |
| 99 </body> | 99 </body> |
| 100 </html> | 100 </html> |
| 101 | 101 |
| OLD | NEW |