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

Unified Diff: net/http/http_cache_unittest.cc

Issue 2976004: Http Cache: chain GetLoadState from transactions waiting for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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_transaction_unittest.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
===================================================================
--- net/http/http_cache_unittest.cc (revision 52151)
+++ net/http/http_cache_unittest.cc (working copy)
@@ -1396,10 +1396,17 @@
c->result = cache.http_cache()->CreateTransaction(&c->trans);
EXPECT_EQ(net::OK, c->result);
+ EXPECT_EQ(net::LOAD_STATE_IDLE, c->trans->GetLoadState());
c->result = c->trans->Start(&request, &c->callback, net::BoundNetLog());
}
+ // All requests are waiting for the active entry.
+ for (int i = 0; i < kNumTransactions; ++i) {
+ Context* c = context_list[i];
+ EXPECT_EQ(net::LOAD_STATE_WAITING_FOR_CACHE, c->trans->GetLoadState());
+ }
+
// Allow all requests to move from the Create queue to the active entry.
MessageLoop::current()->RunAllPending();
@@ -1410,8 +1417,15 @@
EXPECT_EQ(0, cache.disk_cache()->open_count());
EXPECT_EQ(1, cache.disk_cache()->create_count());
+ // All requests depend on the writer, and the writer is between Start and
+ // Read, i.e. idle.
for (int i = 0; i < kNumTransactions; ++i) {
Context* c = context_list[i];
+ EXPECT_EQ(net::LOAD_STATE_IDLE, c->trans->GetLoadState());
+ }
+
+ for (int i = 0; i < kNumTransactions; ++i) {
+ Context* c = context_list[i];
if (c->result == net::ERR_IO_PENDING)
c->result = c->callback.WaitForResult();
ReadAndVerifyTransaction(c->trans.get(), kSimpleGET_Transaction);
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/http/http_transaction_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698