OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 InspectorTest.dumpNetworkRequests = function() | 65 InspectorTest.dumpNetworkRequests = function() |
66 { | 66 { |
67 var requests = InspectorTest.networkRequests(); | 67 var requests = InspectorTest.networkRequests(); |
68 requests.sort(function(a, b) {return a.url.localeCompare(b.url);}); | 68 requests.sort(function(a, b) {return a.url.localeCompare(b.url);}); |
69 InspectorTest.addResult("resources count = " + requests.length); | 69 InspectorTest.addResult("resources count = " + requests.length); |
70 for (i = 0; i < requests.length; i++) | 70 for (i = 0; i < requests.length; i++) |
71 InspectorTest.addResult(requests[i].url); | 71 InspectorTest.addResult(requests[i].url); |
72 } | 72 } |
73 | 73 |
| 74 // |url| must be a regular expression to match request URLs. |
| 75 InspectorTest.findRequestsByURLPattern = function(urlPattern) |
| 76 { |
| 77 return InspectorTest.networkRequests().filter(function(value) { |
| 78 return urlPattern.test(value.url) |
| 79 }); |
| 80 } |
| 81 |
74 InspectorTest.makeSimpleXHR = function(method, url, async, callback) | 82 InspectorTest.makeSimpleXHR = function(method, url, async, callback) |
75 { | 83 { |
76 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, u
ndefined, undefined, callback); | 84 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, u
ndefined, undefined, callback); |
77 } | 85 } |
78 | 86 |
79 InspectorTest.makeSimpleXHRWithPayload = function(method, url, async, payload, c
allback) | 87 InspectorTest.makeSimpleXHRWithPayload = function(method, url, async, payload, c
allback) |
80 { | 88 { |
81 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, p
ayload, undefined, callback); | 89 InspectorTest.makeXHR(method, url, async, undefined, undefined, [], false, p
ayload, undefined, callback); |
82 } | 90 } |
83 | 91 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 wait: "formatAsTypeName", | 137 wait: "formatAsTypeName", |
130 _transferSize: "formatAsTypeName", | 138 _transferSize: "formatAsTypeName", |
131 _error: "skip", | 139 _error: "skip", |
132 }; | 140 }; |
133 | 141 |
134 // addObject checks own properties only, so make a deep copy rather than use pro
totype. | 142 // addObject checks own properties only, so make a deep copy rather than use pro
totype. |
135 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto
rTest.HARPropertyFormatters)); | 143 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto
rTest.HARPropertyFormatters)); |
136 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; | 144 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; |
137 | 145 |
138 }; | 146 }; |
OLD | NEW |