| Index: net/disk_cache/backend_unittest.cc
|
| ===================================================================
|
| --- net/disk_cache/backend_unittest.cc (revision 188696)
|
| +++ net/disk_cache/backend_unittest.cc (working copy)
|
| @@ -217,24 +217,18 @@
|
| ASSERT_TRUE(cache_thread.StartWithOptions(
|
| base::Thread::Options(MessageLoop::TYPE_IO, 0)));
|
|
|
| - // Test the private factory methods.
|
| + // Test the private factory method(s).
|
| disk_cache::Backend* cache = NULL;
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, false, 0, net::DISK_CACHE, disk_cache::kNoRandom,
|
| - cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
|
| - ASSERT_EQ(net::OK, cb.GetResult(rv));
|
| - ASSERT_TRUE(cache);
|
| - delete cache;
|
| -
|
| cache = disk_cache::MemBackendImpl::CreateBackend(0, NULL);
|
| ASSERT_TRUE(cache);
|
| delete cache;
|
| cache = NULL;
|
|
|
| // Now test the public API.
|
| - rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, cache_path_, 0, false,
|
| - cache_thread.message_loop_proxy(),
|
| - NULL, &cache, cb.callback());
|
| + int rv = disk_cache::CreateCacheBackend(net::DISK_CACHE, cache_path_, 0,
|
| + false,
|
| + cache_thread.message_loop_proxy(),
|
| + NULL, &cache, cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
| ASSERT_TRUE(cache);
|
| delete cache;
|
| @@ -301,10 +295,9 @@
|
| uint32 flags = disk_cache::kNoBuffering;
|
| if (!fast)
|
| flags |= disk_cache::kNoRandom;
|
| - rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, false, 0, net::DISK_CACHE, flags,
|
| - base::MessageLoopProxy::current(), NULL,
|
| - &cache, cb.callback());
|
| + rv = disk_cache::CreateCacheBackendWithFlags(
|
| + net::DISK_CACHE, cache_path_, 0, false, flags,
|
| + base::MessageLoopProxy::current(), NULL, &cache, cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
|
|
| disk_cache::EntryImpl* entry;
|
| @@ -379,8 +372,8 @@
|
| uint32 flags = disk_cache::kNoBuffering;
|
| if (!fast)
|
| flags |= disk_cache::kNoRandom;
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, false, 0, net::DISK_CACHE, flags,
|
| + int rv = disk_cache::CreateCacheBackendWithFlags(
|
| + net::DISK_CACHE, cache_path_, 0, false, flags,
|
| cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
|
|
| @@ -422,8 +415,8 @@
|
| disk_cache::Backend* cache;
|
| disk_cache::BackendFlags flags =
|
| fast ? disk_cache::kNone : disk_cache::kNoRandom;
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, false, 0, net::DISK_CACHE, flags,
|
| + int rv = disk_cache::CreateCacheBackendWithFlags(
|
| + net::DISK_CACHE, cache_path_, 0, false, flags,
|
| cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
|
|
| @@ -461,8 +454,8 @@
|
| net::TestCompletionCallback cb;
|
|
|
| disk_cache::Backend* backend = NULL;
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, false, 0, net::DISK_CACHE, disk_cache::kNone,
|
| + int rv = disk_cache::CreateCacheBackend(
|
| + net::DISK_CACHE, cache_path_, 0, false,
|
| cache_thread.message_loop_proxy(), NULL, &backend, cb.callback());
|
| ASSERT_NE(net::OK, cb.GetResult(rv));
|
|
|
| @@ -1555,9 +1548,9 @@
|
| net::TestCompletionCallback cb;
|
|
|
| disk_cache::Backend* cache;
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - cache_path_, true, 0, net::DISK_CACHE, disk_cache::kNoRandom,
|
| - cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
|
| + int rv = disk_cache::CreateCacheBackendWithFlags(
|
| + net::DISK_CACHE, cache_path_, 0, true, disk_cache::kNoRandom,
|
| + cache_thread.message_loop_proxy(), NULL, &cache, cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
|
|
| MessageLoopHelper helper;
|
| @@ -2460,12 +2453,12 @@
|
| const int kNumberOfCaches = 2;
|
| disk_cache::Backend* cache[kNumberOfCaches];
|
|
|
| - int rv = disk_cache::BackendImpl::CreateBackend(
|
| - store1.path(), false, 0, net::DISK_CACHE, disk_cache::kNone,
|
| + int rv = disk_cache::CreateCacheBackend(
|
| + net::DISK_CACHE, store1.path(), 0, false,
|
| cache_thread.message_loop_proxy(), NULL, &cache[0], cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
| - rv = disk_cache::BackendImpl::CreateBackend(
|
| - store2.path(), false, 0, net::MEDIA_CACHE, disk_cache::kNone,
|
| + rv = disk_cache::CreateCacheBackend(
|
| + net::MEDIA_CACHE, store2.path(), 0, false,
|
| cache_thread.message_loop_proxy(), NULL, &cache[1], cb.callback());
|
| ASSERT_EQ(net::OK, cb.GetResult(rv));
|
|
|
|
|