Chromium Code Reviews| 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..d2eb43dcb4c2c49845c1b29e885b38b620e35743 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); |
| + installer::test::CopyFileHierarchy(source_file, dest_file); |
|
grt (UTC plus 2)
2012/10/31 17:33:06
ASSERT_TRUE here, too (to preserve previous behavi
gab
2012/11/01 15:52:05
Indeed, thanks, done.
|
| // This file should be different. |
| FilePath other_file(temp_dest_dir_.path()); |