| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/cache_storage/cache_storage_manager.h" | 5 #include "content/browser/cache_storage/cache_storage_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/guid.h" | 15 #include "base/guid.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 19 #include "base/sha1.h" | 19 #include "base/sha1.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/threading/thread_task_runner_handle.h" | 22 #include "base/threading/thread_task_runner_handle.h" |
| 23 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 23 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 24 #include "content/browser/cache_storage/cache_storage.pb.h" | 24 #include "content/browser/cache_storage/cache_storage.pb.h" |
| 25 #include "content/browser/cache_storage/cache_storage_cache_handle.h" | 25 #include "content/browser/cache_storage/cache_storage_cache_handle.h" |
| 26 #include "content/browser/cache_storage/cache_storage_quota_client.h" | 26 #include "content/browser/cache_storage/cache_storage_quota_client.h" |
| 27 #include "content/browser/quota/mock_quota_manager_proxy.h" | |
| 28 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/cache_storage_usage_info.h" | 28 #include "content/public/browser/cache_storage_usage_info.h" |
| 30 #include "content/public/browser/storage_partition.h" | 29 #include "content/public/browser/storage_partition.h" |
| 31 #include "content/public/test/mock_special_storage_policy.h" | |
| 32 #include "content/public/test/test_browser_context.h" | 30 #include "content/public/test/test_browser_context.h" |
| 33 #include "content/public/test/test_browser_thread_bundle.h" | 31 #include "content/public/test/test_browser_thread_bundle.h" |
| 34 #include "net/url_request/url_request_context.h" | 32 #include "net/url_request/url_request_context.h" |
| 35 #include "net/url_request/url_request_context_getter.h" | 33 #include "net/url_request/url_request_context_getter.h" |
| 36 #include "net/url_request/url_request_job_factory_impl.h" | 34 #include "net/url_request/url_request_job_factory_impl.h" |
| 37 #include "storage/browser/blob/blob_data_builder.h" | 35 #include "storage/browser/blob/blob_data_builder.h" |
| 38 #include "storage/browser/blob/blob_data_handle.h" | 36 #include "storage/browser/blob/blob_data_handle.h" |
| 39 #include "storage/browser/blob/blob_storage_context.h" | 37 #include "storage/browser/blob/blob_storage_context.h" |
| 40 #include "storage/browser/blob/blob_url_request_job_factory.h" | 38 #include "storage/browser/blob/blob_url_request_job_factory.h" |
| 41 #include "storage/browser/quota/quota_manager_proxy.h" | 39 #include "storage/browser/quota/quota_manager_proxy.h" |
| 40 #include "storage/browser/test/mock_quota_manager_proxy.h" |
| 41 #include "storage/browser/test/mock_special_storage_policy.h" |
| 42 #include "testing/gtest/include/gtest/gtest.h" | 42 #include "testing/gtest/include/gtest/gtest.h" |
| 43 | 43 |
| 44 namespace content { | 44 namespace content { |
| 45 | 45 |
| 46 // Returns a BlobProtocolHandler that uses |blob_storage_context|. Caller owns | 46 // Returns a BlobProtocolHandler that uses |blob_storage_context|. Caller owns |
| 47 // the memory. | 47 // the memory. |
| 48 std::unique_ptr<storage::BlobProtocolHandler> CreateMockBlobProtocolHandler( | 48 std::unique_ptr<storage::BlobProtocolHandler> CreateMockBlobProtocolHandler( |
| 49 storage::BlobStorageContext* blob_storage_context) { | 49 storage::BlobStorageContext* blob_storage_context) { |
| 50 // The FileSystemContext and thread task runner are not actually used but a | 50 // The FileSystemContext and thread task runner are not actually used but a |
| 51 // task runner is needed to avoid a DCHECK in BlobURLRequestJob ctor. | 51 // task runner is needed to avoid a DCHECK in BlobURLRequestJob ctor. |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 | 1442 |
| 1443 INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests, | 1443 INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests, |
| 1444 CacheStorageManagerTestP, | 1444 CacheStorageManagerTestP, |
| 1445 ::testing::Values(false, true)); | 1445 ::testing::Values(false, true)); |
| 1446 | 1446 |
| 1447 INSTANTIATE_TEST_CASE_P(CacheStorageQuotaClientTests, | 1447 INSTANTIATE_TEST_CASE_P(CacheStorageQuotaClientTests, |
| 1448 CacheStorageQuotaClientTestP, | 1448 CacheStorageQuotaClientTestP, |
| 1449 ::testing::Values(false, true)); | 1449 ::testing::Values(false, true)); |
| 1450 | 1450 |
| 1451 } // namespace content | 1451 } // namespace content |
| OLD | NEW |