Commit 208e8eb1 authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

Speculative fix for flakiness in ImageWriterWriteFromUrlOperationTest.VerifyFile.

Bug: 983061
Change-Id: Ic1060829f3eb5efb17055e16890c037b85750be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699129Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676981}
parent 81e2a36f
...@@ -212,7 +212,7 @@ TEST_F(ImageWriterWriteFromUrlOperationTest, DownloadFile) { ...@@ -212,7 +212,7 @@ TEST_F(ImageWriterWriteFromUrlOperationTest, DownloadFile) {
operation->Cancel(); operation->Cancel();
} }
TEST_F(ImageWriterWriteFromUrlOperationTest, DISABLED_VerifyFile) { TEST_F(ImageWriterWriteFromUrlOperationTest, VerifyFile) {
std::unique_ptr<char[]> data_buffer(new char[kTestFileSize]); std::unique_ptr<char[]> data_buffer(new char[kTestFileSize]);
base::ReadFile(test_utils_.GetImagePath(), data_buffer.get(), kTestFileSize); base::ReadFile(test_utils_.GetImagePath(), data_buffer.get(), kTestFileSize);
base::MD5Digest expected_digest; base::MD5Digest expected_digest;
...@@ -254,6 +254,14 @@ TEST_F(ImageWriterWriteFromUrlOperationTest, DISABLED_VerifyFile) { ...@@ -254,6 +254,14 @@ TEST_F(ImageWriterWriteFromUrlOperationTest, DISABLED_VerifyFile) {
} }
operation->Cancel(); operation->Cancel();
// The OnProgress calls we're expecting are posted to the Operation's
// SequencedTaskRunner. Flush it before the mock's expectations are checked.
{
base::RunLoop run_loop;
operation->PostTask(run_loop.QuitClosure());
run_loop.Run();
}
} }
} // namespace image_writer } // namespace image_writer
......
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