OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <map> | 5 #include <map> |
6 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 base::MessageLoopProxy::current().get(), | 65 base::MessageLoopProxy::current().get(), |
66 NULL /* special storage policy */); | 66 NULL /* special storage policy */); |
67 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( | 67 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( |
68 quota_manager_.get(), base::MessageLoopProxy::current().get()); | 68 quota_manager_.get(), base::MessageLoopProxy::current().get()); |
69 file_system_context_ = | 69 file_system_context_ = |
70 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); | 70 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); |
71 | 71 |
72 // Prepare the origin's root directory. | 72 // Prepare the origin's root directory. |
73 FileSystemBackend* mount_point_provider = | 73 FileSystemBackend* mount_point_provider = |
74 file_system_context_->GetFileSystemBackend(src_type_); | 74 file_system_context_->GetFileSystemBackend(src_type_); |
75 mount_point_provider->OpenFileSystem( | 75 mount_point_provider->InitializeFileSystem( |
76 origin_, src_type_, | 76 origin_, src_type_, |
77 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 77 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
| 78 NULL /* context */, |
78 base::Bind(&ExpectOk)); | 79 base::Bind(&ExpectOk)); |
79 mount_point_provider = | 80 mount_point_provider = |
80 file_system_context_->GetFileSystemBackend(dest_type_); | 81 file_system_context_->GetFileSystemBackend(dest_type_); |
81 mount_point_provider->OpenFileSystem( | 82 mount_point_provider->InitializeFileSystem( |
82 origin_, dest_type_, | 83 origin_, dest_type_, |
83 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 84 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
| 85 NULL /* context */, |
84 base::Bind(&ExpectOk)); | 86 base::Bind(&ExpectOk)); |
85 base::MessageLoop::current()->RunUntilIdle(); | 87 base::MessageLoop::current()->RunUntilIdle(); |
86 | 88 |
87 // Grant relatively big quota initially. | 89 // Grant relatively big quota initially. |
88 quota_manager_->SetQuota(origin_, | 90 quota_manager_->SetQuota(origin_, |
89 FileSystemTypeToQuotaStorageType(src_type_), | 91 FileSystemTypeToQuotaStorageType(src_type_), |
90 1024 * 1024); | 92 1024 * 1024); |
91 quota_manager_->SetQuota(origin_, | 93 quota_manager_->SetQuota(origin_, |
92 FileSystemTypeToQuotaStorageType(dest_type_), | 94 FileSystemTypeToQuotaStorageType(dest_type_), |
93 1024 * 1024); | 95 1024 * 1024); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 test::kRegularTestCaseSize); | 424 test::kRegularTestCaseSize); |
423 | 425 |
424 int64 src_new_usage = helper.GetSourceUsage(); | 426 int64 src_new_usage = helper.GetSourceUsage(); |
425 ASSERT_EQ(src_initial_usage, src_new_usage); | 427 ASSERT_EQ(src_initial_usage, src_new_usage); |
426 | 428 |
427 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; | 429 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; |
428 ASSERT_EQ(src_increase, dest_increase); | 430 ASSERT_EQ(src_increase, dest_increase); |
429 } | 431 } |
430 | 432 |
431 } // namespace fileapi | 433 } // namespace fileapi |
OLD | NEW |