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/bind.h" | 6 #include "base/bind.h" |
6 #include "base/basictypes.h" | |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
10 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
11 #include "base/scoped_temp_dir.h" | |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "webkit/fileapi/file_system_context.h" | 14 #include "webkit/fileapi/file_system_context.h" |
15 #include "webkit/fileapi/file_system_operation_context.h" | 15 #include "webkit/fileapi/file_system_operation_context.h" |
16 #include "webkit/fileapi/file_system_quota_client.h" | 16 #include "webkit/fileapi/file_system_quota_client.h" |
17 #include "webkit/fileapi/file_system_task_runners.h" | 17 #include "webkit/fileapi/file_system_task_runners.h" |
18 #include "webkit/fileapi/file_system_types.h" | 18 #include "webkit/fileapi/file_system_types.h" |
19 #include "webkit/fileapi/file_system_usage_cache.h" | 19 #include "webkit/fileapi/file_system_usage_cache.h" |
20 #include "webkit/fileapi/file_system_util.h" | 20 #include "webkit/fileapi/file_system_util.h" |
21 #include "webkit/fileapi/mock_file_system_options.h" | 21 #include "webkit/fileapi/mock_file_system_options.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 244 } |
245 | 245 |
246 void OnGetAdditionalUsage(int64 usage_unused) { | 246 void OnGetAdditionalUsage(int64 usage_unused) { |
247 ++additional_callback_count_; | 247 ++additional_callback_count_; |
248 } | 248 } |
249 | 249 |
250 void OnDeleteOrigin(quota::QuotaStatusCode status) { | 250 void OnDeleteOrigin(quota::QuotaStatusCode status) { |
251 deletion_status_ = status; | 251 deletion_status_ = status; |
252 } | 252 } |
253 | 253 |
254 ScopedTempDir data_dir_; | 254 base::ScopedTempDir data_dir_; |
255 MessageLoop message_loop_; | 255 MessageLoop message_loop_; |
256 scoped_refptr<FileSystemContext> file_system_context_; | 256 scoped_refptr<FileSystemContext> file_system_context_; |
257 base::WeakPtrFactory<FileSystemQuotaClientTest> weak_factory_; | 257 base::WeakPtrFactory<FileSystemQuotaClientTest> weak_factory_; |
258 int64 usage_; | 258 int64 usage_; |
259 int additional_callback_count_; | 259 int additional_callback_count_; |
260 std::set<GURL> origins_; | 260 std::set<GURL> origins_; |
261 quota::StorageType type_; | 261 quota::StorageType type_; |
262 quota::QuotaStatusCode deletion_status_; | 262 quota::QuotaStatusCode deletion_status_; |
263 | 263 |
264 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClientTest); | 264 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClientTest); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 GetOriginUsage(quota_client.get(), | 582 GetOriginUsage(quota_client.get(), |
583 "https://bar.com/", | 583 "https://bar.com/", |
584 kPersistent)); | 584 kPersistent)); |
585 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, | 585 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, |
586 GetOriginUsage(quota_client.get(), | 586 GetOriginUsage(quota_client.get(), |
587 "https://bar.com/", | 587 "https://bar.com/", |
588 kTemporary)); | 588 kTemporary)); |
589 } | 589 } |
590 | 590 |
591 } // namespace fileapi | 591 } // namespace fileapi |
OLD | NEW |