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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 9abd16faa5a119912c336bb6664aed1a1191bbf5..690bf411e1bc7faef6cff1e02cc65deec4fdd216 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -145,7 +145,7 @@ class CreatedObserver : public content::DownloadManager::Observer {
content::DownloadItem* item) override {
DCHECK_EQ(manager_, manager);
if (waiting_)
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
content::DownloadManager* manager_;
@@ -187,10 +187,10 @@ class PercentWaiter : public content::DownloadItem::Observer {
(item_->PercentComplete() != 100)))) {
error_ = true;
if (waiting_)
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
if (item_->GetState() == DownloadItem::COMPLETE && waiting_)
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
void OnDownloadDestroyed(content::DownloadItem* item) override {
@@ -274,7 +274,7 @@ class DownloadsHistoryDataCollector {
scoped_ptr<std::vector<history::DownloadRow> > entries) {
result_valid_ = true;
results_ = entries.Pass();
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
Profile* profile_;
@@ -298,7 +298,7 @@ class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt {
const Extension* extension,
const ShowDialogCallback& show_dialog_callback) override {
delegate->InstallUIAbort(true);
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
void OnInstallSuccess(const Extension* extension, SkBitmap* icon) override {}
@@ -395,7 +395,7 @@ class HistoryObserver : public DownloadHistory::Observer {
seen_stored_ = true;
if (waiting_)
- base::MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->QuitWhenIdle();
}
void OnDownloadHistoryDestroyed() override {
@@ -1109,8 +1109,8 @@ class DownloadTest : public InProcessBrowserTest {
static void EnsureNoPendingDownloadJobsOnIO(bool* result) {
if (net::URLRequestSlowDownloadJob::NumberOutstandingRequests())
*result = false;
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure());
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::MessageLoop::QuitWhenIdleClosure());
}
// Location of the test data.
@@ -3553,7 +3553,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTestWithShelf, PRE_DownloadTest_History) {
HistoryServiceFactory::GetForProfile(browser()->profile(),
ServiceAccessType::IMPLICIT_ACCESS)
->FlushForTest(base::Bind(
- &base::MessageLoop::Quit,
+ &base::MessageLoop::QuitWhenIdle,
base::Unretained(base::MessageLoop::current()->current())));
content::RunMessageLoop();
}
« no previous file with comments | « chrome/browser/devtools/devtools_sanity_browsertest.cc ('k') | chrome/browser/download/save_page_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698