Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: content/browser/webrtc/webrtc_getusermedia_browsertest.cc

Issue 2684233005: Revert of Use spec-compliant algorithm to select video devices in getUserMedia. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/media/media_stream_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 GetUserMediaWithInvalidMandatorySourceID) { 407 GetUserMediaWithInvalidMandatorySourceID) {
408 ASSERT_TRUE(embedded_test_server()->Start()); 408 ASSERT_TRUE(embedded_test_server()->Start());
409 409
410 std::vector<std::string> audio_ids; 410 std::vector<std::string> audio_ids;
411 std::vector<std::string> video_ids; 411 std::vector<std::string> video_ids;
412 GetInputDevices(&audio_ids, &video_ids); 412 GetInputDevices(&audio_ids, &video_ids);
413 413
414 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html")); 414 GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
415 415
416 // Test with invalid mandatory audio sourceID. 416 // Test with invalid mandatory audio sourceID.
417 // TODO(guidou): Update error string when spec-compliant constraint resolution
418 // for audio is implemented. See http://crbug.com/657733.
419 NavigateToURL(shell(), url); 417 NavigateToURL(shell(), url);
420 EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult( 418 EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult(
421 GenerateGetUserMediaWithMandatorySourceID( 419 GenerateGetUserMediaWithMandatorySourceID(
422 kGetUserMediaAndExpectFailure, 420 kGetUserMediaAndExpectFailure,
423 "something invalid", 421 "something invalid",
424 video_ids[0]))); 422 video_ids[0])));
425 423
426 // Test with invalid mandatory video sourceID. 424 // Test with invalid mandatory video sourceID.
427 EXPECT_EQ("ConstraintNotSatisfiedError",
428 ExecuteJavascriptAndReturnResult(
429 GenerateGetUserMediaWithMandatorySourceID(
430 kGetUserMediaAndExpectFailure, audio_ids[0],
431 "something invalid")));
432
433 // Test with empty mandatory audio sourceID.
434 // TODO(guidou): Update error string when spec-compliant constraint resolution
435 // for audio is implemented. See http://crbug.com/657733.
436 EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult( 425 EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult(
437 GenerateGetUserMediaWithMandatorySourceID( 426 GenerateGetUserMediaWithMandatorySourceID(
438 kGetUserMediaAndExpectFailure, 427 kGetUserMediaAndExpectFailure,
428 audio_ids[0],
429 "something invalid")));
430
431 // Test with empty mandatory audio sourceID.
432 EXPECT_EQ("DevicesNotFoundError", ExecuteJavascriptAndReturnResult(
433 GenerateGetUserMediaWithMandatorySourceID(
434 kGetUserMediaAndExpectFailure,
439 "", 435 "",
440 video_ids[0]))); 436 video_ids[0])));
441 } 437 }
442 438
443 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, 439 IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest,
444 GetUserMediaWithInvalidOptionalSourceID) { 440 GetUserMediaWithInvalidOptionalSourceID) {
445 ASSERT_TRUE(embedded_test_server()->Start()); 441 ASSERT_TRUE(embedded_test_server()->Start());
446 442
447 std::vector<std::string> audio_ids; 443 std::vector<std::string> audio_ids;
448 std::vector<std::string> video_ids; 444 std::vector<std::string> video_ids;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 base::Bind(&VerifyDisableLocalEcho, true)); 775 base::Bind(&VerifyDisableLocalEcho, true));
780 call = GenerateGetUserMediaWithDisableLocalEcho( 776 call = GenerateGetUserMediaWithDisableLocalEcho(
781 "getUserMediaAndExpectSuccess", "true"); 777 "getUserMediaAndExpectSuccess", "true");
782 ExecuteJavascriptAndWaitForOk(call); 778 ExecuteJavascriptAndWaitForOk(call);
783 779
784 manager->SetGenerateStreamCallbackForTesting( 780 manager->SetGenerateStreamCallbackForTesting(
785 MediaStreamManager::GenerateStreamTestCallback()); 781 MediaStreamManager::GenerateStreamTestCallback());
786 } 782 }
787 783
788 } // namespace content 784 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/media_stream_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698