Chromium Code Reviews| 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..8dd7b0d95c12eab407702c6dac0bf18fba324321 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,9 +67,15 @@ std::string GenerateGetUserMediaWithOptionalSourceID( |
| namespace content { |
| -class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { |
| +class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest, |
| + public testing::WithParamInterface<bool> { |
| public: |
| - WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) {} |
| + WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) { |
| + if (GetParam()) { |
|
phoglund_chromium
2014/03/12 17:27:18
Same here.
no longer working on chromium
2014/03/12 18:06:08
ditto, I hope not add a SetUpCommandLine(CommandLi
|
| + CommandLine::ForCurrentProcess()->AppendSwitch( |
| + switches::kEnableAudioTrackProcessing); |
| + } |
| + } |
| virtual ~WebRtcGetUserMediaBrowserTest() {} |
| void StartTracing() { |
| @@ -208,10 +216,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 +234,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 +245,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 +255,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 +280,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 +313,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 +346,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 +360,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 +370,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 +390,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 +418,7 @@ struct UserMediaSizes { |
| } // namespace |
| class WebRtcConstraintsBrowserTest |
| - : public WebRtcGetUserMediaBrowserTest, |
| + : public WebRtcContentBrowserTest, |
| public testing::WithParamInterface<UserMediaSizes> { |
| public: |
| WebRtcConstraintsBrowserTest() : user_media_(GetParam()) {} |