| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 // Note that this file only tests the basic behavior of the cache counter, as in | 5 // Note that this file only tests the basic behavior of the cache counter, as in |
| 6 // when it counts and when not, when result is nonzero and when not. It does not | 6 // when it counts and when not, when result is nonzero and when not. It does not |
| 7 // test whether the result of the counting is correct. This is the | 7 // test whether the result of the counting is correct. This is the |
| 8 // responsibility of a lower layer, and is tested in | 8 // responsibility of a lower layer, and is tested in |
| 9 // DiskCacheBackendTest.CalculateSizeOfAllEntries in net_unittests. | 9 // DiskCacheBackendTest.CalculateSizeOfAllEntries in net_unittests. |
| 10 | 10 |
| 11 #include "chrome/browser/browsing_data/cache_counter.h" | 11 #include "chrome/browser/browsing_data/cache_counter.h" |
| 12 | 12 |
| 13 #include "base/prefs/pref_service.h" | |
| 14 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 15 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 18 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 19 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" | 18 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" |
| 19 #include "components/prefs/pref_service.h" |
| 20 #include "content/public/browser/storage_partition.h" | 20 #include "content/public/browser/storage_partition.h" |
| 21 #include "net/disk_cache/disk_cache.h" | 21 #include "net/disk_cache/disk_cache.h" |
| 22 #include "net/http/http_cache.h" | 22 #include "net/http/http_cache.h" |
| 23 #include "net/url_request/url_request_context.h" | 23 #include "net/url_request/url_request_context.h" |
| 24 #include "net/url_request/url_request_context_getter.h" | 24 #include "net/url_request/url_request_context_getter.h" |
| 25 | 25 |
| 26 using content::BrowserContext; | 26 using content::BrowserContext; |
| 27 using content::BrowserThread; | 27 using content::BrowserThread; |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 SetDeletionPeriodPref(BrowsingDataRemover::FOUR_WEEKS); | 267 SetDeletionPeriodPref(BrowsingDataRemover::FOUR_WEEKS); |
| 268 WaitForIOThread(); | 268 WaitForIOThread(); |
| 269 EXPECT_EQ(result, GetResult()); | 269 EXPECT_EQ(result, GetResult()); |
| 270 | 270 |
| 271 SetDeletionPeriodPref(BrowsingDataRemover::EVERYTHING); | 271 SetDeletionPeriodPref(BrowsingDataRemover::EVERYTHING); |
| 272 WaitForIOThread(); | 272 WaitForIOThread(); |
| 273 EXPECT_EQ(result, GetResult()); | 273 EXPECT_EQ(result, GetResult()); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace | 276 } // namespace |
| OLD | NEW |