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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 file_system_context_ = new FileSystemContext( | 212 file_system_context_ = new FileSystemContext( |
213 base::MessageLoopProxy::current(), | 213 base::MessageLoopProxy::current(), |
214 base::MessageLoopProxy::current(), | 214 base::MessageLoopProxy::current(), |
215 special_storage_policy_, | 215 special_storage_policy_, |
216 NULL, | 216 NULL, |
217 data_dir_.path(), | 217 data_dir_.path(), |
218 options); | 218 options); |
219 #if defined(OS_CHROMEOS) | 219 #if defined(OS_CHROMEOS) |
220 ExternalFileSystemMountPointProvider* external_provider = | 220 ExternalFileSystemMountPointProvider* external_provider = |
221 file_system_context_->external_provider(); | 221 file_system_context_->external_provider(); |
222 external_provider->AddMountPoint(FilePath(kMountPoint)); | 222 external_provider->AddLocalMountPoint(FilePath(kMountPoint)); |
223 #endif | 223 #endif |
224 } | 224 } |
225 | 225 |
226 FileSystemMountPointProvider* provider(FileSystemType type) { | 226 FileSystemMountPointProvider* provider(FileSystemType type) { |
227 DCHECK(file_system_context_); | 227 DCHECK(file_system_context_); |
228 return file_system_context_->GetMountPointProvider(type); | 228 return file_system_context_->GetMountPointProvider(type); |
229 } | 229 } |
230 | 230 |
231 bool GetRootPath(const GURL& origin_url, | 231 bool GetRootPath(const GURL& origin_url, |
232 fileapi::FileSystemType type, | 232 fileapi::FileSystemType type, |
(...skipping 14 matching lines...) Expand all Loading... |
247 FilePath file_system_path() const { | 247 FilePath file_system_path() const { |
248 return data_dir_.path().Append( | 248 return data_dir_.path().Append( |
249 SandboxMountPointProvider::kNewFileSystemDirectory); | 249 SandboxMountPointProvider::kNewFileSystemDirectory); |
250 } | 250 } |
251 FileSystemContext* file_system_context() const { | 251 FileSystemContext* file_system_context() const { |
252 return file_system_context_.get(); | 252 return file_system_context_.get(); |
253 } | 253 } |
254 | 254 |
255 private: | 255 private: |
256 ScopedTempDir data_dir_; | 256 ScopedTempDir data_dir_; |
| 257 MessageLoop message_loop_; |
257 base::WeakPtrFactory<FileSystemMountPointProviderTest> weak_factory_; | 258 base::WeakPtrFactory<FileSystemMountPointProviderTest> weak_factory_; |
258 | 259 |
259 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 260 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
260 scoped_refptr<FileSystemContext> file_system_context_; | 261 scoped_refptr<FileSystemContext> file_system_context_; |
261 | 262 |
262 DISALLOW_COPY_AND_ASSIGN(FileSystemMountPointProviderTest); | 263 DISALLOW_COPY_AND_ASSIGN(FileSystemMountPointProviderTest); |
263 }; | 264 }; |
264 | 265 |
265 TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) { | 266 TEST_F(FileSystemMountPointProviderTest, GetRootPathCreateAndExamine) { |
266 std::vector<FilePath> returned_root_path( | 267 std::vector<FilePath> returned_root_path( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 FilePath virtual_unused; | 405 FilePath virtual_unused; |
405 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 406 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
406 &virtual_unused)); | 407 &virtual_unused)); |
407 external_provider->RemoveMountPoint(FilePath(kMountPoint)); | 408 external_provider->RemoveMountPoint(FilePath(kMountPoint)); |
408 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 409 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
409 &virtual_unused)); | 410 &virtual_unused)); |
410 } | 411 } |
411 #endif | 412 #endif |
412 | 413 |
413 } // namespace fileapi | 414 } // namespace fileapi |
OLD | NEW |