Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/installer/util/copy_tree_work_item_unittest.cc

Issue 1763008: Windows: Make file_util::Delete("c:\\foo_dir", false) work correctly. Add more unit tests for Delete (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: re-upload patch set 4 Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_util_win.cc ('k') | chrome/installer/util/create_dir_work_item_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « base/file_util_win.cc ('k') | chrome/installer/util/create_dir_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698