| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |