| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 void AddFileWatchCallback(bool success) {} | 137 void AddFileWatchCallback(bool success) {} |
| 138 | 138 |
| 139 bool InitializeLocalFileSystem(std::string mount_point_name, | 139 bool InitializeLocalFileSystem(std::string mount_point_name, |
| 140 base::ScopedTempDir* temp_dir, | 140 base::ScopedTempDir* temp_dir, |
| 141 base::FilePath* mount_point_dir) { | 141 base::FilePath* mount_point_dir) { |
| 142 const char kTestFileContent[] = "The five boxing wizards jumped quickly"; | 142 const char kTestFileContent[] = "The five boxing wizards jumped quickly"; |
| 143 if (!temp_dir->CreateUniqueTempDir()) | 143 if (!temp_dir->CreateUniqueTempDir()) |
| 144 return false; | 144 return false; |
| 145 | 145 |
| 146 *mount_point_dir = temp_dir->path().AppendASCII(mount_point_name); | 146 *mount_point_dir = temp_dir->GetPath().AppendASCII(mount_point_name); |
| 147 // Create the mount point. | 147 // Create the mount point. |
| 148 if (!base::CreateDirectory(*mount_point_dir)) | 148 if (!base::CreateDirectory(*mount_point_dir)) |
| 149 return false; | 149 return false; |
| 150 | 150 |
| 151 const base::FilePath test_dir = mount_point_dir->AppendASCII("test_dir"); | 151 const base::FilePath test_dir = mount_point_dir->AppendASCII("test_dir"); |
| 152 if (!base::CreateDirectory(test_dir)) | 152 if (!base::CreateDirectory(test_dir)) |
| 153 return false; | 153 return false; |
| 154 | 154 |
| 155 const base::FilePath test_file = test_dir.AppendASCII("test_file.txt"); | 155 const base::FilePath test_file = test_dir.AppendASCII("test_file.txt"); |
| 156 if (!google_apis::test_util::WriteStringToFile(test_file, kTestFileContent)) | 156 if (!google_apis::test_util::WriteStringToFile(test_file, kTestFileContent)) |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 ->RegisterFileSystem( | 441 ->RegisterFileSystem( |
| 442 kLocalMountPointName, storage::kFileSystemTypeNativeLocal, | 442 kLocalMountPointName, storage::kFileSystemTypeNativeLocal, |
| 443 storage::FileSystemMountOption(), mount_point_dir)); | 443 storage::FileSystemMountOption(), mount_point_dir)); |
| 444 file_manager::VolumeManager::Get(browser()->profile()) | 444 file_manager::VolumeManager::Get(browser()->profile()) |
| 445 ->AddVolumeForTesting(mount_point_dir, file_manager::VOLUME_TYPE_TESTING, | 445 ->AddVolumeForTesting(mount_point_dir, file_manager::VOLUME_TYPE_TESTING, |
| 446 chromeos::DEVICE_TYPE_UNKNOWN, | 446 chromeos::DEVICE_TYPE_UNKNOWN, |
| 447 false /* read_only */); | 447 false /* read_only */); |
| 448 | 448 |
| 449 ASSERT_TRUE(RunComponentExtensionTest("file_browser/content_checksum_test")); | 449 ASSERT_TRUE(RunComponentExtensionTest("file_browser/content_checksum_test")); |
| 450 } | 450 } |
| OLD | NEW |