| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TearDown() override { | 38 void TearDown() override { |
| 39 file_system_context_ = NULL; | 39 file_system_context_ = NULL; |
| 40 base::RunLoop().RunUntilIdle(); | 40 base::RunLoop().RunUntilIdle(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void CreateAndRegisterTemporaryFile( | 43 void CreateAndRegisterTemporaryFile( |
| 44 FileSystemURL* file_url, | 44 FileSystemURL* file_url, |
| 45 base::FilePath* file_path) { | 45 base::FilePath* file_path) { |
| 46 EXPECT_TRUE(base::CreateTemporaryFileInDir(data_dir_.path(), file_path)); | 46 EXPECT_TRUE(base::CreateTemporaryFileInDir(data_dir_.GetPath(), file_path)); |
| 47 storage::IsolatedContext* isolated_context = | 47 storage::IsolatedContext* isolated_context = |
| 48 storage::IsolatedContext::GetInstance(); | 48 storage::IsolatedContext::GetInstance(); |
| 49 std::string name = "tmp"; | 49 std::string name = "tmp"; |
| 50 std::string fsid = isolated_context->RegisterFileSystemForPath( | 50 std::string fsid = isolated_context->RegisterFileSystemForPath( |
| 51 storage::kFileSystemTypeForTransientFile, | 51 storage::kFileSystemTypeForTransientFile, |
| 52 std::string(), | 52 std::string(), |
| 53 *file_path, | 53 *file_path, |
| 54 &name); | 54 &name); |
| 55 ASSERT_TRUE(!fsid.empty()); | 55 ASSERT_TRUE(!fsid.empty()); |
| 56 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( | 56 base::FilePath virtual_path = isolated_context->CreateVirtualRootPath( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 base::RunLoop().RunUntilIdle(); | 113 base::RunLoop().RunUntilIdle(); |
| 114 | 114 |
| 115 // Now the temporary file and the transient filesystem must be gone too. | 115 // Now the temporary file and the transient filesystem must be gone too. |
| 116 ASSERT_FALSE(base::PathExists(temp_path)); | 116 ASSERT_FALSE(base::PathExists(temp_path)); |
| 117 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND, | 117 ASSERT_EQ(base::File::FILE_ERROR_NOT_FOUND, |
| 118 file_util()->GetFileInfo(NewOperationContext().get(), | 118 file_util()->GetFileInfo(NewOperationContext().get(), |
| 119 temp_url, &file_info, &path)); | 119 temp_url, &file_info, &path)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace content | 122 } // namespace content |
| OLD | NEW |