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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 file_system_context_ = NULL; | 49 file_system_context_ = NULL; |
50 quota_manager_proxy_->SimulateQuotaManagerDestroyed(); | 50 quota_manager_proxy_->SimulateQuotaManagerDestroyed(); |
51 quota_manager_ = NULL; | 51 quota_manager_ = NULL; |
52 quota_manager_proxy_ = NULL; | 52 quota_manager_proxy_ = NULL; |
53 base::MessageLoop::current()->RunUntilIdle(); | 53 base::MessageLoop::current()->RunUntilIdle(); |
54 } | 54 } |
55 | 55 |
56 void SetUp() { | 56 void SetUp() { |
57 ASSERT_TRUE(base_.CreateUniqueTempDir()); | 57 ASSERT_TRUE(base_.CreateUniqueTempDir()); |
58 base::FilePath base_dir = base_.path(); | 58 base::FilePath base_dir = base_.path(); |
59 quota_manager_ = new quota::MockQuotaManager( | 59 quota_manager_ = |
60 false /* is_incognito */, base_dir, | 60 new quota::MockQuotaManager(false /* is_incognito */, |
61 base::MessageLoopProxy::current(), | 61 base_dir, |
62 base::MessageLoopProxy::current(), | 62 base::MessageLoopProxy::current().get(), |
63 NULL /* special storage policy */); | 63 base::MessageLoopProxy::current().get(), |
| 64 NULL /* special storage policy */); |
64 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( | 65 quota_manager_proxy_ = new quota::MockQuotaManagerProxy( |
65 quota_manager_.get(), base::MessageLoopProxy::current()); | 66 quota_manager_.get(), base::MessageLoopProxy::current().get()); |
66 file_system_context_ = | 67 file_system_context_ = |
67 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); | 68 CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir); |
68 | 69 |
69 // Prepare the origin's root directory. | 70 // Prepare the origin's root directory. |
70 FileSystemMountPointProvider* mount_point_provider = | 71 FileSystemMountPointProvider* mount_point_provider = |
71 file_system_context_->GetMountPointProvider(src_type_); | 72 file_system_context_->GetMountPointProvider(src_type_); |
72 mount_point_provider->OpenFileSystem( | 73 mount_point_provider->OpenFileSystem( |
73 origin_, src_type_, | 74 origin_, src_type_, |
74 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 75 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
75 base::Bind(&ExpectOk)); | 76 base::Bind(&ExpectOk)); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 test::kRegularTestCaseSize); | 420 test::kRegularTestCaseSize); |
420 | 421 |
421 int64 src_new_usage = helper.GetSourceUsage(); | 422 int64 src_new_usage = helper.GetSourceUsage(); |
422 ASSERT_EQ(src_initial_usage, src_new_usage); | 423 ASSERT_EQ(src_initial_usage, src_new_usage); |
423 | 424 |
424 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; | 425 int64 dest_increase = helper.GetDestUsage() - dest_initial_usage; |
425 ASSERT_EQ(src_increase, dest_increase); | 426 ASSERT_EQ(src_increase, dest_increase); |
426 } | 427 } |
427 | 428 |
428 } // namespace fileapi | 429 } // namespace fileapi |
OLD | NEW |