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

Unified Diff: net/http/http_cache_lookup_manager_unittest.cc

Issue 2519473002: Fixes the cache lock issue. (Closed)
Patch Set: Initial patch Created 4 years 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_lookup_manager_unittest.cc
diff --git a/net/http/http_cache_lookup_manager_unittest.cc b/net/http/http_cache_lookup_manager_unittest.cc
index 32769880882d87513497febd25e71fccd45484db..1e207ba4f2ea3c259214e19db95a5a9494794d91 100644
--- a/net/http/http_cache_lookup_manager_unittest.cc
+++ b/net/http/http_cache_lookup_manager_unittest.cc
@@ -52,12 +52,12 @@ void PopulateCacheEntry(HttpCache* cache, const GURL& request_url) {
MockHttpRequest request(*(mock_trans.get()));
- std::unique_ptr<HttpTransaction> trans;
- int rv = cache->CreateTransaction(DEFAULT_PRIORITY, &trans);
+ Context* c = new Context();
+ int rv = cache->CreateTransaction(DEFAULT_PRIORITY, &c->trans);
EXPECT_THAT(rv, IsOk());
- ASSERT_TRUE(trans.get());
+ ASSERT_TRUE(c->trans.get());
- rv = trans->Start(&request, callback.callback(), NetLogWithSource());
+ rv = c->trans->Start(&request, callback.callback(), NetLogWithSource());
base::RunLoop().RunUntilIdle();
if (rv == ERR_IO_PENDING)
@@ -67,16 +67,18 @@ void PopulateCacheEntry(HttpCache* cache, const GURL& request_url) {
if (OK != rv)
return;
- const HttpResponseInfo* response = trans->GetResponseInfo();
+ const HttpResponseInfo* response = c->trans->GetResponseInfo();
ASSERT_TRUE(response);
std::string content;
- rv = ReadTransaction(trans.get(), &content);
+ rv = ReadTransaction(c->trans.get(), &content);
EXPECT_THAT(rv, IsOk());
std::string expected(mock_trans->data);
EXPECT_EQ(expected, content);
RemoveMockTransaction(mock_trans.get());
+
+ delete c;
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698