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

Side by Side Diff: chrome/browser/media/chrome_webrtc_audio_quality_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <ctime> 5 #include <ctime>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 // audio device is up following the getUserMedia call in the left tab. The time 615 // audio device is up following the getUserMedia call in the left tab. The time
616 // it takes to negotiate a call isn't deterministic, but five seconds should be 616 // it takes to negotiate a call isn't deterministic, but five seconds should be
617 // plenty of time. Similarly, the recording time should be enough to catch the 617 // plenty of time. Similarly, the recording time should be enough to catch the
618 // whole reference file. If you then silence-trim the reference file and actual 618 // whole reference file. If you then silence-trim the reference file and actual
619 // file, you should end up with two time-synchronized files. 619 // file, you should end up with two time-synchronized files.
620 void MAYBE_WebRtcAudioQualityBrowserTest::SetupAndRecordAudioCall( 620 void MAYBE_WebRtcAudioQualityBrowserTest::SetupAndRecordAudioCall(
621 const base::FilePath& reference_file, 621 const base::FilePath& reference_file,
622 const base::FilePath& recording, 622 const base::FilePath& recording,
623 const std::string& constraints, 623 const std::string& constraints,
624 const base::TimeDelta recording_time) { 624 const base::TimeDelta recording_time) {
625 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 625 ASSERT_TRUE(embedded_test_server()->Start());
626 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); 626 ASSERT_TRUE(test::HasReferenceFilesInCheckout());
627 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); 627 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent());
628 628
629 ConfigureFakeDeviceToPlayFile(reference_file); 629 ConfigureFakeDeviceToPlayFile(reference_file);
630 630
631 // Create a two-way call. Mute one of the receivers though; that way it will 631 // Create a two-way call. Mute one of the receivers though; that way it will
632 // be receiving audio bytes, but we will not be playing out of both elements. 632 // be receiving audio bytes, but we will not be playing out of both elements.
633 GURL test_page = embedded_test_server()->GetURL(kWebRtcAudioTestHtmlPage); 633 GURL test_page = embedded_test_server()->GetURL(kWebRtcAudioTestHtmlPage);
634 content::WebContents* left_tab = 634 content::WebContents* left_tab =
635 OpenPageAndGetUserMediaInNewTabWithConstraints(test_page, constraints); 635 OpenPageAndGetUserMediaInNewTabWithConstraints(test_page, constraints);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 678 }
679 679
680 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, 680 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest,
681 MANUAL_TestCallQualityWithAudioFromWebAudio) { 681 MANUAL_TestCallQualityWithAudioFromWebAudio) {
682 if (OnWinXp() || OnWin8()) { 682 if (OnWinXp() || OnWin8()) {
683 // http://crbug.com/379798. 683 // http://crbug.com/379798.
684 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; 684 LOG(ERROR) << "This test is not implemented for Windows XP/Win8.";
685 return; 685 return;
686 } 686 }
687 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); 687 ASSERT_TRUE(test::HasReferenceFilesInCheckout());
688 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 688 ASSERT_TRUE(embedded_test_server()->Start());
689 689
690 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); 690 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent());
691 691
692 content::WebContents* left_tab = 692 content::WebContents* left_tab =
693 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage); 693 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage);
694 content::WebContents* right_tab = 694 content::WebContents* right_tab =
695 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage); 695 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage);
696 696
697 AddAudioFileToWebAudio(kReferenceFileRelativeUrl, left_tab); 697 AddAudioFileToWebAudio(kReferenceFileRelativeUrl, left_tab);
698 698
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 } 799 }
800 800
801 // Since the AGC is off here there should be no gain at all. 801 // Since the AGC is off here there should be no gain at all.
802 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, 802 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest,
803 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) { 803 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) {
804 const char* kAudioCallWithoutAudioProcessing = 804 const char* kAudioCallWithoutAudioProcessing =
805 "{audio: { mandatory: { echoCancellation: false } } }"; 805 "{audio: { mandatory: { echoCancellation: false } } }";
806 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( 806 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl(
807 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc")); 807 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc"));
808 } 808 }
OLDNEW
« no previous file with comments | « chrome/browser/media/chrome_media_stream_infobar_browsertest.cc ('k') | chrome/browser/media/chrome_webrtc_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698