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

Side by Side Diff: chrome/installer/util/delete_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
OLDNEW
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 17 matching lines...) Expand all
28 28
29 // Create a fresh, empty copy of this test directory. 29 // Create a fresh, empty copy of this test directory.
30 file_util::Delete(test_dir_, true); 30 file_util::Delete(test_dir_, true);
31 file_util::CreateDirectoryW(test_dir_); 31 file_util::CreateDirectoryW(test_dir_);
32 32
33 ASSERT_TRUE(file_util::PathExists(test_dir_)); 33 ASSERT_TRUE(file_util::PathExists(test_dir_));
34 } 34 }
35 35
36 virtual void TearDown() { 36 virtual void TearDown() {
37 // Clean up test directory 37 // Clean up test directory
38 ASSERT_TRUE(file_util::Delete(test_dir_, false)); 38 ASSERT_TRUE(file_util::Delete(test_dir_, true));
39 ASSERT_FALSE(file_util::PathExists(test_dir_)); 39 ASSERT_FALSE(file_util::PathExists(test_dir_));
40 } 40 }
41 41
42 // the path to temporary directory used to contain the test operations 42 // the path to temporary directory used to contain the test operations
43 FilePath test_dir_; 43 FilePath test_dir_;
44 }; 44 };
45 45
46 // Simple function to dump some text into a new file. 46 // Simple function to dump some text into a new file.
47 void CreateTextFile(const std::wstring& filename, 47 void CreateTextFile(const std::wstring& filename,
48 const std::wstring& contents) { 48 const std::wstring& contents) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 // verify everything is still there. 214 // verify everything is still there.
215 EXPECT_TRUE(file_util::PathExists(key_path)); 215 EXPECT_TRUE(file_util::PathExists(key_path));
216 EXPECT_TRUE(file_util::PathExists(file_name_delete_1)); 216 EXPECT_TRUE(file_util::PathExists(file_name_delete_1));
217 EXPECT_TRUE(file_util::PathExists(file_name_delete_2)); 217 EXPECT_TRUE(file_util::PathExists(file_name_delete_2));
218 218
219 TerminateProcess(pi.hProcess, 0); 219 TerminateProcess(pi.hProcess, 0);
220 // make sure the handle is closed. 220 // make sure the handle is closed.
221 WaitForSingleObject(pi.hProcess, INFINITE); 221 WaitForSingleObject(pi.hProcess, INFINITE);
222 } 222 }
OLDNEW
« no previous file with comments | « chrome/installer/util/create_dir_work_item_unittest.cc ('k') | chrome/installer/util/helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698