| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/test/scoped_task_environment.h" |
| 14 #include "content/public/test/async_file_test_helper.h" | 15 #include "content/public/test/async_file_test_helper.h" |
| 15 #include "content/public/test/test_file_system_context.h" | 16 #include "content/public/test/test_file_system_context.h" |
| 16 #include "storage/browser/fileapi/file_system_context.h" | 17 #include "storage/browser/fileapi/file_system_context.h" |
| 17 #include "storage/browser/fileapi/file_system_quota_client.h" | 18 #include "storage/browser/fileapi/file_system_quota_client.h" |
| 18 #include "storage/browser/fileapi/file_system_usage_cache.h" | 19 #include "storage/browser/fileapi/file_system_usage_cache.h" |
| 19 #include "storage/browser/fileapi/obfuscated_file_util.h" | 20 #include "storage/browser/fileapi/obfuscated_file_util.h" |
| 20 #include "storage/common/fileapi/file_system_types.h" | 21 #include "storage/common/fileapi/file_system_types.h" |
| 21 #include "storage/common/fileapi/file_system_util.h" | 22 #include "storage/common/fileapi/file_system_util.h" |
| 22 #include "storage/common/quota/quota_types.h" | 23 #include "storage/common/quota/quota_types.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 223 |
| 223 void OnGetAdditionalUsage(int64_t usage_unused) { | 224 void OnGetAdditionalUsage(int64_t usage_unused) { |
| 224 ++additional_callback_count_; | 225 ++additional_callback_count_; |
| 225 } | 226 } |
| 226 | 227 |
| 227 void OnDeleteOrigin(storage::QuotaStatusCode status) { | 228 void OnDeleteOrigin(storage::QuotaStatusCode status) { |
| 228 deletion_status_ = status; | 229 deletion_status_ = status; |
| 229 } | 230 } |
| 230 | 231 |
| 231 base::ScopedTempDir data_dir_; | 232 base::ScopedTempDir data_dir_; |
| 232 base::MessageLoop message_loop_; | 233 base::test::ScopedTaskEnvironment scoped_task_environment_; |
| 233 scoped_refptr<storage::FileSystemContext> file_system_context_; | 234 scoped_refptr<storage::FileSystemContext> file_system_context_; |
| 234 int64_t usage_; | 235 int64_t usage_; |
| 235 int additional_callback_count_; | 236 int additional_callback_count_; |
| 236 std::set<GURL> origins_; | 237 std::set<GURL> origins_; |
| 237 storage::QuotaStatusCode deletion_status_; | 238 storage::QuotaStatusCode deletion_status_; |
| 238 base::WeakPtrFactory<FileSystemQuotaClientTest> weak_factory_; | 239 base::WeakPtrFactory<FileSystemQuotaClientTest> weak_factory_; |
| 239 | 240 |
| 240 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClientTest); | 241 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClientTest); |
| 241 }; | 242 }; |
| 242 | 243 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 GetOriginUsage(quota_client.get(), | 563 GetOriginUsage(quota_client.get(), |
| 563 "https://bar.com/", | 564 "https://bar.com/", |
| 564 kPersistent)); | 565 kPersistent)); |
| 565 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, | 566 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, |
| 566 GetOriginUsage(quota_client.get(), | 567 GetOriginUsage(quota_client.get(), |
| 567 "https://bar.com/", | 568 "https://bar.com/", |
| 568 kTemporary)); | 569 kTemporary)); |
| 569 } | 570 } |
| 570 | 571 |
| 571 } // namespace content | 572 } // namespace content |
| OLD | NEW |