Commit 4c66b853 authored by Sophie Chang's avatar Sophie Chang Committed by Chromium LUCI CQ

Wait for all delayed tasks to finish before checking for file deletion

Maybe this will help fix the download manager test flakes

Bug: 1156112
Change-Id: Ice1add6879733c53eff58d932d177e63be3505d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2606718Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839680}
parent aa286745
......@@ -9,6 +9,7 @@
#include "base/optional.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_path_override.h"
......@@ -135,7 +136,15 @@ class PredictionModelDownloadManagerTest
download_manager()->OnDownloadFailed(guid);
}
void RunUntilIdle() { task_environment()->RunUntilIdle(); }
void RunUntilIdle() {
task_environment()->RunUntilIdle();
// Wait for all delayed tasks to finish.
base::RunLoop run_loop;
base::ThreadPoolInstance::Get()->FlushAsyncForTesting(
run_loop.QuitClosure());
run_loop.Run();
}
base::FilePath GetFilePathForDownloadFileStatus(
PredictionModelDownloadFileStatus file_status) {
......
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