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