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

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

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/product_unittest.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | 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) 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 #include <wincrypt.h> 6 #include <wincrypt.h>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 16 matching lines...) Expand all
27 EXPECT_NE(FALSE, CryptGenRandom(crypt_ctx, arraysize(data), &data[0])); 27 EXPECT_NE(FALSE, CryptGenRandom(crypt_ctx, arraysize(data), &data[0]));
28 EXPECT_NE(FALSE, CryptReleaseContext(crypt_ctx, 0)); 28 EXPECT_NE(FALSE, CryptReleaseContext(crypt_ctx, 0));
29 29
30 // Hexify the value. 30 // Hexify the value.
31 std::string result(base::HexEncode(&data[0], arraysize(data))); 31 std::string result(base::HexEncode(&data[0], arraysize(data)));
32 EXPECT_EQ(8, result.size()); 32 EXPECT_EQ(8, result.size());
33 33
34 // Replace the first digit with the letter 'R' (for "random", get it?). 34 // Replace the first digit with the letter 'R' (for "random", get it?).
35 result[0] = 'R'; 35 result[0] = 'R';
36 36
37 return ASCIIToWide(result); 37 return base::ASCIIToWide(result);
38 } 38 }
39 39
40 } // namespace 40 } // namespace
41 41
42 namespace installer { 42 namespace installer {
43 43
44 class SelfCleaningTempDirTest : public testing::Test { 44 class SelfCleaningTempDirTest : public testing::Test {
45 }; 45 };
46 46
47 // Test the implementation of GetTopDirToCreate when given the root of a 47 // Test the implementation of GetTopDirToCreate when given the root of a
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 file_util::WriteFile(parent_temp_dir.Append(GetRandomFilename()), 164 file_util::WriteFile(parent_temp_dir.Append(GetRandomFilename()),
165 kHiHon, arraysize(kHiHon) - 1)); 165 kHiHon, arraysize(kHiHon) - 1));
166 } 166 }
167 EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three"))); 167 EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.Append(L"Three")));
168 EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir)); 168 EXPECT_TRUE(file_util::DirectoryExists(parent_temp_dir));
169 EXPECT_TRUE(work_dir.Delete()); 169 EXPECT_TRUE(work_dir.Delete());
170 EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName())); 170 EXPECT_FALSE(file_util::DirectoryExists(parent_temp_dir.DirName().DirName()));
171 } 171 }
172 172
173 } // namespace installer 173 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/product_unittest.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698