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

Side by Side Diff: LayoutTests/http/tests/inspector/resource-tree/resource-tree-test.js

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 var initialize_ResourceTreeTest = function() { 1 var initialize_ResourceTreeTest = function() {
2 2
3 InspectorTest.dumpResources = function(formatter) 3 InspectorTest.dumpResources = function(formatter)
4 { 4 {
5 var results = []; 5 var results = [];
6 6
7 function formatterWrapper(resource) 7 function formatterWrapper(resource)
8 { 8 {
9 if (formatter) 9 if (formatter)
10 results.push({ resource: resource, text: formatter(resource) }); 10 results.push({ resource: resource, text: formatter(resource) });
11 else 11 else
12 results.push({ resource: resource, text: resource.url }); 12 results.push({ resource: resource, text: resource.url });
13 } 13 }
14 14
15 WebInspector.resourceTreeModel.forAllResources(formatterWrapper); 15 InspectorTest.resourceTreeModel.forAllResources(formatterWrapper);
16 16
17 function comparator(result1, result2) 17 function comparator(result1, result2)
18 { 18 {
19 return result1.resource.url.localeCompare(result2.resource.url); 19 return result1.resource.url.localeCompare(result2.resource.url);
20 } 20 }
21 results.sort(comparator); 21 results.sort(comparator);
22 22
23 for (var i = 0; i < results.length; ++i) 23 for (var i = 0; i < results.length; ++i)
24 InspectorTest.addResult(results[i].text); 24 InspectorTest.addResult(results[i].text);
25 } 25 }
26 26
27 InspectorTest.dumpResourcesURLMap = function() 27 InspectorTest.dumpResourcesURLMap = function()
28 { 28 {
29 var results = []; 29 var results = [];
30 WebInspector.resourceTreeModel.forAllResources(collect); 30 InspectorTest.resourceTreeModel.forAllResources(collect);
31 function collect(resource) 31 function collect(resource)
32 { 32 {
33 results.push({ url: resource.url, resource: WebInspector.resourceTreeMod el.resourceForURL(resource.url) }); 33 results.push({ url: resource.url, resource: InspectorTest.resourceTreeMo del.resourceForURL(resource.url) });
34 } 34 }
35 35
36 function comparator(result1, result2) 36 function comparator(result1, result2)
37 { 37 {
38 if (result1.url > result2.url) 38 if (result1.url > result2.url)
39 return 1; 39 return 1;
40 if (result2.url > result1.url) 40 if (result2.url > result1.url)
41 return -1; 41 return -1;
42 return 0; 42 return 0;
43 } 43 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 InspectorTest.addResult(""); 80 InspectorTest.addResult("");
81 InspectorTest.addResult("Resources URL Map:"); 81 InspectorTest.addResult("Resources URL Map:");
82 InspectorTest.dumpResourcesURLMap(); 82 InspectorTest.dumpResourcesURLMap();
83 83
84 InspectorTest.addResult(""); 84 InspectorTest.addResult("");
85 InspectorTest.addResult("Resources Tree:"); 85 InspectorTest.addResult("Resources Tree:");
86 InspectorTest.dumpResourcesTree(); 86 InspectorTest.dumpResourcesTree();
87 } 87 }
88 88
89 }; 89 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698