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

Unified Diff: content/browser/webrtc/webrtc_getusermedia_browsertest.cc

Issue 2291893002: Let Contraints Controll Mute/Unmute Audio Local Playback For Desktop Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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: content/browser/webrtc/webrtc_getusermedia_browsertest.cc
diff --git a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
index 711c5ae6e96c3b84a33c3740e2084d78d9e51218..33e294510546c2c6512cf7824fdd871b3af6f8a6 100644
--- a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
+++ b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
@@ -13,6 +13,8 @@
#include "base/trace_event/trace_event_impl.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "content/browser/browser_main_loop.h"
+#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/webrtc/webrtc_content_browsertest_base.h"
#include "content/browser/webrtc/webrtc_internals.h"
@@ -76,6 +78,23 @@ std::string GenerateGetUserMediaWithOptionalSourceID(
return function_name + "({" + audio_constraint + video_constraint + "});";
}
+std::string GenerateGetUserMediaWithDisableLocalEcho(
+ const std::string& function_name,
+ const std::string& disable_local_echo) {
+ const std::string audio_constraint =
+ "audio:{mandatory: { chromeMediaSource : 'system', disableLocalEcho : " +
+ disable_local_echo + " }},";
+
+ const std::string video_constraint =
+ "video: { mandatory: { chromeMediaSource:'screen' }}";
+ return function_name + "({" + audio_constraint + video_constraint + "});";
+}
+
+bool VerifyDisableLocalEcho(bool expect_value,
+ const content::StreamControls& controls) {
+ return expect_value == controls.disable_local_echo;
+}
+
} // namespace
namespace content {
@@ -723,4 +742,32 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
ExecuteJavascriptAndWaitForOk(call);
}
+IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
+ DisableLocalEchoParameter) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableExperimentalWebPlatformFeatures);
+ ASSERT_TRUE(embedded_test_server()->Start());
+
+ GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
+ NavigateToURL(shell(), url);
+
+ MediaStreamManager* manager =
+ BrowserMainLoop::GetInstance()->media_stream_manager();
+
+ manager->SetGenerateStreamCallbackForTesting(
+ base::Bind(&VerifyDisableLocalEcho, false));
+ std::string call = GenerateGetUserMediaWithDisableLocalEcho(
+ "getUserMediaAndExpectSuccess", "false");
+ ExecuteJavascriptAndWaitForOk(call);
+
+ manager->SetGenerateStreamCallbackForTesting(
+ base::Bind(&VerifyDisableLocalEcho, true));
+ call = GenerateGetUserMediaWithDisableLocalEcho(
+ "getUserMediaAndExpectSuccess", "true");
+ ExecuteJavascriptAndWaitForOk(call);
+
+ manager->SetGenerateStreamCallbackForTesting(
+ MediaStreamManager::GenerateStreamTestCallback());
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/media/video_capture_manager.cc ('k') | content/common/media/media_stream_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698