OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 async_file_util_.reset(new internal::ProviderAsyncFileUtil); | 128 async_file_util_.reset(new internal::ProviderAsyncFileUtil); |
129 | 129 |
130 file_system_context_ = | 130 file_system_context_ = |
131 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); | 131 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); |
132 | 132 |
133 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); | 133 ServiceFactory::GetInstance()->SetTestingFactory(profile_, &CreateService); |
134 Service* service = Service::Get(profile_); // Owned by its factory. | 134 Service* service = Service::Get(profile_); // Owned by its factory. |
135 service->SetFileSystemFactoryForTesting( | 135 service->SetFileSystemFactoryForTesting( |
136 base::Bind(&FakeProvidedFileSystem::Create)); | 136 base::Bind(&FakeProvidedFileSystem::Create)); |
137 | 137 |
138 const bool result = service->MountFileSystem( | 138 const base::File::Error result = service->MountFileSystem( |
139 kExtensionId, MountOptions(kFileSystemId, "Testing File System")); | 139 kExtensionId, MountOptions(kFileSystemId, "Testing File System")); |
140 ASSERT_TRUE(result); | 140 ASSERT_EQ(base::File::FILE_OK, result); |
141 const ProvidedFileSystemInfo& file_system_info = | 141 const ProvidedFileSystemInfo& file_system_info = |
142 service->GetProvidedFileSystem(kExtensionId, kFileSystemId) | 142 service->GetProvidedFileSystem(kExtensionId, kFileSystemId) |
143 ->GetFileSystemInfo(); | 143 ->GetFileSystemInfo(); |
144 const std::string mount_point_name = | 144 const std::string mount_point_name = |
145 file_system_info.mount_path().BaseName().AsUTF8Unsafe(); | 145 file_system_info.mount_path().BaseName().AsUTF8Unsafe(); |
146 | 146 |
147 file_url_ = | 147 file_url_ = |
148 CreateFileSystemURL(mount_point_name, | 148 CreateFileSystemURL(mount_point_name, |
149 base::FilePath::FromUTF8Unsafe( | 149 base::FilePath::FromUTF8Unsafe( |
150 kFakeFilePath + 1 /* No leading slash. */)); | 150 kFakeFilePath + 1 /* No leading slash. */)); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 file_url_, | 417 file_url_, |
418 base::Bind(&EventLogger::OnCreateSnapshotFile, | 418 base::Bind(&EventLogger::OnCreateSnapshotFile, |
419 base::Unretained(&logger))); | 419 base::Unretained(&logger))); |
420 | 420 |
421 ASSERT_TRUE(logger.result()); | 421 ASSERT_TRUE(logger.result()); |
422 EXPECT_EQ(base::File::FILE_ERROR_INVALID_OPERATION, *logger.result()); | 422 EXPECT_EQ(base::File::FILE_ERROR_INVALID_OPERATION, *logger.result()); |
423 } | 423 } |
424 | 424 |
425 } // namespace file_system_provider | 425 } // namespace file_system_provider |
426 } // namespace chromeos | 426 } // namespace chromeos |
OLD | NEW |