Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 static const char kGetUserMediaAndExpectFailure[] = | 43 static const char kGetUserMediaAndExpectFailure[] = |
| 44 "getUserMediaAndExpectFailure"; | 44 "getUserMediaAndExpectFailure"; |
| 45 static const char kRenderSameTrackMediastreamAndStop[] = | 45 static const char kRenderSameTrackMediastreamAndStop[] = |
| 46 "renderSameTrackMediastreamAndStop"; | 46 "renderSameTrackMediastreamAndStop"; |
| 47 static const char kRenderClonedMediastreamAndStop[] = | 47 static const char kRenderClonedMediastreamAndStop[] = |
| 48 "renderClonedMediastreamAndStop"; | 48 "renderClonedMediastreamAndStop"; |
| 49 static const char kRenderClonedTrackMediastreamAndStop[] = | 49 static const char kRenderClonedTrackMediastreamAndStop[] = |
| 50 "renderClonedTrackMediastreamAndStop"; | 50 "renderClonedTrackMediastreamAndStop"; |
| 51 static const char kRenderDuplicatedMediastreamAndStop[] = | 51 static const char kRenderDuplicatedMediastreamAndStop[] = |
| 52 "renderDuplicatedMediastreamAndStop"; | 52 "renderDuplicatedMediastreamAndStop"; |
| 53 static const char kGetDepthStreamAndCallCreateImageBitmap[] = | |
| 54 "getDepthStreamAndCallCreateImageBitmap"; | |
| 53 | 55 |
| 54 // Results returned by JS. | 56 // Results returned by JS. |
| 55 static const char kOK[] = "OK"; | 57 static const char kOK[] = "OK"; |
| 56 | 58 |
| 57 std::string GenerateGetUserMediaWithMandatorySourceID( | 59 std::string GenerateGetUserMediaWithMandatorySourceID( |
| 58 const std::string& function_name, | 60 const std::string& function_name, |
| 59 const std::string& audio_source_id, | 61 const std::string& audio_source_id, |
| 60 const std::string& video_source_id) { | 62 const std::string& video_source_id) { |
| 61 const std::string audio_constraint = | 63 const std::string audio_constraint = |
| 62 "audio: {mandatory: { sourceId:\"" + audio_source_id + "\"}}, "; | 64 "audio: {mandatory: { sourceId:\"" + audio_source_id + "\"}}, "; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 ASSERT_TRUE(embedded_test_server()->Start()); | 338 ASSERT_TRUE(embedded_test_server()->Start()); |
| 337 | 339 |
| 338 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 340 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 339 NavigateToURL(shell(), url); | 341 NavigateToURL(shell(), url); |
| 340 | 342 |
| 341 ExecuteJavascriptAndWaitForOk( | 343 ExecuteJavascriptAndWaitForOk( |
| 342 base::StringPrintf("%s({video: true});", | 344 base::StringPrintf("%s({video: true});", |
| 343 kRenderDuplicatedMediastreamAndStop)); | 345 kRenderDuplicatedMediastreamAndStop)); |
| 344 } | 346 } |
| 345 | 347 |
| 348 #if defined(OS_ANDROID) | |
| 349 // TODO(astojilj): Support 16bpp depth video capture on Android. | |
| 350 // This test assumes there is fake 16 bit depth capture device that is not | |
| 351 // yet enabled on Android. | |
|
mcasas
2016/10/21 00:10:50
TODO()s should have a https://crbug.com/123123 ass
aleksandar.stojiljkovic
2016/10/21 22:11:10
Done. Removed the special handling in fake_video_c
| |
| 352 #define MAYBE_GetDepthStreamAndCallCreateImageBitmap \ | |
| 353 DISABLED_GetDepthStreamAndCallCreateImageBitmap | |
| 354 #else | |
| 355 #define MAYBE_GetDepthStreamAndCallCreateImageBitmap \ | |
| 356 GetDepthStreamAndCallCreateImageBitmap | |
| 357 #endif | |
| 358 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | |
| 359 MAYBE_GetDepthStreamAndCallCreateImageBitmap) { | |
| 360 ASSERT_TRUE(embedded_test_server()->Start()); | |
| 361 | |
| 362 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | |
| 363 NavigateToURL(shell(), url); | |
| 364 | |
| 365 ExecuteJavascriptAndWaitForOk(base::StringPrintf( | |
| 366 "%s({video: true});", kGetDepthStreamAndCallCreateImageBitmap)); | |
| 367 } | |
| 368 | |
| 346 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, | 369 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, |
| 347 GetAudioAndVideoStreamAndStop) { | 370 GetAudioAndVideoStreamAndStop) { |
| 348 ASSERT_TRUE(embedded_test_server()->Start()); | 371 ASSERT_TRUE(embedded_test_server()->Start()); |
| 349 | 372 |
| 350 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); | 373 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); |
| 351 NavigateToURL(shell(), url); | 374 NavigateToURL(shell(), url); |
| 352 | 375 |
| 353 ExecuteJavascriptAndWaitForOk(base::StringPrintf( | 376 ExecuteJavascriptAndWaitForOk(base::StringPrintf( |
| 354 "%s({video: true, audio: true});", kGetUserMediaAndStop)); | 377 "%s({video: true, audio: true});", kGetUserMediaAndStop)); |
| 355 } | 378 } |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 764 base::Bind(&VerifyDisableLocalEcho, true)); | 787 base::Bind(&VerifyDisableLocalEcho, true)); |
| 765 call = GenerateGetUserMediaWithDisableLocalEcho( | 788 call = GenerateGetUserMediaWithDisableLocalEcho( |
| 766 "getUserMediaAndExpectSuccess", "true"); | 789 "getUserMediaAndExpectSuccess", "true"); |
| 767 ExecuteJavascriptAndWaitForOk(call); | 790 ExecuteJavascriptAndWaitForOk(call); |
| 768 | 791 |
| 769 manager->SetGenerateStreamCallbackForTesting( | 792 manager->SetGenerateStreamCallbackForTesting( |
| 770 MediaStreamManager::GenerateStreamTestCallback()); | 793 MediaStreamManager::GenerateStreamTestCallback()); |
| 771 } | 794 } |
| 772 | 795 |
| 773 } // namespace content | 796 } // namespace content |
| OLD | NEW |