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

Unified Diff: net/http/http_cache_unittest.cc

Issue 2886483002: Adds a new class HttpCache::Writers for multiple cache transactions reading from the network. (Closed)
Patch Set: Comment changed. Created 3 years, 5 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
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/http/http_cache_writers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_unittest.cc
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 1c05602a357cc41a20923bcb0825d6c0265b2b42..05dcf9061149533851730dcbdd2aed064a91a723 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -218,7 +218,7 @@ void RunTransactionTestBase(HttpCache* cache,
rv = trans->Start(&request, callback.callback(), net_log);
if (rv == ERR_IO_PENDING)
rv = callback.WaitForResult();
- ASSERT_EQ(trans_info.return_code, rv);
+ ASSERT_EQ(trans_info.start_return_code, rv);
if (OK != rv)
return;
@@ -1076,7 +1076,7 @@ TEST(HttpCache, SimpleGET_CacheSignal_Failure) {
RemoveMockTransaction(&transaction);
// Network failure with error; should fail but have was_cached set.
- transaction.return_code = ERR_FAILED;
+ transaction.start_return_code = ERR_FAILED;
AddMockTransaction(&transaction);
MockHttpRequest request(transaction);
@@ -4513,7 +4513,7 @@ TEST(HttpCache, SimpleHEAD_WithRanges) {
transaction.method = "HEAD";
transaction.request_headers = "Range: bytes = 0-4\r\n";
transaction.load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
- transaction.return_code = ERR_CACHE_MISS;
+ transaction.start_return_code = ERR_CACHE_MISS;
RunTransactionTest(cache.http_cache(), transaction);
EXPECT_EQ(0, cache.disk_cache()->open_count());
@@ -4679,7 +4679,7 @@ TEST(HttpCache, SimpleHEAD_InvalidatesEntry) {
// Load from the cache.
transaction.method = "GET";
transaction.load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
- transaction.return_code = ERR_CACHE_MISS;
+ transaction.start_return_code = ERR_CACHE_MISS;
RunTransactionTest(cache.http_cache(), transaction);
RemoveMockTransaction(&transaction);
@@ -4956,7 +4956,7 @@ TEST(HttpCache, SimpleGET_DontInvalidateOnFailure) {
// Fail the network request.
MockTransaction transaction(kSimpleGET_Transaction);
- transaction.return_code = ERR_FAILED;
+ transaction.start_return_code = ERR_FAILED;
transaction.load_flags |= LOAD_VALIDATE_CACHE;
AddMockTransaction(&transaction);
@@ -4965,7 +4965,7 @@ TEST(HttpCache, SimpleGET_DontInvalidateOnFailure) {
RemoveMockTransaction(&transaction);
transaction.load_flags = LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
- transaction.return_code = OK;
+ transaction.start_return_code = OK;
AddMockTransaction(&transaction);
RunTransactionTest(cache.http_cache(), transaction);
@@ -8040,12 +8040,12 @@ TEST(HttpCache, SkipVaryCheck) {
// The request should fail.
transaction.load_flags = LOAD_ONLY_FROM_CACHE;
transaction.request_headers = "accept-encoding: foo\r\n";
- transaction.return_code = ERR_CACHE_MISS;
+ transaction.start_return_code = ERR_CACHE_MISS;
RunTransactionTest(cache.http_cache(), transaction);
// Change the load flags to ignore vary checks, the request should now hit.
transaction.load_flags = LOAD_ONLY_FROM_CACHE | LOAD_SKIP_VARY_CHECK;
- transaction.return_code = OK;
+ transaction.start_return_code = OK;
RunTransactionTest(cache.http_cache(), transaction);
}
@@ -8071,7 +8071,7 @@ TEST(HttpCache, ValidLoadOnlyFromCache) {
// If the cache entry is checked for validitiy, it should fail.
transaction.load_flags = LOAD_ONLY_FROM_CACHE;
- transaction.return_code = ERR_CACHE_MISS;
+ transaction.start_return_code = ERR_CACHE_MISS;
RunTransactionTest(cache.http_cache(), transaction);
}
@@ -8087,7 +8087,7 @@ TEST(HttpCache, InvalidLoadFlagCombination) {
// 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;
+ transaction.start_return_code = ERR_CACHE_MISS;
RunTransactionTest(cache.http_cache(), transaction);
}
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/http/http_cache_writers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698