Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: LayoutTests/inspector/load-file-resource-for-frontend.html

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
OLDNEW
« no previous file with comments | « LayoutTests/inspector/initial-modules-load.html ('k') | LayoutTests/inspector/network/network-status-non-http.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698