OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 4 <script> |
| 5 function test() |
| 6 { |
| 7 function testLoadForURL(url, next) |
| 8 { |
| 9 var documentURL = WebInspector.resourceTreeModel.mainFrame.url; |
| 10 var lastIndexOfSlash = documentURL.lastIndexOf("/"); |
| 11 var urlPrefix = documentURL.substr(0, lastIndexOfSlash + 1); |
| 12 var fullURL = urlPrefix + url; |
| 13 InspectorTest.addResult("Loading resource from " + url); |
| 14 NetworkAgent.loadResourceForFrontend(WebInspector.resourceTreeModel.main
Frame.id, fullURL, undefined, callback); |
| 15 |
| 16 function callback(error, statusCode, headers, content) |
| 17 { |
| 18 if (error) |
| 19 InspectorTest.addResult("Failed: " + error); |
| 20 else { |
| 21 InspectorTest.addResult("Content: " + content); |
| 22 } |
| 23 InspectorTest.runAfterPendingDispatches(next); |
| 24 } |
| 25 } |
| 26 |
| 27 InspectorTest.runTestSuite([ |
| 28 function testResourceFromFileScheme(next) |
| 29 { |
| 30 testLoadForURL("resources/file-resource-to-load-for-frontend.txt", n
ext); |
| 31 }, |
| 32 ]); |
| 33 } |
| 34 </script> |
| 35 </head> |
| 36 <body onload="runTest()"> |
| 37 </body> |
| 38 </html> |
OLD | NEW |