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

Side by Side Diff: net/disk_cache/entry_unittest.cc

Issue 23658057: Simple Cache: stop running index file tests on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 memset(store->key + key.size(), 'k', sizeof(store->key) - key.size()); 2290 memset(store->key + key.size(), 'k', sizeof(store->key) - key.size());
2291 entry_impl->entry()->set_modified(); 2291 entry_impl->entry()->set_modified();
2292 entry->Close(); 2292 entry->Close();
2293 2293
2294 // We have a corrupt entry. Now reload it. We should NOT read beyond the 2294 // We have a corrupt entry. Now reload it. We should NOT read beyond the
2295 // allocated buffer here. 2295 // allocated buffer here.
2296 ASSERT_NE(net::OK, OpenEntry(key, &entry)); 2296 ASSERT_NE(net::OK, OpenEntry(key, &entry));
2297 DisableIntegrityCheck(); 2297 DisableIntegrityCheck();
2298 } 2298 }
2299 2299
2300 // The simple cache backend isn't intended to work on Windows, which has very 2300 // The Simple Cache backend requires a few guarantees from the filesystem like
2301 // different file system guarantees from Linux. 2301 // atomic renaming of recently open files. Those guarantees are not provided in
2302 // general on Windows.
2302 #if defined(OS_POSIX) 2303 #if defined(OS_POSIX)
2303 2304
2304 TEST_F(DiskCacheEntryTest, SimpleCacheInternalAsyncIO) { 2305 TEST_F(DiskCacheEntryTest, SimpleCacheInternalAsyncIO) {
2305 SetSimpleCacheMode(); 2306 SetSimpleCacheMode();
2306 InitCache(); 2307 InitCache();
2307 InternalAsyncIO(); 2308 InternalAsyncIO();
2308 } 2309 }
2309 2310
2310 TEST_F(DiskCacheEntryTest, SimpleCacheExternalAsyncIO) { 2311 TEST_F(DiskCacheEntryTest, SimpleCacheExternalAsyncIO) {
2311 SetSimpleCacheMode(); 2312 SetSimpleCacheMode();
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3449 3450
3450 // Check that we are not leaking. 3451 // Check that we are not leaking.
3451 ASSERT_NE(entry, null); 3452 ASSERT_NE(entry, null);
3452 EXPECT_TRUE( 3453 EXPECT_TRUE(
3453 static_cast<disk_cache::SimpleEntryImpl*>(entry)->HasOneRef()); 3454 static_cast<disk_cache::SimpleEntryImpl*>(entry)->HasOneRef());
3454 entry->Close(); 3455 entry->Close();
3455 entry = NULL; 3456 entry = NULL;
3456 } 3457 }
3457 3458
3458 #endif // defined(OS_POSIX) 3459 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698