| 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 image = new Image(); | 8 image = new Image(); |
| 9 image.onload = firstImageLoaded; | 9 image.onload = firstImageLoaded; |
| 10 document.body.appendChild(image); | 10 document.body.appendChild(image); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 function step2() | 48 function step2() |
| 49 { | 49 { |
| 50 imageRequest = InspectorTest.networkRequests().pop(); | 50 imageRequest = InspectorTest.networkRequests().pop(); |
| 51 imageRequest.requestContent(step3); | 51 imageRequest.requestContent(step3); |
| 52 } | 52 } |
| 53 | 53 |
| 54 var originalContentLength; | 54 var originalContentLength; |
| 55 function step3() | 55 function step3() |
| 56 { | 56 { |
| 57 InspectorTest.addResult(imageRequest.url); | 57 InspectorTest.addResult(imageRequest.url); |
| 58 InspectorTest.addResult("request.type: " + imageRequest.type); | 58 InspectorTest.addResult("request.type: " + imageRequest.resourceType()); |
| 59 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); | 59 InspectorTest.addResult("request.content.length after requesting content
: " + imageRequest.content.length); |
| 60 originalContentLength = imageRequest.content.length; | 60 originalContentLength = imageRequest.content.length; |
| 61 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); | 61 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be
fore destroying CachedResource."); |
| 62 | 62 |
| 63 InspectorTest.addResult("Releasing cached resource."); | 63 InspectorTest.addResult("Releasing cached resource."); |
| 64 // Loading another image to the same image element so that the original
image cached resource is released. | 64 // Loading another image to the same image element so that the original
image cached resource is released. |
| 65 InspectorTest.addConsoleSniffer(step4); | 65 InspectorTest.addConsoleSniffer(step4); |
| 66 InspectorTest.evaluateInPage("loadSecondImage()"); | 66 InspectorTest.evaluateInPage("loadSecondImage()"); |
| 67 } | 67 } |
| 68 | 68 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 </script> | 103 </script> |
| 104 </head> | 104 </head> |
| 105 <body onload="runTest()"> | 105 <body onload="runTest()"> |
| 106 <p>Tests content is moved from cached resource to resource agent's data storage
when cached resource is destroyed.</p> | 106 <p>Tests content is moved from cached resource to resource agent's data storage
when cached resource is destroyed.</p> |
| 107 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> | 107 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> |
| 108 </body> | 108 </body> |
| 109 </html> | 109 </html> |
| 110 | 110 |
| OLD | NEW |