Commit 83ab4c5f authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix some base::DeleteFileW() calls.

Slightly surprising, but apparently on Windows, one can write
base::DeleteFileW() and still end up calling base::DeleteFile(). Fix
these callers to use base::DeleteFile() directly, rather than relying on
some macro magic. Also stop using the deprecated version of
base::DeleteFile() and fix some nits.

Bug: 1009837
Change-Id: I3e8e35c7d57928b587dc103217fccb7d1f0b4fa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2313042Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790889}
parent bef880fd
...@@ -204,7 +204,7 @@ void TestWin10ImageLoadPreferSys32(bool baseline_test, bool expect_sys32_path) { ...@@ -204,7 +204,7 @@ void TestWin10ImageLoadPreferSys32(bool baseline_test, bool expect_sys32_path) {
: sandbox::SBOX_TEST_FAILED), : sandbox::SBOX_TEST_FAILED),
runner.RunTest(test.c_str())); runner.RunTest(test.c_str()));
EXPECT_TRUE(base::DeleteFileW(new_dll_path, false)); EXPECT_TRUE(base::DeleteFile(new_dll_path));
} }
} // namespace } // namespace
......
...@@ -26,7 +26,7 @@ namespace { ...@@ -26,7 +26,7 @@ namespace {
class ScopedTerminateProcess { class ScopedTerminateProcess {
public: public:
ScopedTerminateProcess(HANDLE process) : process_(process) {} explicit ScopedTerminateProcess(HANDLE process) : process_(process) {}
~ScopedTerminateProcess() { ::TerminateProcess(process_, 0); } ~ScopedTerminateProcess() { ::TerminateProcess(process_, 0); }
...@@ -250,9 +250,7 @@ TEST(WinUtils, ConvertToLongPath) { ...@@ -250,9 +250,7 @@ TEST(WinUtils, ConvertToLongPath) {
// Expected result: "\Device\HarddiskVolumeX\Program Files\test_calc.exe" // Expected result: "\Device\HarddiskVolumeX\Program Files\test_calc.exe"
// clean up // clean up
EXPECT_TRUE(base::DeleteFileW(temp_path, false)); EXPECT_TRUE(base::DeleteFile(temp_path));
return;
} }
} // namespace sandbox } // namespace sandbox
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment