Chromium Code Reviews| Index: net/http/infinite_cache_unittest.cc |
| =================================================================== |
| --- net/http/infinite_cache_unittest.cc (revision 170114) |
| +++ net/http/infinite_cache_unittest.cc (working copy) |
| @@ -6,6 +6,7 @@ |
| #include "base/file_util.h" |
| #include "base/files/scoped_temp_dir.h" |
| +#include "base/stringprintf.h" |
| #include "base/threading/platform_thread.h" |
| #include "base/time.h" |
| #include "net/base/net_errors.h" |
| @@ -245,3 +246,31 @@ |
| EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); |
| #endif // OS_ANDROID |
| } |
| + |
| +#if 0 |
|
tburkard
2012/11/30 19:00:54
How about not using #if 0, but making it Disabled,
rvargas (doing something else)
2012/11/30 19:12:23
I don't care that much either way, but we have reg
|
| +// This test is too slow for the bots. |
| +TEST(InfiniteCache, FillUp) { |
| + base::ScopedTempDir dir; |
| + ASSERT_TRUE(dir.CreateUniqueTempDir()); |
| + FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); |
| + |
| + scoped_ptr<InfiniteCache> cache(new InfiniteCache); |
| + cache->Init(path); |
| + net::TestCompletionCallback cb; |
| + |
| + const int kNumEntries = 25000; |
| + for (int i = 0; i < kNumEntries; i++) { |
| + std::string url = StringPrintf("http://foo.com/%d/foo.html", i); |
| + MockTransaction transaction = kTypicalGET_Transaction; |
| + transaction.url = url.c_str(); |
| + ProcessRequest(transaction, cache.get()); |
| + } |
| + |
| + EXPECT_EQ(kNumEntries, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); |
| + EXPECT_EQ(net::OK, cb.GetResult(cache->FlushDataForTest(cb.callback()))); |
| + |
| + cache.reset(new InfiniteCache); |
| + cache->Init(path); |
| + EXPECT_EQ(kNumEntries, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); |
| +} |
| +#endif |