Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2017)

Unified Diff: chrome/browser/profiles/profile_browsertest.cc

Issue 2611053003: Flush TaskScheduler in ProfileBrowserTest.*. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_browsertest.cc
diff --git a/chrome/browser/profiles/profile_browsertest.cc b/chrome/browser/profiles/profile_browsertest.cc
index 0836d8323d5a70cea15b3c1fb6eb1d6d22e5ded4..2c689385873559b17e91004f91defeaf79c0f905 100644
--- a/chrome/browser/profiles/profile_browsertest.cc
+++ b/chrome/browser/profiles/profile_browsertest.cc
@@ -18,6 +18,7 @@
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner.h"
#include "base/synchronization/waitable_event.h"
+#include "base/task_scheduler/task_scheduler.h"
#include "base/values.h"
#include "base/version.h"
#include "build/build_config.h"
@@ -152,6 +153,10 @@ void SpinThreads() {
content::RunAllPendingInMessageLoop();
content::RunAllPendingInMessageLoop(content::BrowserThread::DB);
content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
+
+ // This prevents HistoryBackend from accessing its databases after the
+ // directory that contains them has been deleted.
+ base::TaskScheduler::GetInstance()->FlushForTesting();
}
// Sends an HttpResponse for requests for "/" that result in sending an HPKP
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698