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

Unified Diff: chrome/test/base/ui_test_utils.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/test/base/ui_test_utils.cc
diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc
index dc6876460af634751ca0e9fd55d8414fefa877c4..6a580d79e8a6d497ebc92ebcd8689cd2214ee501 100644
--- a/chrome/test/base/ui_test_utils.cc
+++ b/chrome/test/base/ui_test_utils.cc
@@ -266,8 +266,7 @@ void RunMessageLoop() {
MessageLoopForUI* ui_loop =
content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ?
MessageLoopForUI::current() : NULL;
- bool did_allow_task_nesting = loop->NestableTasksAllowed();
- loop->SetNestableTasksAllowed(true);
+ MessageLoop::ScopedNestableTaskAllower allow(loop);
if (ui_loop) {
#if defined(USE_AURA)
aura::RootWindow::GetInstance()->Run();
@@ -282,7 +281,6 @@ void RunMessageLoop() {
} else {
loop->Run();
}
- loop->SetNestableTasksAllowed(did_allow_task_nesting);
}
void RunAllPendingInMessageLoop() {

Powered by Google App Engine
This is Rietveld 408576698