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

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

Issue 94013004: Add base:: to string16s in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again Created 7 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "chrome/installer/util/duplicate_tree_detector.h" 13 #include "chrome/installer/util/duplicate_tree_detector.h"
14 #include "chrome/installer/util/installer_util_test_common.h" 14 #include "chrome/installer/util/installer_util_test_common.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace { 17 namespace {
18 18
19 class DuplicateTreeDetectorTest : public testing::Test { 19 class DuplicateTreeDetectorTest : public testing::Test {
20 protected: 20 protected:
21 virtual void SetUp() { 21 virtual void SetUp() {
22 ASSERT_TRUE(temp_source_dir_.CreateUniqueTempDir()); 22 ASSERT_TRUE(temp_source_dir_.CreateUniqueTempDir());
23 ASSERT_TRUE(temp_dest_dir_.CreateUniqueTempDir()); 23 ASSERT_TRUE(temp_dest_dir_.CreateUniqueTempDir());
24 } 24 }
25 25
26 // Simple function to dump some text into a new file. 26 // Simple function to dump some text into a new file.
27 void CreateTextFile(const std::string& filename, 27 void CreateTextFile(const std::string& filename,
28 const string16& contents) { 28 const base::string16& contents) {
29 std::wofstream file; 29 std::wofstream file;
30 file.open(filename.c_str()); 30 file.open(filename.c_str());
31 ASSERT_TRUE(file.is_open()); 31 ASSERT_TRUE(file.is_open());
32 file << contents; 32 file << contents;
33 file.close(); 33 file.close();
34 } 34 }
35 35
36 // Creates a two level deep source dir with a file in each in |first_root| and 36 // Creates a two level deep source dir with a file in each in |first_root| and
37 // copy it (files properties will be identical) in |second_root|. 37 // copy it (files properties will be identical) in |second_root|.
38 void CreateTwoIdenticalHierarchies(const base::FilePath& first_root, 38 void CreateTwoIdenticalHierarchies(const base::FilePath& first_root,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ASSERT_TRUE(installer::test::CopyFileHierarchy(source_file, dest_file)); 147 ASSERT_TRUE(installer::test::CopyFileHierarchy(source_file, dest_file));
148 148
149 // This file should be different. 149 // This file should be different.
150 base::FilePath other_file(temp_dest_dir_.path()); 150 base::FilePath other_file(temp_dest_dir_.path());
151 other_file = other_file.AppendASCII("F2"); 151 other_file = other_file.AppendASCII("F2");
152 CreateTextFile(other_file.MaybeAsASCII(), text_content_2_); 152 CreateTextFile(other_file.MaybeAsASCII(), text_content_2_);
153 153
154 EXPECT_TRUE(installer::IsIdenticalFileHierarchy(source_file, dest_file)); 154 EXPECT_TRUE(installer::IsIdenticalFileHierarchy(source_file, dest_file));
155 EXPECT_FALSE(installer::IsIdenticalFileHierarchy(source_file, other_file)); 155 EXPECT_FALSE(installer::IsIdenticalFileHierarchy(source_file, other_file));
156 } 156 }
OLDNEW
« no previous file with comments | « chrome/installer/util/chromium_binaries_distribution.cc ('k') | chrome/installer/util/google_chrome_binaries_distribution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698