| 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) {
|
|
|