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 "chrome/browser/chromeos/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 scoped_refptr<fileapi::ExternalMountPoints> mount_points = | 146 scoped_refptr<fileapi::ExternalMountPoints> mount_points = |
147 fileapi::ExternalMountPoints::CreateRefCounted(); | 147 fileapi::ExternalMountPoints::CreateRefCounted(); |
148 scoped_refptr<fileapi::FileSystemContext> context( | 148 scoped_refptr<fileapi::FileSystemContext> context( |
149 new fileapi::FileSystemContext( | 149 new fileapi::FileSystemContext( |
150 base::MessageLoopProxy::current().get(), | 150 base::MessageLoopProxy::current().get(), |
151 base::MessageLoopProxy::current().get(), | 151 base::MessageLoopProxy::current().get(), |
152 mount_points.get(), | 152 mount_points.get(), |
153 NULL, // special_storage_policy | 153 NULL, // special_storage_policy |
154 NULL, // quota_manager_proxy, | 154 NULL, // quota_manager_proxy, |
155 ScopedVector<fileapi::FileSystemBackend>(), | 155 ScopedVector<fileapi::FileSystemBackend>(), |
| 156 std::vector<fileapi::URLRequestAutoMountHandler>(), |
156 temp_dir_.path(), // partition_path | 157 temp_dir_.path(), // partition_path |
157 content::CreateAllowFileAccessOptions())); | 158 content::CreateAllowFileAccessOptions())); |
158 | 159 |
159 // Type:"external" + virtual_path:"drive/foo/bar" resolves to "drive/foo/bar". | 160 // Type:"external" + virtual_path:"drive/foo/bar" resolves to "drive/foo/bar". |
160 const std::string& drive_mount_name = | 161 const std::string& drive_mount_name = |
161 GetDriveMountPointPath(&profile).BaseName().AsUTF8Unsafe(); | 162 GetDriveMountPointPath(&profile).BaseName().AsUTF8Unsafe(); |
162 mount_points->RegisterFileSystem( | 163 mount_points->RegisterFileSystem( |
163 drive_mount_name, | 164 drive_mount_name, |
164 fileapi::kFileSystemTypeDrive, | 165 fileapi::kFileSystemTypeDrive, |
165 fileapi::FileSystemMountOption(), | 166 fileapi::FileSystemMountOption(), |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 file = temp_dir.path().AppendASCII("test.txt"); | 294 file = temp_dir.path().AppendASCII("test.txt"); |
294 std::string data = "Hello world!"; | 295 std::string data = "Hello world!"; |
295 EXPECT_TRUE(google_apis::test_util::WriteStringToFile(file, data)); | 296 EXPECT_TRUE(google_apis::test_util::WriteStringToFile(file, data)); |
296 EXPECT_FALSE(HasGDocFileExtension(file)); | 297 EXPECT_FALSE(HasGDocFileExtension(file)); |
297 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); | 298 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); |
298 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); | 299 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); |
299 } | 300 } |
300 | 301 |
301 } // namespace util | 302 } // namespace util |
302 } // namespace drive | 303 } // namespace drive |
OLD | NEW |