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

Side by Side Diff: chrome/installer/util/shell_util_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 | « chrome/installer/util/move_tree_work_item_unittest.cc ('k') | no next file » | 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 #include <shellapi.h> 6 #include <shellapi.h>
7 #include <shlobj.h> 7 #include <shlobj.h>
8 8
9 #include <fstream> 9 #include <fstream>
10 #include <iostream> 10 #include <iostream>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 test_dir_ = test_dir_.AppendASCII("ShellUtilTest"); 91 test_dir_ = test_dir_.AppendASCII("ShellUtilTest");
92 92
93 // Create a fresh, empty copy of this test directory. 93 // Create a fresh, empty copy of this test directory.
94 file_util::Delete(test_dir_, true); 94 file_util::Delete(test_dir_, true);
95 file_util::CreateDirectoryW(test_dir_); 95 file_util::CreateDirectoryW(test_dir_);
96 ASSERT_TRUE(file_util::PathExists(test_dir_)); 96 ASSERT_TRUE(file_util::PathExists(test_dir_));
97 } 97 }
98 98
99 virtual void TearDown() { 99 virtual void TearDown() {
100 // Clean up test directory 100 // Clean up test directory
101 ASSERT_TRUE(file_util::Delete(test_dir_, false)); 101 ASSERT_TRUE(file_util::Delete(test_dir_, true));
102 ASSERT_FALSE(file_util::PathExists(test_dir_)); 102 ASSERT_FALSE(file_util::PathExists(test_dir_));
103 } 103 }
104 104
105 // The path to temporary directory used to contain the test operations. 105 // The path to temporary directory used to contain the test operations.
106 FilePath test_dir_; 106 FilePath test_dir_;
107 }; 107 };
108 }; 108 };
109 109
110 // Test that we can open archives successfully. 110 // Test that we can open archives successfully.
111 TEST_F(ShellUtilTest, UpdateChromeShortcutTest) { 111 TEST_F(ShellUtilTest, UpdateChromeShortcutTest) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Now change only description to update shortcut and make sure icon index 150 // Now change only description to update shortcut and make sure icon index
151 // doesn't change. 151 // doesn't change.
152 const std::wstring description2(L"dummy description 2"); 152 const std::wstring description2(L"dummy description 2");
153 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(exe_path.value(), 153 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(exe_path.value(),
154 shortcut_path.value(), 154 shortcut_path.value(),
155 description2, false)); 155 description2, false));
156 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(), 156 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(),
157 shortcut_path.value(), 157 shortcut_path.value(),
158 description2, 1)); 158 description2, 1));
159 } 159 }
OLDNEW
« no previous file with comments | « chrome/installer/util/move_tree_work_item_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698