OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 complete_(false), | 63 complete_(false), |
64 weak_factory_(this) { | 64 weak_factory_(this) { |
65 change_observers_ = | 65 change_observers_ = |
66 storage::MockFileChangeObserver::CreateList(&change_observer_); | 66 storage::MockFileChangeObserver::CreateList(&change_observer_); |
67 } | 67 } |
68 | 68 |
69 void SetUp() override { | 69 void SetUp() override { |
70 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 70 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
71 | 71 |
72 quota_manager_ = | 72 quota_manager_ = |
73 new MockQuotaManager(false /* is_incognito */, dir_.path(), | 73 new MockQuotaManager(false /* is_incognito */, dir_.GetPath(), |
74 base::ThreadTaskRunnerHandle::Get().get(), | 74 base::ThreadTaskRunnerHandle::Get().get(), |
75 base::ThreadTaskRunnerHandle::Get().get(), | 75 base::ThreadTaskRunnerHandle::Get().get(), |
76 NULL /* special storage policy */); | 76 NULL /* special storage policy */); |
77 virtual_path_ = base::FilePath(FILE_PATH_LITERAL("temporary file")); | 77 virtual_path_ = base::FilePath(FILE_PATH_LITERAL("temporary file")); |
78 | 78 |
79 file_system_context_ = CreateFileSystemContextForTesting( | 79 file_system_context_ = CreateFileSystemContextForTesting( |
80 quota_manager_->proxy(), dir_.path()); | 80 quota_manager_->proxy(), dir_.GetPath()); |
81 url_request_context_.reset( | 81 url_request_context_.reset( |
82 new MockBlobURLRequestContext(file_system_context_.get())); | 82 new MockBlobURLRequestContext(file_system_context_.get())); |
83 | 83 |
84 file_system_context_->operation_runner()->CreateFile( | 84 file_system_context_->operation_runner()->CreateFile( |
85 URLForPath(virtual_path_), true /* exclusive */, | 85 URLForPath(virtual_path_), true /* exclusive */, |
86 base::Bind(&AssertStatusEq, base::File::FILE_OK)); | 86 base::Bind(&AssertStatusEq, base::File::FILE_OK)); |
87 | 87 |
88 static_cast<TestFileSystemBackend*>( | 88 static_cast<TestFileSystemBackend*>( |
89 file_system_context_->GetFileSystemBackend(kFileSystemType)) | 89 file_system_context_->GetFileSystemBackend(kFileSystemType)) |
90 ->AddFileChangeObserver(change_observer()); | 90 ->AddFileChangeObserver(change_observer()); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status()); | 325 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status()); |
326 EXPECT_EQ(base::File::FILE_OK, cancel_status()); | 326 EXPECT_EQ(base::File::FILE_OK, cancel_status()); |
327 EXPECT_TRUE(complete()); | 327 EXPECT_TRUE(complete()); |
328 | 328 |
329 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); | 329 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); |
330 } | 330 } |
331 | 331 |
332 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. | 332 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. |
333 | 333 |
334 } // namespace content | 334 } // namespace content |
OLD | NEW |