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

Side by Side Diff: net/http/infinite_cache_unittest.cc

Issue 10914299: net: don't run InfiniteCache.DeleteBetween on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/infinite_cache.h" 5 #include "net/http/infinite_cache.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/scoped_temp_dir.h" 8 #include "base/scoped_temp_dir.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 cache->Init(path); 173 cache->Init(path);
174 EXPECT_EQ(2, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); 174 EXPECT_EQ(2, cb.GetResult(cache->QueryItemsForTest(cb.callback())));
175 EXPECT_EQ(net::OK, cb.GetResult(cache->DeleteData(cb.callback()))); 175 EXPECT_EQ(net::OK, cb.GetResult(cache->DeleteData(cb.callback())));
176 EXPECT_EQ(0, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); 176 EXPECT_EQ(0, cb.GetResult(cache->QueryItemsForTest(cb.callback())));
177 EXPECT_FALSE(file_util::PathExists(path)); 177 EXPECT_FALSE(file_util::PathExists(path));
178 178
179 EXPECT_EQ(net::OK, cb.GetResult(cache->FlushDataForTest(cb.callback()))); 179 EXPECT_EQ(net::OK, cb.GetResult(cache->FlushDataForTest(cb.callback())));
180 } 180 }
181 181
182 TEST(InfiniteCache, DeleteBetween) { 182 TEST(InfiniteCache, DeleteBetween) {
183 #if !defined(OS_ANDROID)
183 ScopedTempDir dir; 184 ScopedTempDir dir;
184 ASSERT_TRUE(dir.CreateUniqueTempDir()); 185 ASSERT_TRUE(dir.CreateUniqueTempDir());
185 FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite")); 186 FilePath path = dir.path().Append(FILE_PATH_LITERAL("infinite"));
186 187
187 scoped_ptr<InfiniteCache> cache(new InfiniteCache); 188 scoped_ptr<InfiniteCache> cache(new InfiniteCache);
188 cache->Init(path); 189 cache->Init(path);
189 net::TestCompletionCallback cb; 190 net::TestCompletionCallback cb;
190 191
191 Time::Exploded baseline = {}; 192 Time::Exploded baseline = {};
192 baseline.year = 2012; 193 baseline.year = 2012;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); 225 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback())));
225 226
226 // Make sure the data is deleted from disk. 227 // Make sure the data is deleted from disk.
227 EXPECT_EQ(net::OK, cb.GetResult(cache->FlushDataForTest(cb.callback()))); 228 EXPECT_EQ(net::OK, cb.GetResult(cache->FlushDataForTest(cb.callback())));
228 cache.reset(new InfiniteCache); 229 cache.reset(new InfiniteCache);
229 cache->Init(path); 230 cache->Init(path);
230 231
231 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); 232 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback())));
232 ProcessRequest(kTypicalGET_Transaction, cache.get()); 233 ProcessRequest(kTypicalGET_Transaction, cache.get());
233 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback()))); 234 EXPECT_EQ(1, cb.GetResult(cache->QueryItemsForTest(cb.callback())));
235 #endif // OS_ANDROID
234 } 236 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698