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

Unified Diff: net/http/http_cache_unittest.cc

Issue 2776007: Http cache: Remove deprecated code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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.cc ('k') | no next file » | 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 49542)
+++ net/http/http_cache_unittest.cc (working copy)
@@ -591,7 +591,11 @@
return static_cast<MockNetworkLayer*>(http_cache_.network_layer());
}
MockDiskCache* disk_cache() {
- return static_cast<MockDiskCache*>(http_cache_.GetBackend());
+ TestCompletionCallback cb;
+ disk_cache::Backend* backend;
+ int rv = http_cache_.GetBackend(&backend, &cb);
+ rv = cb.GetResult(rv);
+ return (rv == net::OK) ? static_cast<MockDiskCache*>(backend) : NULL;
}
// Helper function for reading response info from the disk cache.
@@ -1018,8 +1022,11 @@
TEST(HttpCache, GetBackend) {
MockHttpCache cache(net::HttpCache::DefaultBackend::InMemory(0));
+ disk_cache::Backend* backend;
+ TestCompletionCallback cb;
// This will lazily initialize the backend.
- EXPECT_TRUE(cache.http_cache()->GetBackend());
+ int rv = cache.http_cache()->GetBackend(&backend, &cb);
+ EXPECT_EQ(net::OK, cb.GetResult(rv));
}
TEST(HttpCache, SimpleGET) {
@@ -1076,7 +1083,7 @@
RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction);
EXPECT_EQ(1, cache.network_layer()->transaction_count());
- EXPECT_FALSE(cache.http_cache()->GetBackend());
+ EXPECT_FALSE(cache.http_cache()->GetCurrentBackend());
}
TEST(HttpCache, SimpleGETWithDiskFailures) {
« no previous file with comments | « net/http/http_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698