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/files/file_util.h" | 6 #include "base/files/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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 cache_path_, cache_thread.task_runner(), NULL)); | 1836 cache_path_, cache_thread.task_runner(), NULL)); |
1837 int rv = cache->Init(cb.callback()); | 1837 int rv = cache->Init(cb.callback()); |
1838 ASSERT_EQ(net::ERR_FAILED, cb.GetResult(rv)); | 1838 ASSERT_EQ(net::ERR_FAILED, cb.GetResult(rv)); |
1839 } | 1839 } |
1840 | 1840 |
1841 class BadEntropyProvider : public base::FieldTrial::EntropyProvider { | 1841 class BadEntropyProvider : public base::FieldTrial::EntropyProvider { |
1842 public: | 1842 public: |
1843 virtual ~BadEntropyProvider() {} | 1843 virtual ~BadEntropyProvider() {} |
1844 | 1844 |
1845 virtual double GetEntropyForTrial(const std::string& trial_name, | 1845 virtual double GetEntropyForTrial(const std::string& trial_name, |
1846 uint32 randomization_seed) const OVERRIDE { | 1846 uint32 randomization_seed) const override { |
1847 return 0.5; | 1847 return 0.5; |
1848 } | 1848 } |
1849 }; | 1849 }; |
1850 | 1850 |
1851 // Tests that the disk cache successfully joins the control group, dropping the | 1851 // Tests that the disk cache successfully joins the control group, dropping the |
1852 // existing cache in favour of a new empty cache. | 1852 // existing cache in favour of a new empty cache. |
1853 // Disabled on android since this test requires cache creator to create | 1853 // Disabled on android since this test requires cache creator to create |
1854 // blockfile caches. | 1854 // blockfile caches. |
1855 #if !defined(OS_ANDROID) | 1855 #if !defined(OS_ANDROID) |
1856 TEST_F(DiskCacheTest, SimpleCacheControlJoin) { | 1856 TEST_F(DiskCacheTest, SimpleCacheControlJoin) { |
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3481 disk_cache::Entry* entry = NULL; | 3481 disk_cache::Entry* entry = NULL; |
3482 ASSERT_EQ(net::OK, iter->OpenNextEntry(&entry)); | 3482 ASSERT_EQ(net::OK, iter->OpenNextEntry(&entry)); |
3483 EXPECT_TRUE(entry); | 3483 EXPECT_TRUE(entry); |
3484 disk_cache::ScopedEntryPtr entry_closer(entry); | 3484 disk_cache::ScopedEntryPtr entry_closer(entry); |
3485 | 3485 |
3486 cache_.reset(); | 3486 cache_.reset(); |
3487 // This test passes if we don't leak memory. | 3487 // This test passes if we don't leak memory. |
3488 } | 3488 } |
3489 | 3489 |
3490 #endif // defined(OS_POSIX) | 3490 #endif // defined(OS_POSIX) |
OLD | NEW |