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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/scoped_temp_dir.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_types.h" | 18 #include "webkit/fileapi/file_system_types.h" |
18 #include "webkit/fileapi/file_system_usage_cache.h" | 19 #include "webkit/fileapi/file_system_usage_cache.h" |
19 #include "webkit/fileapi/file_system_util.h" | 20 #include "webkit/fileapi/file_system_util.h" |
20 #include "webkit/fileapi/mock_file_system_options.h" | 21 #include "webkit/fileapi/mock_file_system_options.h" |
21 #include "webkit/fileapi/obfuscated_file_util.h" | 22 #include "webkit/fileapi/obfuscated_file_util.h" |
22 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 23 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
23 #include "webkit/quota/quota_types.h" | 24 #include "webkit/quota/quota_types.h" |
24 | 25 |
25 namespace fileapi { | 26 namespace fileapi { |
26 namespace { | 27 namespace { |
(...skipping 13 matching lines...) Expand all Loading... |
40 FileSystemQuotaClientTest() | 41 FileSystemQuotaClientTest() |
41 : weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 42 : weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
42 additional_callback_count_(0), | 43 additional_callback_count_(0), |
43 deletion_status_(quota::kQuotaStatusUnknown) { | 44 deletion_status_(quota::kQuotaStatusUnknown) { |
44 } | 45 } |
45 | 46 |
46 void SetUp() { | 47 void SetUp() { |
47 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 48 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
48 file_system_context_ = | 49 file_system_context_ = |
49 new FileSystemContext( | 50 new FileSystemContext( |
50 base::MessageLoopProxy::current(), | 51 FileSystemTaskRunners::CreateMockTaskRunners(), |
51 base::MessageLoopProxy::current(), | |
52 NULL, NULL, | 52 NULL, NULL, |
53 data_dir_.path(), | 53 data_dir_.path(), |
54 CreateDisallowFileAccessOptions()); | 54 CreateDisallowFileAccessOptions()); |
55 } | 55 } |
56 | 56 |
57 struct TestFile { | 57 struct TestFile { |
58 bool isDirectory; | 58 bool isDirectory; |
59 const char* name; | 59 const char* name; |
60 int64 size; | 60 int64 size; |
61 const char* origin_url; | 61 const char* origin_url; |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 GetOriginUsage(quota_client.get(), | 579 GetOriginUsage(quota_client.get(), |
580 "https://bar.com/", | 580 "https://bar.com/", |
581 kPersistent)); | 581 kPersistent)); |
582 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, | 582 EXPECT_EQ(64 + file_paths_cost_temporary_bar_https, |
583 GetOriginUsage(quota_client.get(), | 583 GetOriginUsage(quota_client.get(), |
584 "https://bar.com/", | 584 "https://bar.com/", |
585 kTemporary)); | 585 kTemporary)); |
586 } | 586 } |
587 | 587 |
588 } // namespace fileapi | 588 } // namespace fileapi |
OLD | NEW |