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

Unified Diff: net/http/http_cache_unittest.cc

Issue 2517983002: [DevTools] Properly handle cache-only requests when cache is disabled (Closed)
Patch Set: Created 4 years, 1 month 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: net/http/http_cache_unittest.cc
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index d3e8fb6fd1403d64c516927a527503e83f376f87..62040a32a05453529d9a0786bb87096549092e85 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -6744,6 +6744,22 @@ TEST(HttpCache, WriteMetadata_Fail) {
EXPECT_EQ(1, cache.disk_cache()->create_count());
}
+TEST(HttpCache, InvalidLoadFlagCombination) {
+ MockHttpCache cache;
+
+ // Put the resource in the cache.
+ RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction);
+
+ // Now try to fetch it again, but with a flag combination disallowing both
+ // cache and network access.
+ ScopedMockTransaction transaction(kSimpleGET_Transaction);
+ // DevTools relies on this combination of flags for "disable cache" mode
+ // when a resource is only supposed to be loaded from cache.
+ transaction.load_flags = LOAD_ONLY_FROM_CACHE | LOAD_BYPASS_CACHE;
+ transaction.return_code = ERR_CACHE_MISS;
+ RunTransactionTest(cache.http_cache(), transaction);
+}
+
// Tests that we can read metadata after validating the entry and with READ mode
// transactions.
TEST(HttpCache, ReadMetadata) {
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698