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

Side by Side Diff: content/browser/media/webrtc/webrtc_browsertest.cc

Issue 2077983003: Intiialize AudioManager and related class lazily (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/browser_main_loop.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/common/content_switches.h" 11 #include "content/public/common/content_switches.h"
11 #include "content/public/common/webrtc_ip_handling_policy.h" 12 #include "content/public/common/webrtc_ip_handling_policy.h"
12 #include "content/public/test/browser_test_utils.h" 13 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/content_browser_test_utils.h" 14 #include "content/public/test/content_browser_test_utils.h"
14 #include "content/public/test/test_utils.h" 15 #include "content/public/test/test_utils.h"
15 #include "content/test/webrtc_content_browsertest_base.h" 16 #include "content/test/webrtc_content_browsertest_base.h"
16 #include "media/audio/audio_manager.h" 17 #include "media/audio/audio_manager.h"
17 #include "media/base/media_switches.h" 18 #include "media/base/media_switches.h"
18 #include "net/test/embedded_test_server/embedded_test_server.h" 19 #include "net/test/embedded_test_server/embedded_test_server.h"
(...skipping 13 matching lines...) Expand all
32 public: 33 public:
33 MAYBE_WebRtcBrowserTest() {} 34 MAYBE_WebRtcBrowserTest() {}
34 ~MAYBE_WebRtcBrowserTest() override {} 35 ~MAYBE_WebRtcBrowserTest() override {}
35 36
36 void SetUpCommandLine(base::CommandLine* command_line) override { 37 void SetUpCommandLine(base::CommandLine* command_line) override {
37 WebRtcContentBrowserTest::SetUpCommandLine(command_line); 38 WebRtcContentBrowserTest::SetUpCommandLine(command_line);
38 // Automatically grant device permission. 39 // Automatically grant device permission.
39 AppendUseFakeUIForMediaStreamFlag(); 40 AppendUseFakeUIForMediaStreamFlag();
40 } 41 }
41 42
43 void SetUpOnMainThread() override {
44 BrowserMainLoop::GetInstance()->GetMediaStreamManager();
45 }
46
42 protected: 47 protected:
43 // Convenience function since most peerconnection-call.html tests just load 48 // Convenience function since most peerconnection-call.html tests just load
44 // the page, kick off some javascript and wait for the title to change to OK. 49 // the page, kick off some javascript and wait for the title to change to OK.
45 void MakeTypicalPeerConnectionCall(const std::string& javascript) { 50 void MakeTypicalPeerConnectionCall(const std::string& javascript) {
46 MakeTypicalCall(javascript, "/media/peerconnection-call.html"); 51 MakeTypicalCall(javascript, "/media/peerconnection-call.html");
47 } 52 }
48 53
49 // Convenience method for making calls that detect if audio os playing (which 54 // Convenience method for making calls that detect if audio os playing (which
50 // has some special prerequisites, such that there needs to be an audio output 55 // has some special prerequisites, such that there needs to be an audio output
51 // device on the executing machine). 56 // device on the executing machine).
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 326
322 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CreateOfferWithOfferOptions) { 327 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CreateOfferWithOfferOptions) {
323 MakeTypicalPeerConnectionCall("testCreateOfferOptions();"); 328 MakeTypicalPeerConnectionCall("testCreateOfferOptions();");
324 } 329 }
325 330
326 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallInsideIframe) { 331 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallInsideIframe) {
327 MakeTypicalPeerConnectionCall("callInsideIframe({video: true, audio:true});"); 332 MakeTypicalPeerConnectionCall("callInsideIframe({video: true, audio:true});");
328 } 333 }
329 334
330 } // namespace content 335 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698