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

Unified Diff: content/browser/browser_main_loop.cc

Issue 10912070: Makes it possible to run content_browsertests with --as-browser and fake WebRTC devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index faed5fc5c27350c10c45ba7767c8ff593cf45967..6acb38ba7551aaa7d7e69d036c9a3d4bab74bbf8 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -224,12 +224,21 @@ media::AudioManager* BrowserMainLoop::GetAudioManager() {
media_stream::MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() {
return g_current_browser_main_loop->media_stream_manager_.get();
}
+
+// static
+void BrowserMainLoop::UseFakeMediaStreamDevice() {
+ // Configure the manager once it gets created.
+ BrowserMainLoop::use_fake_media_stream_device_ = true;
jam 2012/09/04 15:18:14 nit: BrowserMainLoop:: is unnecessary
phoglund_chromium 2012/09/05 11:43:54 Done.
+}
+
+bool BrowserMainLoop::use_fake_media_stream_device_ = false;
+
// BrowserMainLoop construction / destruction =============================
BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters)
: parameters_(parameters),
parsed_command_line_(parameters.command_line),
- result_code_(content::RESULT_CODE_NORMAL_EXIT) {
+ result_code_(content::RESULT_CODE_NORMAL_EXIT){
DCHECK(!g_current_browser_main_loop);
g_current_browser_main_loop = this;
}
@@ -468,6 +477,9 @@ void BrowserMainLoop::CreateThreads() {
void BrowserMainLoop::RunMainMessageLoopParts() {
TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, "");
+ if (use_fake_media_stream_device_)
jam 2012/09/04 15:18:14 actually, it seems that this static better belongs
phoglund_chromium 2012/09/05 11:43:54 Good point, I'll move it.
+ media_stream_manager_->UseFakeDevice();
+
bool ran_main_loop = false;
if (parts_.get())
ran_main_loop = parts_->MainMessageLoopRun(&result_code_);

Powered by Google App Engine
This is Rietveld 408576698