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

Unified Diff: content/browser/loader/async_revalidation_manager_browsertest.cc

Issue 2571473002: Fix cases where RunLoop is created without a MessageLoop. (Closed)
Patch Set: Fix chromeos tests. Created 4 years 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
Index: content/browser/loader/async_revalidation_manager_browsertest.cc
diff --git a/content/browser/loader/async_revalidation_manager_browsertest.cc b/content/browser/loader/async_revalidation_manager_browsertest.cc
index 2a9b8c33b38508834add590b22714eb3ec2faf8e..982ecebf4573d76043963cf2e2ef5266828585f9 100644
--- a/content/browser/loader/async_revalidation_manager_browsertest.cc
+++ b/content/browser/loader/async_revalidation_manager_browsertest.cc
@@ -48,7 +48,16 @@ class AsyncRevalidationManagerBrowserTest : public ContentBrowserTest {
ContentBrowserTest::SetUp();
}
- base::RunLoop* run_loop() { return &run_loop_; }
+ void SetUpOnMainThread() override {
+ ContentBrowserTest::SetUpOnMainThread();
+ run_loop_.reset(new base::RunLoop);
+ }
+
+ base::RunLoop* run_loop() {
+ DCHECK(run_loop_);
+ return run_loop_.get();
+ }
+
int requests_counted() const { return requests_counted_; }
// This method lacks diagnostics for the failure case because TitleWatcher
@@ -92,7 +101,7 @@ class AsyncRevalidationManagerBrowserTest : public ContentBrowserTest {
// use this for synchronisation.
if (version == 2) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- run_loop_.QuitClosure());
+ run_loop()->QuitClosure());
}
return std::move(http_response);
}
@@ -142,7 +151,7 @@ class AsyncRevalidationManagerBrowserTest : public ContentBrowserTest {
return http_response;
}
- base::RunLoop run_loop_;
+ std::unique_ptr<base::RunLoop> run_loop_;
int requests_counted_ = 0;
base::test::ScopedFeatureList scoped_feature_list_;
« no previous file with comments | « chrome/browser/chromeos/system/device_disabling_browsertest.cc ('k') | media/base/audio_renderer_mixer_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698