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

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

Issue 2620793002: [Devtools] Clear cache before running the test (Closed)
Patch Set: 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 InspectorTest.addConsoleSniffer(innerCallback); 118 InspectorTest.addConsoleSniffer(innerCallback);
119 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" ); 119 InspectorTest.evaluateInPage("makeXHRForJSONArguments(\"" + jsonArgs + "\")" );
120 } 120 }
121 121
122 InspectorTest.makeFetch = function(url, requestInitializer, callback) 122 InspectorTest.makeFetch = function(url, requestInitializer, callback)
123 { 123 {
124 InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback); 124 InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer] ).then(callback);
125 } 125 }
126 126
127 InspectorTest.clearNetworkCache = function(finishedCallback)
128 {
129 // This turns cache off and then on, effectively clearning the cache.
130 var networkAgent = InspectorTest.NetworkAgent;
131 var promise = networkAgent.setCacheDisabled(true);
132 promise.then(networkAgent.setCacheDisabled.bind(networkAgent, false));
133 promise.then(finishedCallback);
134 }
135
127 InspectorTest.HARPropertyFormatters = { 136 InspectorTest.HARPropertyFormatters = {
128 bodySize: "formatAsTypeName", 137 bodySize: "formatAsTypeName",
129 compression: "formatAsTypeName", 138 compression: "formatAsTypeName",
130 connection: "formatAsTypeName", 139 connection: "formatAsTypeName",
131 headers: "formatAsTypeName", 140 headers: "formatAsTypeName",
132 headersSize: "formatAsTypeName", 141 headersSize: "formatAsTypeName",
133 id: "formatAsTypeName", 142 id: "formatAsTypeName",
134 onContentLoad: "formatAsTypeName", 143 onContentLoad: "formatAsTypeName",
135 onLoad: "formatAsTypeName", 144 onLoad: "formatAsTypeName",
136 receive: "formatAsTypeName", 145 receive: "formatAsTypeName",
137 startedDateTime: "formatAsRecentTime", 146 startedDateTime: "formatAsRecentTime",
138 time: "formatAsTypeName", 147 time: "formatAsTypeName",
139 timings: "formatAsTypeName", 148 timings: "formatAsTypeName",
140 version: "formatAsTypeName", 149 version: "formatAsTypeName",
141 wait: "formatAsTypeName", 150 wait: "formatAsTypeName",
142 _transferSize: "formatAsTypeName", 151 _transferSize: "formatAsTypeName",
143 _error: "skip" 152 _error: "skip"
144 }; 153 };
145 // addObject checks own properties only, so make a deep copy rather than use pro totype. 154 // 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)); 155 InspectorTest.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(Inspecto rTest.HARPropertyFormatters));
147 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName"; 156 InspectorTest.HARPropertyFormattersWithSize.size = "formatAsTypeName";
148 157
149 }; 158 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698