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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 complete_(false), | 83 complete_(false), |
84 url_request_context_(test_helper_.file_system_context()) { | 84 url_request_context_(test_helper_.file_system_context()) { |
85 change_observers_ = MockFileChangeObserver::CreateList(&change_observer_); | 85 change_observers_ = MockFileChangeObserver::CreateList(&change_observer_); |
86 } | 86 } |
87 | 87 |
88 virtual void SetUp() { | 88 virtual void SetUp() { |
89 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 89 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
90 base::FilePath base_dir = dir_.path().AppendASCII("filesystem"); | 90 base::FilePath base_dir = dir_.path().AppendASCII("filesystem"); |
91 | 91 |
92 quota_manager_ = new MockQuotaManager(base_dir, 1024); | 92 quota_manager_ = new MockQuotaManager(base_dir, 1024); |
93 test_helper_.SetUp(base_dir, | 93 test_helper_.SetUp(base_dir, quota_manager_->proxy()); |
94 false /* unlimited quota */, | |
95 quota_manager_->proxy()); | |
96 virtual_path_ = base::FilePath(FILE_PATH_LITERAL("temporary file")); | 94 virtual_path_ = base::FilePath(FILE_PATH_LITERAL("temporary file")); |
97 | 95 |
98 NewOperation()->CreateFile( | 96 NewOperation()->CreateFile( |
99 URLForPath(virtual_path_), true /* exclusive */, | 97 URLForPath(virtual_path_), true /* exclusive */, |
100 base::Bind(&AssertStatusEq, base::PLATFORM_FILE_OK)); | 98 base::Bind(&AssertStatusEq, base::PLATFORM_FILE_OK)); |
101 } | 99 } |
102 | 100 |
103 virtual void TearDown() { | 101 virtual void TearDown() { |
104 quota_manager_ = NULL; | 102 quota_manager_ = NULL; |
105 test_helper_.TearDown(); | 103 test_helper_.TearDown(); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); | 343 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); |
346 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); | 344 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); |
347 EXPECT_TRUE(complete()); | 345 EXPECT_TRUE(complete()); |
348 | 346 |
349 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); | 347 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); |
350 } | 348 } |
351 | 349 |
352 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. | 350 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. |
353 | 351 |
354 } // namespace fileapi | 352 } // namespace fileapi |
OLD | NEW |