OLD | NEW |
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/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/port.h" | 8 #include "base/port.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 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3129 entry->Close(); | 3129 entry->Close(); |
3130 entry = NULL; | 3130 entry = NULL; |
3131 same_entry->Close(); | 3131 same_entry->Close(); |
3132 same_entry = NULL; | 3132 same_entry = NULL; |
3133 } | 3133 } |
3134 | 3134 |
3135 TEST_F(DiskCacheBackendTest, TracingBackendBasics) { | 3135 TEST_F(DiskCacheBackendTest, TracingBackendBasics) { |
3136 TracingBackendBasics(); | 3136 TracingBackendBasics(); |
3137 } | 3137 } |
3138 | 3138 |
3139 // The simple cache backend isn't intended to work on windows, which has very | 3139 // The Simple Cache backend requires a few guarantees from the filesystem like |
3140 // different file system guarantees from Windows. | 3140 // atomic renaming of recently open files. Those guarantees are not provided in |
3141 #if !defined(OS_WIN) | 3141 // general on Windows. |
| 3142 #if defined(OS_POSIX) |
3142 | 3143 |
3143 TEST_F(DiskCacheBackendTest, SimpleCacheShutdownWithPendingCreate) { | 3144 TEST_F(DiskCacheBackendTest, SimpleCacheShutdownWithPendingCreate) { |
3144 SetCacheType(net::APP_CACHE); | 3145 SetCacheType(net::APP_CACHE); |
3145 SetSimpleCacheMode(); | 3146 SetSimpleCacheMode(); |
3146 BackendShutdownWithPendingCreate(false); | 3147 BackendShutdownWithPendingCreate(false); |
3147 } | 3148 } |
3148 | 3149 |
3149 TEST_F(DiskCacheBackendTest, SimpleCacheShutdownWithPendingFileIO) { | 3150 TEST_F(DiskCacheBackendTest, SimpleCacheShutdownWithPendingFileIO) { |
3150 SetCacheType(net::APP_CACHE); | 3151 SetCacheType(net::APP_CACHE); |
3151 SetSimpleCacheMode(); | 3152 SetSimpleCacheMode(); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3466 std::set<std::string> keys_to_match(key_pool); | 3467 std::set<std::string> keys_to_match(key_pool); |
3467 void* iter = NULL; | 3468 void* iter = NULL; |
3468 size_t count = 0; | 3469 size_t count = 0; |
3469 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count)); | 3470 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count)); |
3470 cache_->EndEnumeration(&iter); | 3471 cache_->EndEnumeration(&iter); |
3471 | 3472 |
3472 EXPECT_EQ(key_pool.size(), count); | 3473 EXPECT_EQ(key_pool.size(), count); |
3473 EXPECT_TRUE(keys_to_match.empty()); | 3474 EXPECT_TRUE(keys_to_match.empty()); |
3474 } | 3475 } |
3475 | 3476 |
3476 #endif // !defined(OS_WIN) | 3477 #endif // defined(OS_POSIX) |
OLD | NEW |