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 = WebInspector.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 InspectorTest.NetworkAgent.loadResourceForFrontend(WebInspector.resource
TreeModel.mainFrame.id, fullURL, undefined, callback); | 14 InspectorTest.NetworkAgent.loadResourceForFrontend(InspectorTest.resourc
eTreeModel.mainFrame.id, fullURL, undefined, callback); |
15 | 15 |
16 function callback(error, statusCode, headers, content) | 16 function callback(error, statusCode, headers, content) |
17 { | 17 { |
18 if (error) | 18 if (error) |
19 InspectorTest.addResult("Failed: " + error); | 19 InspectorTest.addResult("Failed: " + error); |
20 else { | 20 else { |
21 InspectorTest.addResult("Content: " + content); | 21 InspectorTest.addResult("Content: " + content); |
22 } | 22 } |
23 InspectorTest.runAfterPendingDispatches(next); | 23 InspectorTest.runAfterPendingDispatches(next); |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 InspectorTest.runTestSuite([ | 27 InspectorTest.runTestSuite([ |
28 function testResourceFromFileScheme(next) | 28 function testResourceFromFileScheme(next) |
29 { | 29 { |
30 testLoadForURL("resources/file-resource-to-load-for-frontend.txt", n
ext); | 30 testLoadForURL("resources/file-resource-to-load-for-frontend.txt", n
ext); |
31 }, | 31 }, |
32 ]); | 32 ]); |
33 } | 33 } |
34 </script> | 34 </script> |
35 </head> | 35 </head> |
36 <body onload="runTest()"> | 36 <body onload="runTest()"> |
37 </body> | 37 </body> |
38 </html> | 38 </html> |
OLD | NEW |