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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js

Issue 2626553002: [Devtools][Code health] Changed NetworkRequest.url to proper getter/setter (Closed)
Patch Set: changes Created 3 years, 11 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
OLDNEW
1 // This goes before everything else to keep console message line number invarian t. 1 // This goes before everything else to keep console message line number invarian t.
2 var lastXHRIndex = 0; 2 var lastXHRIndex = 0;
3 function xhrLoadedCallback() 3 function xhrLoadedCallback()
4 { 4 {
5 // We need to make sure the console message text is unique so that we don't end up with repeat count update only. 5 // We need to make sure the console message text is unique so that we don't end up with repeat count update only.
6 console.log("XHR loaded: " + (++lastXHRIndex)); 6 console.log("XHR loaded: " + (++lastXHRIndex));
7 } 7 }
8 8
9 function makeSimpleXHR(method, url, async, callback) 9 function makeSimpleXHR(method, url, async, callback)
10 { 10 {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 InspectorTest.networkRequests = function() 64 InspectorTest.networkRequests = function()
65 { 65 {
66 return SDK.NetworkLog.requests(); 66 return SDK.NetworkLog.requests();
67 } 67 }
68 68
69 InspectorTest.dumpNetworkRequests = function() 69 InspectorTest.dumpNetworkRequests = function()
70 { 70 {
71 var requests = InspectorTest.networkRequests(); 71 var requests = InspectorTest.networkRequests();
72 requests.sort(function(a, b) {return a.url.localeCompare(b.url);}); 72 requests.sort(function(a, b) {return a.url().localeCompare(b.url());});
73 InspectorTest.addResult("resources count = " + requests.length); 73 InspectorTest.addResult("resources count = " + requests.length);
74 for (i = 0; i < requests.length; i++) 74 for (i = 0; i < requests.length; i++)
75 InspectorTest.addResult(requests[i].url); 75 InspectorTest.addResult(requests[i].url());
76 } 76 }
77 77
78 // |url| must be a regular expression to match request URLs. 78 // |url| must be a regular expression to match request URLs.
79 InspectorTest.findRequestsByURLPattern = function(urlPattern) 79 InspectorTest.findRequestsByURLPattern = function(urlPattern)
80 { 80 {
81 return InspectorTest.networkRequests().filter(function(value) { 81 return InspectorTest.networkRequests().filter(function(value) {
82 return urlPattern.test(value.url) 82 return urlPattern.test(value.url());
83 }); 83 });
84 } 84 }
85 85
86 InspectorTest.makeSimpleXHR = function(method, url, async, callback) 86 InspectorTest.makeSimpleXHR = function(method, url, async, callback)
87 { 87 {
88 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, u ndefined, undefined, callback); 88 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, u ndefined, undefined, callback);
89 } 89 }
90 90
91 InspectorTest.makeSimpleXHRWithPayload = function(method, url, async, payload, c allback) 91 InspectorTest.makeSimpleXHRWithPayload = function(method, url, async, payload, c allback)
92 { 92 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 version: "formatAsTypeName", 140 version: "formatAsTypeName",
141 wait: "formatAsTypeName", 141 wait: "formatAsTypeName",
142 _transferSize: "formatAsTypeName", 142 _transferSize: "formatAsTypeName",
143 _error: "skip" 143 _error: "skip"
144 }; 144 };
145 // addObject checks own properties only, so make a deep copy rather than use pro totype. 145 // addObject checks own properties only, so make a deep copy rather than use pro totype.
146 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters)); 146 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters));
147 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; 147 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName";
148 148
149 }; 149 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698