[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 9906368 | 2014-03-13 15:15:30 | [diff] [blame] | 5 | #include "base/command_line.h" |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 6 | #include "base/debug/trace_event_impl.h" |
| 7 | #include "base/json/json_reader.h" |
| 8 | #include "base/strings/stringprintf.h" |
| 9 | #include "base/test/trace_event_analyzer.h" |
| 10 | #include "base/values.h" |
| 11 | #include "content/browser/media/webrtc_internals.h" |
| 12 | #include "content/browser/web_contents/web_contents_impl.h" |
[email protected] | 9906368 | 2014-03-13 15:15:30 | [diff] [blame] | 13 | #include "content/public/common/content_switches.h" |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 14 | #include "content/public/test/browser_test_utils.h" |
[email protected] | 6e9def1 | 2014-03-27 20:23:28 | [diff] [blame] | 15 | #include "content/public/test/content_browser_test_utils.h" |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 16 | #include "content/public/test/test_utils.h" |
| 17 | #include "content/shell/browser/shell.h" |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 18 | #include "content/test/webrtc_content_browsertest_base.h" |
| 19 | #include "net/test/embedded_test_server/embedded_test_server.h" |
| 20 | #include "testing/perf/perf_test.h" |
| 21 | |
| 22 | #if defined(OS_WIN) |
| 23 | #include "base/win/windows_version.h" |
| 24 | #endif |
| 25 | |
| 26 | using trace_analyzer::TraceAnalyzer; |
| 27 | using trace_analyzer::Query; |
| 28 | using trace_analyzer::TraceEventVector; |
| 29 | |
| 30 | namespace { |
| 31 | |
| 32 | static const char kGetUserMediaAndStop[] = "getUserMediaAndStop"; |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 33 | static const char kGetUserMediaAndGetStreamUp[] = "getUserMediaAndGetStreamUp"; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 34 | static const char kGetUserMediaAndAnalyseAndStop[] = |
| 35 | "getUserMediaAndAnalyseAndStop"; |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 36 | static const char kGetUserMediaAndExpectFailure[] = |
| 37 | "getUserMediaAndExpectFailure"; |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 38 | static const char kRenderSameTrackMediastreamAndStop[] = |
| 39 | "renderSameTrackMediastreamAndStop"; |
| 40 | static const char kRenderClonedMediastreamAndStop[] = |
| 41 | "renderClonedMediastreamAndStop"; |
| 42 | static const char kRenderClonedTrackMediastreamAndStop[] = |
| 43 | "renderClonedTrackMediastreamAndStop"; |
| 44 | static const char kRenderDuplicatedMediastreamAndStop[] = |
| 45 | "renderDuplicatedMediastreamAndStop"; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 46 | |
| 47 | // Results returned by JS. |
| 48 | static const char kOK[] = "OK"; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 49 | |
| 50 | std::string GenerateGetUserMediaWithMandatorySourceID( |
| 51 | const std::string& function_name, |
| 52 | const std::string& audio_source_id, |
| 53 | const std::string& video_source_id) { |
| 54 | const std::string audio_constraint = |
| 55 | "audio: {mandatory: { sourceId:\"" + audio_source_id + "\"}}, "; |
| 56 | |
| 57 | const std::string video_constraint = |
| 58 | "video: {mandatory: { sourceId:\"" + video_source_id + "\"}}"; |
| 59 | return function_name + "({" + audio_constraint + video_constraint + "});"; |
| 60 | } |
| 61 | |
| 62 | std::string GenerateGetUserMediaWithOptionalSourceID( |
| 63 | const std::string& function_name, |
| 64 | const std::string& audio_source_id, |
| 65 | const std::string& video_source_id) { |
| 66 | const std::string audio_constraint = |
| 67 | "audio: {optional: [{sourceId:\"" + audio_source_id + "\"}]}, "; |
| 68 | |
| 69 | const std::string video_constraint = |
| 70 | "video: {optional: [{ sourceId:\"" + video_source_id + "\"}]}"; |
| 71 | return function_name + "({" + audio_constraint + video_constraint + "});"; |
| 72 | } |
| 73 | |
| 74 | } // namespace |
| 75 | |
| 76 | namespace content { |
| 77 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 78 | class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 79 | public: |
| 80 | WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) {} |
| 81 | virtual ~WebRtcGetUserMediaBrowserTest() {} |
| 82 | |
| 83 | void StartTracing() { |
| 84 | CHECK(trace_log_ == NULL) << "Can only can start tracing once"; |
| 85 | trace_log_ = base::debug::TraceLog::GetInstance(); |
[email protected] | 4753b9e | 2014-08-04 16:30:52 | [diff] [blame] | 86 | base::debug::TraceOptions trace_options(base::debug::RECORD_UNTIL_FULL); |
| 87 | trace_options.enable_sampling = true; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 88 | trace_log_->SetEnabled(base::debug::CategoryFilter("video"), |
| 89 | base::debug::TraceLog::RECORDING_MODE, |
[email protected] | 4753b9e | 2014-08-04 16:30:52 | [diff] [blame] | 90 | trace_options); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 91 | // Check that we are indeed recording. |
| 92 | EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); |
| 93 | } |
| 94 | |
| 95 | void StopTracing() { |
dcheng | 7707e97 | 2014-08-26 19:37:01 | [diff] [blame] | 96 | CHECK(message_loop_runner_.get() == NULL) |
| 97 | << "Calling StopTracing more than once"; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 98 | trace_log_->SetDisabled(); |
| 99 | message_loop_runner_ = new MessageLoopRunner; |
| 100 | trace_log_->Flush(base::Bind( |
| 101 | &WebRtcGetUserMediaBrowserTest::OnTraceDataCollected, |
| 102 | base::Unretained(this))); |
| 103 | message_loop_runner_->Run(); |
| 104 | } |
| 105 | |
| 106 | void OnTraceDataCollected( |
| 107 | const scoped_refptr<base::RefCountedString>& events_str_ptr, |
| 108 | bool has_more_events) { |
| 109 | CHECK(!has_more_events); |
| 110 | recorded_trace_data_ = events_str_ptr; |
| 111 | message_loop_runner_->Quit(); |
| 112 | } |
| 113 | |
| 114 | TraceAnalyzer* CreateTraceAnalyzer() { |
| 115 | return TraceAnalyzer::Create("[" + recorded_trace_data_->data() + "]"); |
| 116 | } |
| 117 | |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 118 | void RunGetUserMediaAndCollectMeasures(const int time_to_sample_secs, |
| 119 | const std::string& measure_filter, |
| 120 | const std::string& graph_name) { |
| 121 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 122 | |
| 123 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 124 | NavigateToURL(shell(), url); |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 125 | |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 126 | // Put getUserMedia to work and let it run for a couple of seconds. |
| 127 | DCHECK(time_to_sample_secs); |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 128 | ExecuteJavascriptAndWaitForOk( |
phoglund | 4eb7545 | 2014-10-07 15:34:07 | [diff] [blame^] | 129 | base::StringPrintf("%s({video: true}, 'myStreamName');", |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 130 | kGetUserMediaAndGetStreamUp)); |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 131 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 132 | // Now the stream is up and running, start collecting traces. |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 133 | StartTracing(); |
| 134 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 135 | ExecuteJavascriptAndWaitForOk( |
phoglund | 4eb7545 | 2014-10-07 15:34:07 | [diff] [blame^] | 136 | base::StringPrintf("waitAndStopVideoTrack(window['myStreamName'], %d);", |
| 137 | time_to_sample_secs)); |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 138 | |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 139 | // Wait until the page title changes to "OK". Do not sleep() here since that |
| 140 | // would stop both this code and the browser underneath. |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 141 | StopTracing(); |
| 142 | |
| 143 | scoped_ptr<TraceAnalyzer> analyzer(CreateTraceAnalyzer()); |
| 144 | analyzer->AssociateBeginEndEvents(); |
| 145 | trace_analyzer::TraceEventVector events; |
| 146 | DCHECK(measure_filter.size()); |
| 147 | analyzer->FindEvents( |
| 148 | Query::EventNameIs(measure_filter), |
| 149 | &events); |
| 150 | ASSERT_GT(events.size(), 0u) |
| 151 | << "Could not collect any samples during test, this is bad"; |
| 152 | |
| 153 | std::string duration_us; |
| 154 | std::string interarrival_us; |
| 155 | for (size_t i = 0; i != events.size(); ++i) { |
| 156 | duration_us.append( |
| 157 | base::StringPrintf("%d,", static_cast<int>(events[i]->duration))); |
| 158 | } |
| 159 | |
| 160 | for (size_t i = 1; i < events.size(); ++i) { |
| 161 | // The event |timestamp| comes in ns, divide to get us like |duration|. |
| 162 | interarrival_us.append(base::StringPrintf("%d,", |
| 163 | static_cast<int>((events[i]->timestamp - events[i - 1]->timestamp) / |
| 164 | base::Time::kNanosecondsPerMicrosecond))); |
| 165 | } |
| 166 | |
| 167 | perf_test::PrintResultList( |
| 168 | graph_name, "", "sample_duration", duration_us, "us", true); |
| 169 | |
| 170 | perf_test::PrintResultList( |
| 171 | graph_name, "", "interarrival_time", interarrival_us, "us", true); |
| 172 | } |
| 173 | |
[email protected] | 697173d | 2014-06-26 11:52:13 | [diff] [blame] | 174 | // Runs the JavaScript twoGetUserMedia with |constraints1| and |constraint2|. |
[email protected] | ff993f9 | 2014-05-22 17:24:00 | [diff] [blame] | 175 | void RunTwoGetTwoGetUserMediaWithDifferentContraints( |
| 176 | const std::string& constraints1, |
| 177 | const std::string& constraints2, |
| 178 | const std::string& expected_result) { |
| 179 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 180 | |
| 181 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 182 | NavigateToURL(shell(), url); |
| 183 | |
| 184 | std::string command = "twoGetUserMedia(" + constraints1 + ',' + |
| 185 | constraints2 + ')'; |
| 186 | |
| 187 | EXPECT_EQ(expected_result, ExecuteJavascriptAndReturnResult(command)); |
| 188 | } |
| 189 | |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 190 | void GetInputDevices(std::vector<std::string>* audio_ids, |
| 191 | std::vector<std::string>* video_ids) { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 192 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 193 | NavigateToURL(shell(), url); |
| 194 | |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 195 | std::string devices_as_json = ExecuteJavascriptAndReturnResult( |
[email protected] | b9ced84 | 2014-07-03 13:10:03 | [diff] [blame] | 196 | "getSources()"); |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 197 | EXPECT_FALSE(devices_as_json.empty()); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 198 | |
| 199 | int error_code; |
| 200 | std::string error_message; |
| 201 | scoped_ptr<base::Value> value( |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 202 | base::JSONReader::ReadAndReturnError(devices_as_json, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 203 | base::JSON_ALLOW_TRAILING_COMMAS, |
| 204 | &error_code, |
| 205 | &error_message)); |
| 206 | |
| 207 | ASSERT_TRUE(value.get() != NULL) << error_message; |
| 208 | EXPECT_EQ(value->GetType(), base::Value::TYPE_LIST); |
| 209 | |
| 210 | base::ListValue* values; |
| 211 | ASSERT_TRUE(value->GetAsList(&values)); |
| 212 | |
| 213 | for (base::ListValue::iterator it = values->begin(); |
| 214 | it != values->end(); ++it) { |
| 215 | const base::DictionaryValue* dict; |
| 216 | std::string kind; |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 217 | std::string device_id; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 218 | ASSERT_TRUE((*it)->GetAsDictionary(&dict)); |
| 219 | ASSERT_TRUE(dict->GetString("kind", &kind)); |
[email protected] | b9ced84 | 2014-07-03 13:10:03 | [diff] [blame] | 220 | ASSERT_TRUE(dict->GetString("id", &device_id)); |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 221 | ASSERT_FALSE(device_id.empty()); |
[email protected] | b9ced84 | 2014-07-03 13:10:03 | [diff] [blame] | 222 | EXPECT_TRUE(kind == "audio" || kind == "video"); |
| 223 | if (kind == "audio") { |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 224 | audio_ids->push_back(device_id); |
[email protected] | b9ced84 | 2014-07-03 13:10:03 | [diff] [blame] | 225 | } else if (kind == "video") { |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 226 | video_ids->push_back(device_id); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 227 | } |
| 228 | } |
| 229 | ASSERT_FALSE(audio_ids->empty()); |
| 230 | ASSERT_FALSE(video_ids->empty()); |
| 231 | } |
| 232 | |
| 233 | private: |
| 234 | base::debug::TraceLog* trace_log_; |
| 235 | scoped_refptr<base::RefCountedString> recorded_trace_data_; |
| 236 | scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 237 | }; |
| 238 | |
| 239 | // These tests will all make a getUserMedia call with different constraints and |
| 240 | // see that the success callback is called. If the error callback is called or |
| 241 | // none of the callbacks are called the tests will simply time out and fail. |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 242 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, GetVideoStreamAndStop) { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 243 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 244 | |
| 245 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 246 | NavigateToURL(shell(), url); |
| 247 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 248 | ExecuteJavascriptAndWaitForOk( |
| 249 | base::StringPrintf("%s({video: true});", kGetUserMediaAndStop)); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 250 | } |
| 251 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 252 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 253 | RenderSameTrackMediastreamAndStop) { |
| 254 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 255 | |
| 256 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 257 | NavigateToURL(shell(), url); |
| 258 | |
| 259 | ExecuteJavascriptAndWaitForOk( |
| 260 | base::StringPrintf("%s({video: true});", |
| 261 | kRenderSameTrackMediastreamAndStop)); |
| 262 | } |
| 263 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 264 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 265 | RenderClonedMediastreamAndStop) { |
| 266 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 267 | |
| 268 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 269 | NavigateToURL(shell(), url); |
| 270 | |
| 271 | |
| 272 | ExecuteJavascriptAndWaitForOk( |
| 273 | base::StringPrintf("%s({video: true});", |
| 274 | kRenderClonedMediastreamAndStop)); |
| 275 | } |
| 276 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 277 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 278 | kRenderClonedTrackMediastreamAndStop) { |
| 279 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 280 | |
| 281 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 282 | NavigateToURL(shell(), url); |
| 283 | |
| 284 | ExecuteJavascriptAndWaitForOk( |
| 285 | base::StringPrintf("%s({video: true});", |
| 286 | kRenderClonedTrackMediastreamAndStop)); |
| 287 | } |
| 288 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 289 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 1670d03 | 2014-03-20 15:01:45 | [diff] [blame] | 290 | kRenderDuplicatedMediastreamAndStop) { |
| 291 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 292 | |
| 293 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 294 | NavigateToURL(shell(), url); |
| 295 | |
| 296 | ExecuteJavascriptAndWaitForOk( |
| 297 | base::StringPrintf("%s({video: true});", |
| 298 | kRenderDuplicatedMediastreamAndStop)); |
| 299 | } |
| 300 | |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 301 | // Flaky on Android. http://crbug.com/387895 |
| 302 | #if defined(OS_ANDROID) |
| 303 | #define MAYBE_GetAudioAndVideoStreamAndStop DISABLED_GetAudioAndVideoStreamAndStop |
| 304 | #else |
| 305 | #define MAYBE_GetAudioAndVideoStreamAndStop GetAudioAndVideoStreamAndStop |
| 306 | #endif |
| 307 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 308 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 309 | MAYBE_GetAudioAndVideoStreamAndStop) { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 310 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 311 | |
| 312 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 313 | NavigateToURL(shell(), url); |
| 314 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 315 | ExecuteJavascriptAndWaitForOk(base::StringPrintf( |
| 316 | "%s({video: true, audio: true});", kGetUserMediaAndStop)); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 317 | } |
| 318 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 319 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 320 | GetAudioAndVideoStreamAndClone) { |
| 321 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 322 | |
| 323 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 324 | NavigateToURL(shell(), url); |
| 325 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 326 | ExecuteJavascriptAndWaitForOk("getUserMediaAndClone();"); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 327 | } |
| 328 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 329 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | c606287 | 2014-03-21 14:35:37 | [diff] [blame] | 330 | RenderVideoTrackInMultipleTagsAndPause) { |
| 331 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 332 | |
| 333 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 334 | NavigateToURL(shell(), url); |
| 335 | |
| 336 | ExecuteJavascriptAndWaitForOk("getUserMediaAndRenderInSeveralVideoTags();"); |
| 337 | } |
| 338 | |
| 339 | |
| 340 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 341 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 342 | GetUserMediaWithMandatorySourceID) { |
| 343 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 344 | |
| 345 | std::vector<std::string> audio_ids; |
| 346 | std::vector<std::string> video_ids; |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 347 | GetInputDevices(&audio_ids, &video_ids); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 348 | |
| 349 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 350 | |
| 351 | // Test all combinations of mandatory sourceID; |
| 352 | for (std::vector<std::string>::const_iterator video_it = video_ids.begin(); |
| 353 | video_it != video_ids.end(); ++video_it) { |
| 354 | for (std::vector<std::string>::const_iterator audio_it = audio_ids.begin(); |
| 355 | audio_it != audio_ids.end(); ++audio_it) { |
| 356 | NavigateToURL(shell(), url); |
| 357 | EXPECT_EQ(kOK, ExecuteJavascriptAndReturnResult( |
| 358 | GenerateGetUserMediaWithMandatorySourceID( |
| 359 | kGetUserMediaAndStop, |
| 360 | *audio_it, |
| 361 | *video_it))); |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 366 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 367 | GetUserMediaWithInvalidMandatorySourceID) { |
| 368 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 369 | |
| 370 | std::vector<std::string> audio_ids; |
| 371 | std::vector<std::string> video_ids; |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 372 | GetInputDevices(&audio_ids, &video_ids); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 373 | |
| 374 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 375 | |
| 376 | // Test with invalid mandatory audio sourceID. |
| 377 | NavigateToURL(shell(), url); |
[email protected] | 32d37741 | 2014-03-19 21:15:43 | [diff] [blame] | 378 | EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult( |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 379 | GenerateGetUserMediaWithMandatorySourceID( |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 380 | kGetUserMediaAndExpectFailure, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 381 | "something invalid", |
[email protected] | 0c7158b | 2014-03-17 16:46:38 | [diff] [blame] | 382 | video_ids[0]))); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 383 | |
| 384 | // Test with invalid mandatory video sourceID. |
[email protected] | 32d37741 | 2014-03-19 21:15:43 | [diff] [blame] | 385 | EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult( |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 386 | GenerateGetUserMediaWithMandatorySourceID( |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 387 | kGetUserMediaAndExpectFailure, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 388 | audio_ids[0], |
[email protected] | 0c7158b | 2014-03-17 16:46:38 | [diff] [blame] | 389 | "something invalid"))); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 390 | |
| 391 | // Test with empty mandatory audio sourceID. |
[email protected] | 32d37741 | 2014-03-19 21:15:43 | [diff] [blame] | 392 | EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult( |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 393 | GenerateGetUserMediaWithMandatorySourceID( |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 394 | kGetUserMediaAndExpectFailure, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 395 | "", |
[email protected] | 0c7158b | 2014-03-17 16:46:38 | [diff] [blame] | 396 | video_ids[0]))); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 397 | } |
| 398 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 399 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 400 | GetUserMediaWithInvalidOptionalSourceID) { |
| 401 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 402 | |
| 403 | std::vector<std::string> audio_ids; |
| 404 | std::vector<std::string> video_ids; |
[email protected] | 8926d569 | 2014-06-11 05:02:22 | [diff] [blame] | 405 | GetInputDevices(&audio_ids, &video_ids); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 406 | |
| 407 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 408 | |
| 409 | // Test with invalid optional audio sourceID. |
| 410 | NavigateToURL(shell(), url); |
| 411 | EXPECT_EQ(kOK, ExecuteJavascriptAndReturnResult( |
| 412 | GenerateGetUserMediaWithOptionalSourceID( |
| 413 | kGetUserMediaAndStop, |
| 414 | "something invalid", |
| 415 | video_ids[0]))); |
| 416 | |
| 417 | // Test with invalid optional video sourceID. |
| 418 | EXPECT_EQ(kOK, ExecuteJavascriptAndReturnResult( |
| 419 | GenerateGetUserMediaWithOptionalSourceID( |
| 420 | kGetUserMediaAndStop, |
| 421 | audio_ids[0], |
| 422 | "something invalid"))); |
| 423 | |
| 424 | // Test with empty optional audio sourceID. |
| 425 | EXPECT_EQ(kOK, ExecuteJavascriptAndReturnResult( |
| 426 | GenerateGetUserMediaWithOptionalSourceID( |
| 427 | kGetUserMediaAndStop, |
| 428 | "", |
| 429 | video_ids[0]))); |
| 430 | } |
| 431 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 432 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, TwoGetUserMediaAndStop) { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 433 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 434 | |
| 435 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 436 | NavigateToURL(shell(), url); |
| 437 | |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 438 | ExecuteJavascriptAndWaitForOk( |
| 439 | "twoGetUserMediaAndStop({video: true, audio: true});"); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 440 | } |
| 441 | |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 442 | #if defined(OS_WIN) && !defined(NDEBUG) |
| 443 | // Flaky on Webkit Win7 Debug bot: http://crbug.com/417756 |
| 444 | #define MAYBE_TwoGetUserMediaWithEqualConstraints \ |
| 445 | DISABLED_TwoGetUserMediaWithEqualConstraints |
| 446 | #else |
| 447 | #define MAYBE_TwoGetUserMediaWithEqualConstraints \ |
| 448 | TwoGetUserMediaWithEqualConstraints |
| 449 | #endif |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 450 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 451 | MAYBE_TwoGetUserMediaWithEqualConstraints) { |
[email protected] | ff993f9 | 2014-05-22 17:24:00 | [diff] [blame] | 452 | std::string constraints1 = "{video: true, audio: true}"; |
| 453 | const std::string& constraints2 = constraints1; |
| 454 | std::string expected_result = "w=640:h=480-w=640:h=480"; |
| 455 | |
| 456 | RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 457 | expected_result); |
[email protected] | 744ff3e | 2014-06-19 19:28:01 | [diff] [blame] | 458 | } |
[email protected] | ff993f9 | 2014-05-22 17:24:00 | [diff] [blame] | 459 | |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 460 | #if defined(OS_WIN) |
| 461 | // Flaky on Windows Debug: http://crbug.com/417756 |
| 462 | #define MAYBE_TwoGetUserMediaWithSecondVideoCropped \ |
| 463 | DISABLED_TwoGetUserMediaWithSecondVideoCropped |
| 464 | #else |
| 465 | #define MAYBE_TwoGetUserMediaWithSecondVideoCropped \ |
| 466 | TwoGetUserMediaWithSecondVideoCropped |
| 467 | #endif |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 468 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 469 | MAYBE_TwoGetUserMediaWithSecondVideoCropped) { |
[email protected] | ff993f9 | 2014-05-22 17:24:00 | [diff] [blame] | 470 | std::string constraints1 = "{video: true}"; |
| 471 | std::string constraints2 = "{video: {mandatory: {maxHeight: 360}}}"; |
| 472 | std::string expected_result = "w=640:h=480-w=640:h=360"; |
| 473 | RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 474 | expected_result); |
| 475 | } |
| 476 | |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 477 | #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(NDEBUG)) |
| 478 | // Flaky on Windows and on Linux Debug: http://crbug.com/417756 |
| 479 | #define MAYBE_TwoGetUserMediaWithFirstHdSecondVga \ |
| 480 | DISABLED_TwoGetUserMediaWithFirstHdSecondVga |
| 481 | #else |
| 482 | #define MAYBE_TwoGetUserMediaWithFirstHdSecondVga \ |
| 483 | TwoGetUserMediaWithFirstHdSecondVga |
| 484 | #endif |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 485 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
jam | 290d2cf | 2014-10-06 17:23:51 | [diff] [blame] | 486 | MAYBE_TwoGetUserMediaWithFirstHdSecondVga) { |
[email protected] | ff993f9 | 2014-05-22 17:24:00 | [diff] [blame] | 487 | std::string constraints1 = |
| 488 | "{video: {mandatory: {minWidth:1280 , minHeight: 720}}}"; |
| 489 | std::string constraints2 = |
| 490 | "{video: {mandatory: {maxWidth:640 , maxHeight: 480}}}"; |
| 491 | std::string expected_result = "w=1280:h=720-w=640:h=480"; |
| 492 | RunTwoGetTwoGetUserMediaWithDifferentContraints(constraints1, constraints2, |
| 493 | expected_result); |
| 494 | } |
| 495 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 496 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 697173d | 2014-06-26 11:52:13 | [diff] [blame] | 497 | TwoGetUserMediaAndVerifyFrameRate) { |
| 498 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 499 | |
| 500 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 501 | NavigateToURL(shell(), url); |
| 502 | |
| 503 | std::string constraints1 = |
| 504 | "{video: {mandatory: {minWidth:640 , minHeight: 480, " |
| 505 | "minFrameRate : 15, maxFrameRate : 15}}}"; |
| 506 | std::string constraints2 = |
| 507 | "{video: {mandatory: {maxWidth:320 , maxHeight: 240," |
| 508 | "minFrameRate : 7, maxFrameRate : 7}}}"; |
| 509 | |
| 510 | std::string command = "twoGetUserMediaAndVerifyFrameRate(" + |
| 511 | constraints1 + ',' + constraints2 + ", 15, 7)"; |
| 512 | ExecuteJavascriptAndWaitForOk(command); |
| 513 | } |
| 514 | |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 515 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 0c7158b | 2014-03-17 16:46:38 | [diff] [blame] | 516 | GetUserMediaWithTooHighVideoConstraintsValues) { |
| 517 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 518 | |
| 519 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 520 | |
| 521 | int large_value = 99999; |
| 522 | std::string call = GenerateGetUserMediaCall(kGetUserMediaAndExpectFailure, |
| 523 | large_value, |
| 524 | large_value, |
| 525 | large_value, |
| 526 | large_value, |
| 527 | large_value, |
| 528 | large_value); |
| 529 | NavigateToURL(shell(), url); |
| 530 | |
[email protected] | c3629aa | 2014-08-12 05:48:30 | [diff] [blame] | 531 | EXPECT_EQ("ConstraintNotSatisfiedError", |
| 532 | ExecuteJavascriptAndReturnResult(call)); |
[email protected] | 0c7158b | 2014-03-17 16:46:38 | [diff] [blame] | 533 | } |
| 534 | |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 535 | // This test will make a simple getUserMedia page, verify that video is playing |
| 536 | // in a simple local <video>, and for a couple of seconds, collect some |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 537 | // performance traces from VideoCaptureController colorspace conversion and |
| 538 | // potential resizing. |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 539 | IN_PROC_BROWSER_TEST_F( |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 540 | WebRtcGetUserMediaBrowserTest, |
| 541 | TraceVideoCaptureControllerPerformanceDuringGetUserMedia) { |
| 542 | RunGetUserMediaAndCollectMeasures( |
| 543 | 10, |
[email protected] | 5a64203 | 2014-02-28 15:43:28 | [diff] [blame] | 544 | "VideoCaptureController::OnIncomingCapturedData", |
[email protected] | 3fa8aa1 | 2014-01-20 19:06:54 | [diff] [blame] | 545 | "VideoCaptureController"); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 546 | } |
| 547 | |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 548 | // This test calls getUserMedia and checks for aspect ratio behavior. |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 549 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 856f7cbd | 2014-03-07 09:54:32 | [diff] [blame] | 550 | TestGetUserMediaAspectRatio4To3) { |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 551 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 552 | |
| 553 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 554 | |
| 555 | std::string constraints_4_3 = GenerateGetUserMediaCall( |
[email protected] | cbc7d67 | 2014-04-04 09:27:07 | [diff] [blame] | 556 | kGetUserMediaAndAnalyseAndStop, 640, 640, 480, 480, 10, 30); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 557 | |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 558 | NavigateToURL(shell(), url); |
[email protected] | b5d213b | 2014-03-27 11:45:05 | [diff] [blame] | 559 | ASSERT_EQ("w=640:h=480", |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 560 | ExecuteJavascriptAndReturnResult(constraints_4_3)); |
[email protected] | 856f7cbd | 2014-03-07 09:54:32 | [diff] [blame] | 561 | } |
| 562 | |
| 563 | // This test calls getUserMedia and checks for aspect ratio behavior. |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 564 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 599b15a2 | 2014-03-27 16:33:10 | [diff] [blame] | 565 | TestGetUserMediaAspectRatio16To9) { |
[email protected] | 856f7cbd | 2014-03-07 09:54:32 | [diff] [blame] | 566 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 567 | |
| 568 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 569 | |
| 570 | std::string constraints_16_9 = GenerateGetUserMediaCall( |
[email protected] | cbc7d67 | 2014-04-04 09:27:07 | [diff] [blame] | 571 | kGetUserMediaAndAnalyseAndStop, 640, 640, 360, 360, 10, 30); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 572 | |
| 573 | NavigateToURL(shell(), url); |
[email protected] | b5d213b | 2014-03-27 11:45:05 | [diff] [blame] | 574 | ASSERT_EQ("w=640:h=360", |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 575 | ExecuteJavascriptAndReturnResult(constraints_16_9)); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 576 | } |
| 577 | |
[email protected] | b5d213b | 2014-03-27 11:45:05 | [diff] [blame] | 578 | // This test calls getUserMedia and checks for aspect ratio behavior. |
[email protected] | 118c458 | 2014-07-17 08:02:08 | [diff] [blame] | 579 | IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
[email protected] | 599b15a2 | 2014-03-27 16:33:10 | [diff] [blame] | 580 | TestGetUserMediaAspectRatio1To1) { |
[email protected] | b5d213b | 2014-03-27 11:45:05 | [diff] [blame] | 581 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 582 | |
| 583 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 584 | |
| 585 | std::string constraints_1_1 = GenerateGetUserMediaCall( |
[email protected] | cbc7d67 | 2014-04-04 09:27:07 | [diff] [blame] | 586 | kGetUserMediaAndAnalyseAndStop, 320, 320, 320, 320, 10, 30); |
[email protected] | b5d213b | 2014-03-27 11:45:05 | [diff] [blame] | 587 | |
| 588 | NavigateToURL(shell(), url); |
| 589 | ASSERT_EQ("w=320:h=320", |
| 590 | ExecuteJavascriptAndReturnResult(constraints_1_1)); |
| 591 | } |
| 592 | |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 593 | namespace { |
| 594 | |
| 595 | struct UserMediaSizes { |
| 596 | int min_width; |
| 597 | int max_width; |
| 598 | int min_height; |
| 599 | int max_height; |
| 600 | int min_frame_rate; |
| 601 | int max_frame_rate; |
| 602 | }; |
| 603 | |
| 604 | } // namespace |
| 605 | |
| 606 | class WebRtcConstraintsBrowserTest |
[email protected] | 9906368 | 2014-03-13 15:15:30 | [diff] [blame] | 607 | : public WebRtcContentBrowserTest, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 608 | public testing::WithParamInterface<UserMediaSizes> { |
| 609 | public: |
| 610 | WebRtcConstraintsBrowserTest() : user_media_(GetParam()) {} |
| 611 | const UserMediaSizes& user_media() const { return user_media_; } |
| 612 | |
| 613 | private: |
| 614 | UserMediaSizes user_media_; |
| 615 | }; |
| 616 | |
| 617 | // This test calls getUserMedia in sequence with different constraints. |
| 618 | IN_PROC_BROWSER_TEST_P(WebRtcConstraintsBrowserTest, GetUserMediaConstraints) { |
| 619 | ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 620 | |
| 621 | GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 622 | |
| 623 | std::string call = GenerateGetUserMediaCall(kGetUserMediaAndStop, |
| 624 | user_media().min_width, |
| 625 | user_media().max_width, |
| 626 | user_media().min_height, |
| 627 | user_media().max_height, |
| 628 | user_media().min_frame_rate, |
| 629 | user_media().max_frame_rate); |
| 630 | DVLOG(1) << "Calling getUserMedia: " << call; |
| 631 | NavigateToURL(shell(), url); |
[email protected] | 43ebe9e | 2014-03-08 21:00:58 | [diff] [blame] | 632 | ExecuteJavascriptAndWaitForOk(call); |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | static const UserMediaSizes kAllUserMediaSizes[] = { |
[email protected] | cbc7d67 | 2014-04-04 09:27:07 | [diff] [blame] | 636 | {320, 320, 180, 180, 10, 30}, |
| 637 | {320, 320, 240, 240, 10, 30}, |
| 638 | {640, 640, 360, 360, 10, 30}, |
| 639 | {640, 640, 480, 480, 10, 30}, |
| 640 | {960, 960, 720, 720, 10, 30}, |
| 641 | {1280, 1280, 720, 720, 10, 30}}; |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 642 | |
[email protected] | 33afb89 | 2014-07-11 08:17:30 | [diff] [blame] | 643 | INSTANTIATE_TEST_CASE_P(UserMedia, |
[email protected] | bdcc970 | 2014-01-17 16:07:46 | [diff] [blame] | 644 | WebRtcConstraintsBrowserTest, |
| 645 | testing::ValuesIn(kAllUserMediaSizes)); |
| 646 | |
| 647 | } // namespace content |