| Index: net/http/http_cache_unittest.cc
|
| diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
|
| index fd66e793fc21bcb424613d8d7ad04c73b4d68f7a..1076e592e3e6eaf8aa2662815943699aa3356742 100644
|
| --- a/net/http/http_cache_unittest.cc
|
| +++ b/net/http/http_cache_unittest.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/message_loop.h"
|
| #include "base/scoped_vector.h"
|
| #include "base/string_util.h"
|
| +#include "net/base/cache_type.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/base/load_log_unittest.h"
|
| @@ -458,7 +459,7 @@ class MockHttpCache {
|
| return static_cast<MockNetworkLayer*>(http_cache_.network_layer());
|
| }
|
| MockDiskCache* disk_cache() {
|
| - return static_cast<MockDiskCache*>(http_cache_.disk_cache());
|
| + return static_cast<MockDiskCache*>(http_cache_.GetBackend());
|
| }
|
|
|
| private:
|
| @@ -768,6 +769,15 @@ TEST(HttpCache, CreateThenDestroy) {
|
| ASSERT_TRUE(trans.get());
|
| }
|
|
|
| +TEST(HttpCache, GetBackend) {
|
| + // This will initialize a cache object with NULL backend.
|
| + MockHttpCache cache(NULL);
|
| +
|
| + // This will lazily initialize the backend.
|
| + cache.http_cache()->set_type(net::MEMORY_CACHE);
|
| + EXPECT_TRUE(cache.http_cache()->GetBackend());
|
| +}
|
| +
|
| TEST(HttpCache, SimpleGET) {
|
| MockHttpCache cache;
|
|
|
|
|