| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../network-test.js"></script> |
| 5 <script> |
| 6 function addScript() |
| 7 { |
| 8 var fulfill; |
| 9 var promise = new Promise(x => fulfill = x); |
| 10 var script = document.createElement("script"); |
| 11 script.type = "text/javascript"; |
| 12 script.src = "resources/script-with-constant-last-modified.php"; |
| 13 script.onload = fulfill; |
| 14 document.body.appendChild(script); |
| 15 return promise; |
| 16 } |
| 17 |
| 18 function addScriptAndRunTest() |
| 19 { |
| 20 if (window.testRunner) |
| 21 testRunner.waitUntilDone(); |
| 22 addScript().then(() => runTest()); |
| 23 } |
| 24 |
| 25 function test() |
| 26 { |
| 27 var resource = InspectorTest.resourceTreeModel.resourceForURL("http://127.0.
0.1:8000/inspector/resource-tree/resources/script-with-constant-last-modified.ph
p"); |
| 28 if (!resource) { |
| 29 InspectorTest.addResult("ERROR: Failed to find resource."); |
| 30 InspectorTest.completeTest(); |
| 31 return; |
| 32 } |
| 33 InspectorTest.addResult("Last modified: " + (resource.lastModified() ? resou
rce.lastModified().toISOString() : null)); |
| 34 InspectorTest.addResult("Content size: " + resource.contentSize()); |
| 35 |
| 36 InspectorTest.completeTest(); |
| 37 } |
| 38 </script> |
| 39 </head> |
| 40 <body onload="addScriptAndRunTest()"> |
| 41 <p>Verify that cached resource has metadata.</p> |
| 42 </body> |
| 43 </html> |
| OLD | NEW |