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

Unified Diff: net/http/infinite_cache_unittest.cc

Issue 11415222: Http cache: fix a bug that prevented the infinite cache simulation from saving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
« net/http/infinite_cache.cc ('K') | « net/http/infinite_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/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
« net/http/infinite_cache.cc ('K') | « net/http/infinite_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698