Chromium Code Reviews| 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 3dfb8284870ed9c1d6c029547b0cf1b984377b66..a5ffa6832b6147c2a07e86e09d052335e3b464e8 100644 |
| --- a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc |
| +++ b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc |
| @@ -5,6 +5,7 @@ |
| #include <stddef.h> |
| #include "base/command_line.h" |
| +#include "base/feature_list.h" |
| #include "base/json/json_reader.h" |
| #include "base/memory/ref_counted_memory.h" |
| #include "base/strings/stringprintf.h" |
| @@ -18,6 +19,7 @@ |
| #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" |
| +#include "content/public/common/content_features.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/public/test/browser_test_utils.h" |
| #include "content/public/test/content_browser_test_utils.h" |
| @@ -96,6 +98,11 @@ bool VerifyDisableLocalEcho(bool expect_value, |
| return expect_value == controls.disable_local_echo; |
| } |
| +bool IsOldVideoConstraints() { |
| + return base::FeatureList::IsEnabled( |
| + features::kMediaStreamOldVideoConstraints); |
| +} |
| + |
| } // namespace |
| namespace content { |
| @@ -497,7 +504,10 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| TwoGetUserMediaWithSecondVideoCropped) { |
| std::string constraints1 = "{video: true}"; |
| - std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; |
| + std::string constraints2 = |
| + IsOldVideoConstraints() |
| + ? "{video: {mandatory: {maxHeight: 360}}}" |
| + : "{video: {width: {exact: 640}, height: {exact: 360}}}"; |
| std::string expected_result = "w=640:h=480-w=640:h=360"; |
| RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| expected_result); |
| @@ -514,10 +524,14 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| MAYBE_TwoGetUserMediaWithFirstHdSecondVga) { |
| std::string constraints1 = |
| - "{video: {mandatory: {maxWidth:1280 , minWidth:1280 , maxHeight: 720,\ |
| - minHeight: 720}}}"; |
| + IsOldVideoConstraints() |
| + ? "{video: {mandatory: {maxWidth:1280 , minWidth:1280 , " |
| + "maxHeight: 720, minHeight: 720}}}" |
| + : "{video: {width : {exact: 1280}, height: {exact: 720}}}"; |
| std::string constraints2 = |
| - "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| + IsOldVideoConstraints() |
| + ? "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}" |
| + : "{video: {width : {exact: 640}, height: {exact: 480}}}"; |
| std::string expected_result = "w=1280:h=720-w=640:h=480"; |
| RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| expected_result); |
|
hbos_chromium
2017/04/05 12:37:27
ScopedFeature thingy to test both old and new with
Guido Urdaneta
2017/04/05 16:17:16
Done.
|
| @@ -528,8 +542,8 @@ IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| DISABLED_TwoGetUserMediaWithFirst1080pSecondVga) { |
| std::string constraints1 = |
| - "{video: {mandatory: {maxWidth:1920 , minWidth:1920 , maxHeight: 1080,\ |
| - minHeight: 1080}}}"; |
| + "{video: {mandatory: {maxWidth:1920 , minWidth:1920 , maxHeight: 1080, " |
| + "minHeight: 1080}}}"; |
| std::string constraints2 = |
| "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| std::string expected_result = "w=1920:h=1080-w=640:h=480"; |