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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 base::FilePath( | 757 base::FilePath( |
758 SandboxIsolatedOriginDatabase::kObsoleteOriginDirectory)); | 758 SandboxIsolatedOriginDatabase::kObsoleteOriginDirectory)); |
759 base::FilePath path; | 759 base::FilePath path; |
760 EXPECT_TRUE(database_old.GetPathForOrigin(origin_string, &path)); | 760 EXPECT_TRUE(database_old.GetPathForOrigin(origin_string, &path)); |
761 EXPECT_FALSE(path.empty()); | 761 EXPECT_FALSE(path.empty()); |
762 | 762 |
763 // Populate the origin directory with some fake data. | 763 // Populate the origin directory with some fake data. |
764 old_directory_db_path = data_dir_path().Append(path); | 764 old_directory_db_path = data_dir_path().Append(path); |
765 ASSERT_TRUE(base::CreateDirectory(old_directory_db_path)); | 765 ASSERT_TRUE(base::CreateDirectory(old_directory_db_path)); |
766 EXPECT_EQ(static_cast<int>(kFakeDirectoryData.size()), | 766 EXPECT_EQ(static_cast<int>(kFakeDirectoryData.size()), |
767 file_util::WriteFile(old_directory_db_path.AppendASCII("dummy"), | 767 base::WriteFile(old_directory_db_path.AppendASCII("dummy"), |
768 kFakeDirectoryData.data(), | 768 kFakeDirectoryData.data(), |
769 kFakeDirectoryData.size())); | 769 kFakeDirectoryData.size())); |
770 } | 770 } |
771 | 771 |
772 storage_policy_->AddIsolated(origin_); | 772 storage_policy_->AddIsolated(origin_); |
773 scoped_ptr<ObfuscatedFileUtil> file_util = CreateObfuscatedFileUtil( | 773 scoped_ptr<ObfuscatedFileUtil> file_util = CreateObfuscatedFileUtil( |
774 storage_policy_.get()); | 774 storage_policy_.get()); |
775 base::File::Error error = base::File::FILE_ERROR_FAILED; | 775 base::File::Error error = base::File::FILE_ERROR_FAILED; |
776 base::FilePath origin_directory = file_util->GetDirectoryForOrigin( | 776 base::FilePath origin_directory = file_util->GetDirectoryForOrigin( |
777 origin_, true /* create */, &error); | 777 origin_, true /* create */, &error); |
778 EXPECT_EQ(base::File::FILE_OK, error); | 778 EXPECT_EQ(base::File::FILE_OK, error); |
779 | 779 |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 false /* exclusive */, | 2484 false /* exclusive */, |
2485 true /* recursive */)); | 2485 true /* recursive */)); |
2486 ASSERT_EQ(base::File::FILE_ERROR_NOT_A_DIRECTORY, | 2486 ASSERT_EQ(base::File::FILE_ERROR_NOT_A_DIRECTORY, |
2487 ofu()->CreateDirectory(UnlimitedContext().get(), | 2487 ofu()->CreateDirectory(UnlimitedContext().get(), |
2488 path_in_file_in_file, | 2488 path_in_file_in_file, |
2489 false /* exclusive */, | 2489 false /* exclusive */, |
2490 true /* recursive */)); | 2490 true /* recursive */)); |
2491 } | 2491 } |
2492 | 2492 |
2493 } // namespace content | 2493 } // namespace content |
OLD | NEW |