| 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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 protected: | 238 protected: |
| 239 base::ScopedTempDir temp_dir_; | 239 base::ScopedTempDir temp_dir_; |
| 240 chromeos::FakeChromeUserManager* fake_user_manager_; | 240 chromeos::FakeChromeUserManager* fake_user_manager_; |
| 241 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 241 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
| 242 | 242 |
| 243 // Creates a testing file system in a testing directory. | 243 // Creates a testing file system in a testing directory. |
| 244 void CreateTestingFileSystem(const std::string& mount_point_name, | 244 void CreateTestingFileSystem(const std::string& mount_point_name, |
| 245 bool read_only) { | 245 bool read_only) { |
| 246 const base::FilePath mount_point_path = | 246 const base::FilePath mount_point_path = |
| 247 temp_dir_.path().Append(mount_point_name); | 247 temp_dir_.GetPath().Append(mount_point_name); |
| 248 ASSERT_TRUE(base::CreateDirectory(mount_point_path)); | 248 ASSERT_TRUE(base::CreateDirectory(mount_point_path)); |
| 249 ASSERT_TRUE( | 249 ASSERT_TRUE( |
| 250 base::CreateDirectory(mount_point_path.Append(kChildDirectory))); | 250 base::CreateDirectory(mount_point_path.Append(kChildDirectory))); |
| 251 ASSERT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile()) | 251 ASSERT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile()) |
| 252 ->RegisterFileSystem( | 252 ->RegisterFileSystem( |
| 253 mount_point_name, storage::kFileSystemTypeNativeLocal, | 253 mount_point_name, storage::kFileSystemTypeNativeLocal, |
| 254 storage::FileSystemMountOption(), mount_point_path)); | 254 storage::FileSystemMountOption(), mount_point_path)); |
| 255 VolumeManager* const volume_manager = | 255 VolumeManager* const volume_manager = |
| 256 VolumeManager::Get(browser()->profile()); | 256 VolumeManager::Get(browser()->profile()); |
| 257 ASSERT_TRUE(volume_manager); | 257 ASSERT_TRUE(volume_manager); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, | 493 profile(), extensions::api::file_system::OnVolumeListChanged::kEventName, |
| 494 kTestingExtensionId, | 494 kTestingExtensionId, |
| 495 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, | 495 base::Bind(&FileSystemApiTestForRequestFileSystem::MountFakeVolume, |
| 496 base::Unretained(this))); | 496 base::Unretained(this))); |
| 497 | 497 |
| 498 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) | 498 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/on_volume_list_changed")) |
| 499 << message_; | 499 << message_; |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace extensions | 502 } // namespace extensions |
| OLD | NEW |