OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <iostream> | 8 #include <iostream> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Create a fresh, empty copy of this test directory. | 27 // Create a fresh, empty copy of this test directory. |
28 file_util::Delete(test_dir_, true); | 28 file_util::Delete(test_dir_, true); |
29 file_util::CreateDirectoryW(test_dir_); | 29 file_util::CreateDirectoryW(test_dir_); |
30 ASSERT_TRUE(file_util::PathExists(test_dir_)); | 30 ASSERT_TRUE(file_util::PathExists(test_dir_)); |
31 } | 31 } |
32 | 32 |
33 virtual void TearDown() { | 33 virtual void TearDown() { |
34 logging::CloseLogFile(); | 34 logging::CloseLogFile(); |
35 // Clean up test directory | 35 // Clean up test directory |
36 ASSERT_TRUE(file_util::Delete(test_dir_, false)); | 36 ASSERT_TRUE(file_util::Delete(test_dir_, true)); |
37 ASSERT_FALSE(file_util::PathExists(test_dir_)); | 37 ASSERT_FALSE(file_util::PathExists(test_dir_)); |
38 } | 38 } |
39 | 39 |
40 // the path to temporary directory used to contain the test operations | 40 // the path to temporary directory used to contain the test operations |
41 FilePath test_dir_; | 41 FilePath test_dir_; |
42 }; | 42 }; |
43 | 43 |
44 // Simple function to dump some text into a new file. | 44 // Simple function to dump some text into a new file. |
45 void CreateTextFile(const std::wstring& filename, | 45 void CreateTextFile(const std::wstring& filename, |
46 const std::wstring& contents) { | 46 const std::wstring& contents) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 EXPECT_FALSE(file_util::PathExists(chrome_dir_1)); | 184 EXPECT_FALSE(file_util::PathExists(chrome_dir_1)); |
185 EXPECT_FALSE(file_util::PathExists(chrome_dir_3)); | 185 EXPECT_FALSE(file_util::PathExists(chrome_dir_3)); |
186 // every thing under in used version should stay | 186 // every thing under in used version should stay |
187 EXPECT_TRUE(file_util::PathExists(chrome_dir_2)); | 187 EXPECT_TRUE(file_util::PathExists(chrome_dir_2)); |
188 EXPECT_TRUE(file_util::PathExists(chrome_dll_2)); | 188 EXPECT_TRUE(file_util::PathExists(chrome_dll_2)); |
189 EXPECT_TRUE(file_util::PathExists(chrome_othera_2)); | 189 EXPECT_TRUE(file_util::PathExists(chrome_othera_2)); |
190 EXPECT_TRUE(file_util::PathExists(chrome_otherb_2)); | 190 EXPECT_TRUE(file_util::PathExists(chrome_otherb_2)); |
191 // the latest version should stay | 191 // the latest version should stay |
192 EXPECT_TRUE(file_util::PathExists(chrome_dll_4)); | 192 EXPECT_TRUE(file_util::PathExists(chrome_dll_4)); |
193 } | 193 } |
OLD | NEW |