| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <wincrypt.h> | 6 #include <wincrypt.h> |
| 7 | 7 |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 // Make up some path under the temp dir. | 155 // Make up some path under the temp dir. |
| 156 base::FilePath parent_temp_dir(work_dir.path().Append(L"One").Append(L"Two")); | 156 base::FilePath parent_temp_dir(work_dir.path().Append(L"One").Append(L"Two")); |
| 157 { | 157 { |
| 158 SelfCleaningTempDir temp_dir; | 158 SelfCleaningTempDir temp_dir; |
| 159 EXPECT_TRUE(temp_dir.Initialize(parent_temp_dir, L"Three")); | 159 EXPECT_TRUE(temp_dir.Initialize(parent_temp_dir, L"Three")); |
| 160 EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir.path()); | 160 EXPECT_EQ(parent_temp_dir.Append(L"Three"), temp_dir.path()); |
| 161 EXPECT_TRUE(base::DirectoryExists(temp_dir.path())); | 161 EXPECT_TRUE(base::DirectoryExists(temp_dir.path())); |
| 162 // Drop a file somewhere. | 162 // Drop a file somewhere. |
| 163 EXPECT_EQ(arraysize(kHiHon) - 1, | 163 EXPECT_EQ(arraysize(kHiHon) - 1, |
| 164 file_util::WriteFile(parent_temp_dir.Append(GetRandomFilename()), | 164 base::WriteFile(parent_temp_dir.Append(GetRandomFilename()), |
| 165 kHiHon, arraysize(kHiHon) - 1)); | 165 kHiHon, arraysize(kHiHon) - 1)); |
| 166 } | 166 } |
| 167 EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three"))); | 167 EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three"))); |
| 168 EXPECT_TRUE(base::DirectoryExists(parent_temp_dir)); | 168 EXPECT_TRUE(base::DirectoryExists(parent_temp_dir)); |
| 169 EXPECT_TRUE(work_dir.Delete()); | 169 EXPECT_TRUE(work_dir.Delete()); |
| 170 EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName())); | 170 EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.DirName().DirName())); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace installer | 173 } // namespace installer |
| OLD | NEW |