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

Side by Side Diff: chrome/browser/renderer_host/render_process_host_chrome_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/process/process.h" 7 #include "base/process/process.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/devtools/devtools_window.h" 10 #include "chrome/browser/devtools/devtools_window.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 WaitForLauncherThread(); 113 WaitForLauncherThread();
114 WaitForMessageProcessing(wc); 114 WaitForMessageProcessing(wc);
115 return ProcessFromHandle(wc->GetRenderProcessHost()->GetHandle()); 115 return ProcessFromHandle(wc->GetRenderProcessHost()->GetHandle());
116 } 116 }
117 117
118 // Ensures that the backgrounding / foregrounding gets a chance to run. 118 // Ensures that the backgrounding / foregrounding gets a chance to run.
119 void WaitForLauncherThread() { 119 void WaitForLauncherThread() {
120 content::BrowserThread::PostTaskAndReply( 120 content::BrowserThread::PostTaskAndReply(
121 content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE, 121 content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
122 base::Bind(&base::DoNothing), base::MessageLoop::QuitClosure()); 122 base::Bind(&base::DoNothing), base::MessageLoop::QuitWhenIdleClosure());
123 base::MessageLoop::current()->Run(); 123 base::MessageLoop::current()->Run();
124 } 124 }
125 125
126 // Implicitly waits for the renderer process associated with the specified 126 // Implicitly waits for the renderer process associated with the specified
127 // WebContents to process outstanding IPC messages by running some JavaScript 127 // WebContents to process outstanding IPC messages by running some JavaScript
128 // and waiting for the result. 128 // and waiting for the result.
129 void WaitForMessageProcessing(WebContents* wc) { 129 void WaitForMessageProcessing(WebContents* wc) {
130 bool result = false; 130 bool result = false;
131 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 131 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
132 wc, "window.domAutomationController.send(true);", &result)); 132 wc, "window.domAutomationController.send(true);", &result));
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 content::ExecuteScript(audio_tab_web_contents_, 675 content::ExecuteScript(audio_tab_web_contents_,
676 "document.getElementById('audioPlayer').play();")); 676 "document.getElementById('audioPlayer').play();"));
677 677
678 // Wait until the two pages are not backgrounded. 678 // Wait until the two pages are not backgrounded.
679 while (no_audio_process_.IsProcessBackgrounded() || 679 while (no_audio_process_.IsProcessBackgrounded() ||
680 audio_process_.IsProcessBackgrounded()) { 680 audio_process_.IsProcessBackgrounded()) {
681 base::RunLoop().RunUntilIdle(); 681 base::RunLoop().RunUntilIdle();
682 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout()); 682 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout());
683 } 683 }
684 } 684 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698