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>(), | |
157 temp_dir_.path(), // partition_path | 156 temp_dir_.path(), // partition_path |
158 content::CreateAllowFileAccessOptions())); | 157 content::CreateAllowFileAccessOptions())); |
159 | 158 |
160 // Type:"external" + virtual_path:"drive/foo/bar" resolves to "drive/foo/bar". | 159 // Type:"external" + virtual_path:"drive/foo/bar" resolves to "drive/foo/bar". |
161 const std::string& drive_mount_name = | 160 const std::string& drive_mount_name = |
162 GetDriveMountPointPath(&profile).BaseName().AsUTF8Unsafe(); | 161 GetDriveMountPointPath(&profile).BaseName().AsUTF8Unsafe(); |
163 mount_points->RegisterFileSystem( | 162 mount_points->RegisterFileSystem( |
164 drive_mount_name, | 163 drive_mount_name, |
165 fileapi::kFileSystemTypeDrive, | 164 fileapi::kFileSystemTypeDrive, |
166 fileapi::FileSystemMountOption(), | 165 fileapi::FileSystemMountOption(), |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 file = temp_dir.path().AppendASCII("test.txt"); | 293 file = temp_dir.path().AppendASCII("test.txt"); |
295 std::string data = "Hello world!"; | 294 std::string data = "Hello world!"; |
296 EXPECT_TRUE(google_apis::test_util::WriteStringToFile(file, data)); | 295 EXPECT_TRUE(google_apis::test_util::WriteStringToFile(file, data)); |
297 EXPECT_FALSE(HasGDocFileExtension(file)); | 296 EXPECT_FALSE(HasGDocFileExtension(file)); |
298 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); | 297 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); |
299 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); | 298 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); |
300 } | 299 } |
301 | 300 |
302 } // namespace util | 301 } // namespace util |
303 } // namespace drive | 302 } // namespace drive |
OLD | NEW |