| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 24 matching lines...) Expand all Loading... |
| 35 temp_dir_ = test_dir_.AppendASCII("temp"); | 35 temp_dir_ = test_dir_.AppendASCII("temp"); |
| 36 file_util::CreateDirectoryW(temp_dir_); | 36 file_util::CreateDirectoryW(temp_dir_); |
| 37 | 37 |
| 38 ASSERT_TRUE(file_util::PathExists(test_dir_)); | 38 ASSERT_TRUE(file_util::PathExists(test_dir_)); |
| 39 ASSERT_TRUE(file_util::PathExists(temp_dir_)); | 39 ASSERT_TRUE(file_util::PathExists(temp_dir_)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void TearDown() { | 42 virtual void TearDown() { |
| 43 logging::CloseLogFile(); | 43 logging::CloseLogFile(); |
| 44 // Clean up test directory | 44 // Clean up test directory |
| 45 ASSERT_TRUE(file_util::Delete(test_dir_, false)); | 45 ASSERT_TRUE(file_util::Delete(test_dir_, true)); |
| 46 ASSERT_FALSE(file_util::PathExists(test_dir_)); | 46 ASSERT_FALSE(file_util::PathExists(test_dir_)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // the path to temporary directory used to contain the test operations | 49 // the path to temporary directory used to contain the test operations |
| 50 FilePath test_dir_; | 50 FilePath test_dir_; |
| 51 FilePath temp_dir_; | 51 FilePath temp_dir_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // Simple function to dump some text into a new file. | 54 // Simple function to dump some text into a new file. |
| 55 void CreateTextFile(const std::wstring& filename, | 55 void CreateTextFile(const std::wstring& filename, |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_1, file_name_to_1)); | 705 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_1, file_name_to_1)); |
| 706 | 706 |
| 707 FilePath file_name_to_2(dir_name_to); | 707 FilePath file_name_to_2(dir_name_to); |
| 708 file_name_to_2 = file_name_to_2.AppendASCII("2"); | 708 file_name_to_2 = file_name_to_2.AppendASCII("2"); |
| 709 file_name_to_2 = file_name_to_2.AppendASCII("File_2.txt"); | 709 file_name_to_2 = file_name_to_2.AppendASCII("File_2.txt"); |
| 710 EXPECT_TRUE(file_util::PathExists(file_name_to_2)); | 710 EXPECT_TRUE(file_util::PathExists(file_name_to_2)); |
| 711 LOG(INFO) << "compare " | 711 LOG(INFO) << "compare " |
| 712 << file_name_from_2.value() << " and " << file_name_to_2.value(); | 712 << file_name_from_2.value() << " and " << file_name_to_2.value(); |
| 713 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_2, file_name_to_2)); | 713 EXPECT_TRUE(file_util::ContentsEqual(file_name_from_2, file_name_to_2)); |
| 714 } | 714 } |
| OLD | NEW |