Index: chrome/installer/util/duplicate_tree_detector_unittest.cc |
diff --git a/chrome/installer/util/duplicate_tree_detector_unittest.cc b/chrome/installer/util/duplicate_tree_detector_unittest.cc |
index 163c91b24d42d96d9f13280391facd9a43b80a9c..d1445dcdf1cfcff4017b12a3f5e0f23cf55d6dbc 100644 |
--- a/chrome/installer/util/duplicate_tree_detector_unittest.cc |
+++ b/chrome/installer/util/duplicate_tree_detector_unittest.cc |
@@ -3,7 +3,6 @@ |
// found in the LICENSE file. |
#include <windows.h> |
-#include <shellapi.h> |
#include <fstream> |
@@ -12,6 +11,7 @@ |
#include "base/string16.h" |
#include "base/string_util.h" |
#include "chrome/installer/util/duplicate_tree_detector.h" |
+#include "chrome/installer/util/installer_util_test_common.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace { |
@@ -57,27 +57,7 @@ class DuplicateTreeDetectorTest : public testing::Test { |
CreateTextFile(f2.MaybeAsASCII(), text_content_2_); |
ASSERT_TRUE(file_util::PathExists(f2)); |
- CopyFileHierarchy(d1, second_root); |
- } |
- |
- // Copies the hierarcy in |from| to |to|. |
- void CopyFileHierarchy(const FilePath& from, const FilePath& to) { |
- // In SHFILEOPSTRUCT below, |pFrom| and |pTo| have to be double-null |
- // terminated: http://msdn.microsoft.com/library/bb759795.aspx |
- string16 double_null_from(from.value()); |
- double_null_from.push_back(L'\0'); |
- string16 double_null_to(to.value()); |
- double_null_to.push_back(L'\0'); |
- |
- SHFILEOPSTRUCT file_op = {}; |
- file_op.wFunc = FO_COPY; |
- file_op.pFrom = double_null_from.c_str(); |
- file_op.pTo = double_null_to.c_str(); |
- file_op.fFlags = FOF_NO_UI; |
- |
- ASSERT_EQ(0, SHFileOperation(&file_op)); |
- |
- ASSERT_FALSE(file_op.fAnyOperationsAborted); |
+ ASSERT_TRUE(installer::test::CopyFileHierarchy(d1, second_root)); |
} |
ScopedTempDir temp_source_dir_; |
@@ -164,7 +144,7 @@ TEST_F(DuplicateTreeDetectorTest, TestSingleFiles) { |
// This file should be the same. |
FilePath dest_file(temp_dest_dir_.path()); |
dest_file = dest_file.AppendASCII("F1"); |
- CopyFileHierarchy(source_file, dest_file); |
+ ASSERT_TRUE(installer::test::CopyFileHierarchy(source_file, dest_file)); |
// This file should be different. |
FilePath other_file(temp_dest_dir_.path()); |