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

Side by Side Diff: chrome/installer/setup/setup_util_unittest.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/uninstall.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/installer/setup/setup_util_unittest.h" 5 #include "chrome/installer/setup/setup_util_unittest.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 chrome_dir = test_dir_.path().AppendASCII("1.1.1.1"); 128 chrome_dir = test_dir_.path().AppendASCII("1.1.1.1");
129 file_util::CreateDirectory(chrome_dir); 129 file_util::CreateDirectory(chrome_dir);
130 ASSERT_TRUE(base::PathExists(chrome_dir)); 130 ASSERT_TRUE(base::PathExists(chrome_dir));
131 131
132 version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path())); 132 version.reset(installer::GetMaxVersionFromArchiveDir(test_dir_.path()));
133 ASSERT_EQ(version->GetString(), "9.9.9.9"); 133 ASSERT_EQ(version->GetString(), "9.9.9.9");
134 } 134 }
135 135
136 TEST_F(SetupUtilTestWithDir, DeleteFileFromTempProcess) { 136 TEST_F(SetupUtilTestWithDir, DeleteFileFromTempProcess) {
137 base::FilePath test_file; 137 base::FilePath test_file;
138 file_util::CreateTemporaryFileInDir(test_dir_.path(), &test_file); 138 base::CreateTemporaryFileInDir(test_dir_.path(), &test_file);
139 ASSERT_TRUE(base::PathExists(test_file)); 139 ASSERT_TRUE(base::PathExists(test_file));
140 file_util::WriteFile(test_file, "foo", 3); 140 file_util::WriteFile(test_file, "foo", 3);
141 EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0)); 141 EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0));
142 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); 142 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200));
143 EXPECT_FALSE(base::PathExists(test_file)); 143 EXPECT_FALSE(base::PathExists(test_file));
144 } 144 }
145 145
146 // Note: This test is only valid when run at high integrity (i.e. it will fail 146 // Note: This test is only valid when run at high integrity (i.e. it will fail
147 // at medium integrity). 147 // at medium integrity).
148 TEST(SetupUtilTest, ScopedTokenPrivilegeBasic) { 148 TEST(SetupUtilTest, ScopedTokenPrivilegeBasic) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 BrowserDistribution::CHROME_FRAME)); 478 BrowserDistribution::CHROME_FRAME));
479 EXPECT_TRUE(chrome_frame.GetUsageStats(&usagestats)); 479 EXPECT_TRUE(chrome_frame.GetUsageStats(&usagestats));
480 EXPECT_EQ(1U, usagestats); 480 EXPECT_EQ(1U, usagestats);
481 EXPECT_EQ(L"2.0-dev", chrome_frame.channel().value()); 481 EXPECT_EQ(L"2.0-dev", chrome_frame.channel().value());
482 482
483 // Confirm that the binaries' channel no longer contains GCF. 483 // Confirm that the binaries' channel no longer contains GCF.
484 ASSERT_TRUE(binaries.Initialize(kSystemLevel, 484 ASSERT_TRUE(binaries.Initialize(kSystemLevel,
485 BrowserDistribution::CHROME_BINARIES)); 485 BrowserDistribution::CHROME_BINARIES));
486 EXPECT_EQ(L"2.0-dev-multi", binaries.channel().value()); 486 EXPECT_EQ(L"2.0-dev-multi", binaries.channel().value());
487 } 487 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698