| 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 | 7 |
| 8 function loadFirstImage() | 8 function loadFirstImage() |
| 9 { | 9 { |
| 10 image = new Image(); | 10 image = new Image(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 InspectorTest.evaluateInPage("loadFirstImage()"); | 37 InspectorTest.evaluateInPage("loadFirstImage()"); |
| 38 | 38 |
| 39 function step2() | 39 function step2() |
| 40 { | 40 { |
| 41 imageRequest = InspectorTest.networkRequests().pop(); | 41 imageRequest = InspectorTest.networkRequests().pop(); |
| 42 imageRequest.requestContent().then(step3); | 42 imageRequest.requestContent().then(step3); |
| 43 } | 43 } |
| 44 | 44 |
| 45 function step3() | 45 function step3() |
| 46 { | 46 { |
| 47 InspectorTest.addResult(imageRequest.url); | 47 InspectorTest.addResult(imageRequest.url()); |
| 48 InspectorTest.addResult("request.type: " + imageRequest.resourceType()); | 48 InspectorTest.addResult("request.type: " + imageRequest.resourceType()); |
| 49 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); | 49 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); |
| 50 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); | 50 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); |
| 51 | 51 |
| 52 InspectorTest.addResult("Releasing cached resource."); | 52 InspectorTest.addResult("Releasing cached resource."); |
| 53 // Loading another image to the same image element so that the original
image cached resource is released. | 53 // Loading another image to the same image element so that the original
image cached resource is released. |
| 54 InspectorTest.addConsoleSniffer(step4); | 54 InspectorTest.addConsoleSniffer(step4); |
| 55 InspectorTest.evaluateInPage("loadSecondImage()"); | 55 InspectorTest.evaluateInPage("loadSecondImage()"); |
| 56 } | 56 } |
| 57 | 57 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 </script> | 85 </script> |
| 86 </head> | 86 </head> |
| 87 <body onload="runTest()"> | 87 <body onload="runTest()"> |
| 88 <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> | 88 <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> |
| 89 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> | 89 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> |
| 90 </body> | 90 </body> |
| 91 </html> | 91 </html> |
| 92 | 92 |
| OLD | NEW |