| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/message_loop_proxy.h" | 15 #include "base/message_loop_proxy.h" |
| 16 #include "base/scoped_temp_dir.h" | 16 #include "base/scoped_temp_dir.h" |
| 17 #include "base/sys_string_conversions.h" | 17 #include "base/sys_string_conversions.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "webkit/fileapi/file_system_context.h" | 21 #include "webkit/fileapi/file_system_context.h" |
| 22 #include "webkit/fileapi/file_system_task_runners.h" |
| 22 #include "webkit/fileapi/file_system_util.h" | 23 #include "webkit/fileapi/file_system_util.h" |
| 23 #include "webkit/fileapi/mock_file_system_options.h" | 24 #include "webkit/fileapi/mock_file_system_options.h" |
| 24 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 25 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 25 #include "webkit/quota/mock_special_storage_policy.h" | 26 #include "webkit/quota/mock_special_storage_policy.h" |
| 26 | 27 |
| 27 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 28 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" | 29 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 namespace fileapi { | 32 namespace fileapi { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 void SetUp() { | 206 void SetUp() { |
| 206 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 207 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 207 special_storage_policy_ = new quota::MockSpecialStoragePolicy; | 208 special_storage_policy_ = new quota::MockSpecialStoragePolicy; |
| 208 } | 209 } |
| 209 | 210 |
| 210 protected: | 211 protected: |
| 211 void SetupNewContext(const FileSystemOptions& options) { | 212 void SetupNewContext(const FileSystemOptions& options) { |
| 212 file_system_context_ = new FileSystemContext( | 213 file_system_context_ = new FileSystemContext( |
| 213 base::MessageLoopProxy::current(), | 214 FileSystemTaskRunners::CreateMockTaskRunners(), |
| 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->AddLocalMountPoint(FilePath(kMountPoint)); | 222 external_provider->AddLocalMountPoint(FilePath(kMountPoint)); |
| 223 #endif | 223 #endif |
| 224 } | 224 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 FilePath virtual_unused; | 405 FilePath virtual_unused; |
| 406 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 406 EXPECT_TRUE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
| 407 &virtual_unused)); | 407 &virtual_unused)); |
| 408 external_provider->RemoveMountPoint(FilePath(kMountPoint)); | 408 external_provider->RemoveMountPoint(FilePath(kMountPoint)); |
| 409 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), | 409 EXPECT_FALSE(external_provider->GetVirtualPath(FilePath(kMountPoint), |
| 410 &virtual_unused)); | 410 &virtual_unused)); |
| 411 } | 411 } |
| 412 #endif | 412 #endif |
| 413 | 413 |
| 414 } // namespace fileapi | 414 } // namespace fileapi |
| OLD | NEW |