| 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 test() |
| 19 { |
| 20 InspectorTest.evaluateInPageAsync("addScript()").then(step2); |
| 21 |
| 22 function step2() |
| 23 { |
| 24 var resource = InspectorTest.resourceTreeModel.resourceForURL("http://12
7.0.0.1:8000/inspector/resource-tree/resources/script-with-constant-last-modifie
d.php"); |
| 25 if (!resource) { |
| 26 InspectorTest.addResult("ERROR: Failed to find resource."); |
| 27 InspectorTest.completeTest(); |
| 28 return; |
| 29 } |
| 30 InspectorTest.addResult("Last modified: " + (resource.lastModified() ? r
esource.lastModified().toISOString() : null)); |
| 31 InspectorTest.addResult("Content size: " + resource.contentSize()); |
| 32 |
| 33 InspectorTest.completeTest(); |
| 34 } |
| 35 } |
| 36 </script> |
| 37 </head> |
| 38 <body onload="runTest()"> |
| 39 <p>Verify that dynamically added resource has metadata.</p> |
| 40 </body> |
| 41 </html> |
| OLD | NEW |