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 function attachIframe() | 6 function attachIframe() |
7 { | 7 { |
8 var frame = document.createElement("iframe"); | 8 var frame = document.createElement("iframe"); |
9 frame.src = "resources/memory-cached-resource.html"; | 9 frame.src = "resources/memory-cached-resource.html"; |
10 document.body.appendChild(frame); | 10 document.body.appendChild(frame); |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 function step1() | 29 function step1() |
30 { | 30 { |
31 InspectorTest.networkManager.addEventListener(WebInspector.NetworkManage
r.EventTypes.RequestFinished, onRequest); | 31 InspectorTest.networkManager.addEventListener(WebInspector.NetworkManage
r.EventTypes.RequestFinished, onRequest); |
32 InspectorTest.reloadPage(step2); | 32 InspectorTest.reloadPage(step2); |
33 } | 33 } |
34 | 34 |
35 function step2() | 35 function step2() |
36 { | 36 { |
| 37 InspectorTest.NetworkAgent.setCacheDisabled(false, step3); |
| 38 } |
| 39 |
| 40 function step3() |
| 41 { |
37 InspectorTest.evaluateInPage("attachIframe()"); | 42 InspectorTest.evaluateInPage("attachIframe()"); |
38 } | 43 } |
39 | 44 |
40 function onRequest() | 45 function onRequest() |
41 { | 46 { |
42 if (!finished && findResource(/abe\.png/, 200, false) && findResource(/a
be\.png/, 200, true)) { | 47 if (!finished && findResource(/abe\.png/, 200, false) && findResource(/a
be\.png/, 200, true)) { |
43 finished = true; | 48 finished = true; |
44 InspectorTest.addResult("Memory-cached resource found."); | 49 InspectorTest.addResult("Memory-cached resource found."); |
45 step3(); | 50 InspectorTest.completeTest(); |
46 } | 51 } |
47 } | 52 } |
48 | |
49 function step3() | |
50 { | |
51 InspectorTest.NetworkAgent.setCacheDisabled(false, step4); | |
52 } | |
53 | |
54 function step4(msg) | |
55 { | |
56 InspectorTest.completeTest(); | |
57 } | |
58 } | 53 } |
59 </script> | 54 </script> |
60 </head> | 55 </head> |
61 <body onload="runTest()"> | 56 <body onload="runTest()"> |
62 <p>Tests that memory-cached resources are correctly reported.</p> | 57 <p>Tests that memory-cached resources are correctly reported.</p> |
63 <img src="resources/abe.png"> | 58 <img src="resources/abe.png"> |
64 </body> | 59 </body> |
65 </html> | 60 </html> |
OLD | NEW |