OLD | NEW |
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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ASSERT_FALSE(FilePath::CompareEqualIgnoreCase(expect.value(), short_expect)); | 140 ASSERT_FALSE(FilePath::CompareEqualIgnoreCase(expect.value(), short_expect)); |
141 EXPECT_TRUE(ProgramCompare(expect).Evaluate(L"\"" + short_expect + L"\"")); | 141 EXPECT_TRUE(ProgramCompare(expect).Evaluate(L"\"" + short_expect + L"\"")); |
142 } | 142 } |
143 | 143 |
144 TEST_F(SetupUtilTest, DeleteFileFromTempProcess) { | 144 TEST_F(SetupUtilTest, DeleteFileFromTempProcess) { |
145 FilePath test_file; | 145 FilePath test_file; |
146 file_util::CreateTemporaryFileInDir(test_dir_.path(), &test_file); | 146 file_util::CreateTemporaryFileInDir(test_dir_.path(), &test_file); |
147 ASSERT_TRUE(file_util::PathExists(test_file)); | 147 ASSERT_TRUE(file_util::PathExists(test_file)); |
148 file_util::WriteFile(test_file, "foo", 3); | 148 file_util::WriteFile(test_file, "foo", 3); |
149 EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0)); | 149 EXPECT_TRUE(installer::DeleteFileFromTempProcess(test_file, 0)); |
150 base::PlatformThread::Sleep(200); | 150 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(200)); |
151 EXPECT_FALSE(file_util::PathExists(test_file)); | 151 EXPECT_FALSE(file_util::PathExists(test_file)); |
152 } | 152 } |
OLD | NEW |