Commit fee33f3b authored by Mila Green's avatar Mila Green Committed by Commit Bot

Follow up change to fix the NetworkFetcherMacDownloadToFile test.

Specifically, delete the line of code which deletes the test file (and even asserts on that). This is not needed to test the functionality of the networking code and the file will get deleted when the ScopedTempDir gets out of scope.

Bug: 1020650
Change-Id: Ib045cbd790c55753362c0e0367c61fd12bc35101
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906473
Commit-Queue: Mila Green <milagreen@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714291}
parent eb0142f4
...@@ -64,9 +64,8 @@ class ChromeUpdaterNetworkMacTest : public ::testing::Test { ...@@ -64,9 +64,8 @@ class ChromeUpdaterNetworkMacTest : public ::testing::Test {
void DownloadCallback(int net_error, int64_t content_size) { void DownloadCallback(int net_error, int64_t content_size) {
EXPECT_EQ(net_error, 200); EXPECT_EQ(net_error, 200);
EXPECT_GT(content_size, 0); EXPECT_GT(content_size, 0);
ASSERT_FALSE(testFilePath.empty()); EXPECT_FALSE(testFilePath.empty());
ASSERT_TRUE(base::PathExists(testFilePath)); EXPECT_TRUE(base::PathExists(testFilePath));
ASSERT_TRUE(base::DeleteFile(testFilePath, false));
DownloadToFileCompleted(); DownloadToFileCompleted();
} }
...@@ -138,7 +137,8 @@ TEST_F(ChromeUpdaterNetworkMacTest, NetworkFetcherMacDownloadToFile) { ...@@ -138,7 +137,8 @@ TEST_F(ChromeUpdaterNetworkMacTest, NetworkFetcherMacDownloadToFile) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
testFilePath = temp_dir.GetPath().Append(FILE_PATH_LITERAL("from_file")); testFilePath =
temp_dir.GetPath().Append(FILE_PATH_LITERAL("downloaded_file"));
fetcher->DownloadToFile( fetcher->DownloadToFile(
url, testFilePath, url, testFilePath,
......
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