| Index: content/browser/media/webrtc_getusermedia_browsertest.cc
|
| diff --git a/content/browser/media/webrtc_getusermedia_browsertest.cc b/content/browser/media/webrtc_getusermedia_browsertest.cc
|
| index 945ab520c8adaa08efb9428e193719148d864a08..f6699ca36d5f5e80304d2b28ba5f158befb995a9 100644
|
| --- a/content/browser/media/webrtc_getusermedia_browsertest.cc
|
| +++ b/content/browser/media/webrtc_getusermedia_browsertest.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/command_line.h"
|
| #include "base/debug/trace_event_impl.h"
|
| #include "base/json/json_reader.h"
|
| #include "base/strings/stringprintf.h"
|
| @@ -9,6 +10,7 @@
|
| #include "base/values.h"
|
| #include "content/browser/media/webrtc_internals.h"
|
| #include "content/browser/web_contents/web_contents_impl.h"
|
| +#include "content/public/common/content_switches.h"
|
| #include "content/public/test/browser_test_utils.h"
|
| #include "content/public/test/test_utils.h"
|
| #include "content/shell/browser/shell.h"
|
| @@ -65,11 +67,20 @@ std::string GenerateGetUserMediaWithOptionalSourceID(
|
|
|
| namespace content {
|
|
|
| -class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest {
|
| +class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest,
|
| + public testing::WithParamInterface<bool> {
|
| public:
|
| WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) {}
|
| virtual ~WebRtcGetUserMediaBrowserTest() {}
|
|
|
| + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
|
| + WebRtcContentBrowserTest::SetUpCommandLine(command_line);
|
| +
|
| + bool enable_audio_track_processing = GetParam();
|
| + if (enable_audio_track_processing)
|
| + command_line->AppendSwitch(switches::kEnableAudioTrackProcessing);
|
| + }
|
| +
|
| void StartTracing() {
|
| CHECK(trace_log_ == NULL) << "Can only can start tracing once";
|
| trace_log_ = base::debug::TraceLog::GetInstance();
|
| @@ -208,10 +219,15 @@ class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest {
|
| scoped_refptr<MessageLoopRunner> message_loop_runner_;
|
| };
|
|
|
| +static const bool kRunTestsWithFlag[] = { false, true };
|
| +INSTANTIATE_TEST_CASE_P(WebRtcGetUserMediaBrowserTests,
|
| + WebRtcGetUserMediaBrowserTest,
|
| + testing::ValuesIn(kRunTestsWithFlag));
|
| +
|
| // These tests will all make a getUserMedia call with different constraints and
|
| // see that the success callback is called. If the error callback is called or
|
| // none of the callbacks are called the tests will simply time out and fail.
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, GetVideoStreamAndStop) {
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, GetVideoStreamAndStop) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
|
| @@ -221,7 +237,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, GetVideoStreamAndStop) {
|
| base::StringPrintf("%s({video: true});", kGetUserMediaAndStop));
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| GetAudioAndVideoStreamAndStop) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -232,7 +248,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| "%s({video: true, audio: true});", kGetUserMediaAndStop));
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| GetAudioAndVideoStreamAndClone) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -242,7 +258,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| ExecuteJavascriptAndWaitForOk("getUserMediaAndClone();");
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| GetUserMediaWithMandatorySourceID) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -267,7 +283,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| }
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| GetUserMediaWithInvalidMandatorySourceID) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -300,7 +316,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| video_ids[0]));
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| GetUserMediaWithInvalidOptionalSourceID) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -333,7 +349,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| video_ids[0])));
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) {
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
|
| @@ -347,7 +363,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) {
|
| // in a simple local <video>, and for a couple of seconds, collect some
|
| // performance traces from VideoCaptureController colorspace conversion and
|
| // potential resizing.
|
| -IN_PROC_BROWSER_TEST_F(
|
| +IN_PROC_BROWSER_TEST_P(
|
| WebRtcGetUserMediaBrowserTest,
|
| TraceVideoCaptureControllerPerformanceDuringGetUserMedia) {
|
| RunGetUserMediaAndCollectMeasures(
|
| @@ -357,7 +373,7 @@ IN_PROC_BROWSER_TEST_F(
|
| }
|
|
|
| // This test calls getUserMedia and checks for aspect ratio behavior.
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| TestGetUserMediaAspectRatio4To3) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -377,7 +393,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| // TODO(perkj): Enable this test as soon as crbug/349450 is fixed.
|
| // Currently the render pipeline doesn't support cropping where the new cropped
|
| // frame doesn't have the same top left coordinates as the original frame.
|
| -IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
|
| +IN_PROC_BROWSER_TEST_P(WebRtcGetUserMediaBrowserTest,
|
| DISABLED_TestGetUserMediaAspectRatio16To9) {
|
| ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
|
|
|
| @@ -405,7 +421,7 @@ struct UserMediaSizes {
|
| } // namespace
|
|
|
| class WebRtcConstraintsBrowserTest
|
| - : public WebRtcGetUserMediaBrowserTest,
|
| + : public WebRtcContentBrowserTest,
|
| public testing::WithParamInterface<UserMediaSizes> {
|
| public:
|
| WebRtcConstraintsBrowserTest() : user_media_(GetParam()) {}
|
|
|