| 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_cache.h" | 5 #include "content/browser/cache_storage/cache_storage_cache.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/scoped_temp_dir.h" | 15 #include "base/files/scoped_temp_dir.h" |
| 16 #include "base/logging.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/ptr_util.h" | 18 #include "base/memory/ptr_util.h" |
| 18 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 19 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
| 20 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 21 #include "base/threading/thread_task_runner_handle.h" | 22 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 23 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 23 #include "content/browser/cache_storage/cache_storage_cache_handle.h" | 24 #include "content/browser/cache_storage/cache_storage_cache_handle.h" |
| 24 #include "content/browser/fileapi/mock_url_request_delegate.h" | 25 #include "content/browser/fileapi/mock_url_request_delegate.h" |
| 25 #include "content/browser/quota/mock_quota_manager_proxy.h" | 26 #include "content/browser/quota/mock_quota_manager_proxy.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 111 } |
| 111 std::unique_ptr<Iterator> CreateIterator() override { | 112 std::unique_ptr<Iterator> CreateIterator() override { |
| 112 return backend_->CreateIterator(); | 113 return backend_->CreateIterator(); |
| 113 } | 114 } |
| 114 void GetStats(base::StringPairs* stats) override { | 115 void GetStats(base::StringPairs* stats) override { |
| 115 return backend_->GetStats(stats); | 116 return backend_->GetStats(stats); |
| 116 } | 117 } |
| 117 void OnExternalCacheHit(const std::string& key) override { | 118 void OnExternalCacheHit(const std::string& key) override { |
| 118 return backend_->OnExternalCacheHit(key); | 119 return backend_->OnExternalCacheHit(key); |
| 119 } | 120 } |
| 121 size_t EstimateMemoryUsage() const override { |
| 122 NOTREACHED(); |
| 123 return 0; |
| 124 } |
| 120 | 125 |
| 121 // Call to continue a delayed doom. | 126 // Call to continue a delayed doom. |
| 122 void DoomEntryContinue() { | 127 void DoomEntryContinue() { |
| 123 EXPECT_FALSE(doom_entry_callback_.is_null()); | 128 EXPECT_FALSE(doom_entry_callback_.is_null()); |
| 124 doom_entry_callback_.Run(); | 129 doom_entry_callback_.Run(); |
| 125 } | 130 } |
| 126 | 131 |
| 127 void set_delay_doom(bool value) { delay_doom_ = value; } | 132 void set_delay_doom(bool value) { delay_doom_ = value; } |
| 128 | 133 |
| 129 private: | 134 private: |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 EXPECT_EQ(1, sequence_out); | 1651 EXPECT_EQ(1, sequence_out); |
| 1647 close_loop2->Run(); | 1652 close_loop2->Run(); |
| 1648 EXPECT_EQ(2, sequence_out); | 1653 EXPECT_EQ(2, sequence_out); |
| 1649 } | 1654 } |
| 1650 | 1655 |
| 1651 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, | 1656 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, |
| 1652 CacheStorageCacheTestP, | 1657 CacheStorageCacheTestP, |
| 1653 ::testing::Values(false, true)); | 1658 ::testing::Values(false, true)); |
| 1654 | 1659 |
| 1655 } // namespace content | 1660 } // namespace content |
| OLD | NEW |