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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js
index 92ccdd6fa936ce7de68cf1bd036eb4796230e336..935fbb4b7ad1aeadb234d593a9cffae111f008ba 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network-test.js
@@ -124,6 +124,15 @@ InspectorTest.makeFetch = function(url, requestInitializer, callback)
InspectorTest.callFunctionInPageAsync("makeFetch", [url, requestInitializer]).then(callback);
}
+InspectorTest.clearNetworkCache = function(finishedCallback)
+{
+ // This turns cache off and then on, effectively clearning the cache.
+ var networkAgent = InspectorTest.NetworkAgent;
+ var promise = networkAgent.setCacheDisabled(true);
+ promise.then(networkAgent.setCacheDisabled.bind(networkAgent, false));
+ promise.then(finishedCallback);
+}
+
InspectorTest.HARPropertyFormatters = {
bodySize: "formatAsTypeName",
compression: "formatAsTypeName",

Powered by Google App Engine
This is Rietveld 408576698