| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <ctime> | 7 #include <ctime> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 | 655 |
| 656 ASSERT_TRUE(recorder.WaitForRecordingToEnd()); | 656 ASSERT_TRUE(recorder.WaitForRecordingToEnd()); |
| 657 DVLOG(0) << "Done recording to " << recording.value() << std::endl; | 657 DVLOG(0) << "Done recording to " << recording.value() << std::endl; |
| 658 | 658 |
| 659 HangUp(left_tab); | 659 HangUp(left_tab); |
| 660 } | 660 } |
| 661 | 661 |
| 662 void MAYBE_WebRtcAudioQualityBrowserTest::TestWithFakeDeviceGetUserMedia( | 662 void MAYBE_WebRtcAudioQualityBrowserTest::TestWithFakeDeviceGetUserMedia( |
| 663 const std::string& constraints, | 663 const std::string& constraints, |
| 664 const std::string& perf_modifier) { | 664 const std::string& perf_modifier) { |
| 665 if (OnWin8()) { | 665 if (OnWin8OrHigher()) { |
| 666 // http://crbug.com/379798. | 666 // http://crbug.com/379798. |
| 667 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; | 667 LOG(ERROR) << "This test is not implemented for Win8 or higher."; |
| 668 return; | 668 return; |
| 669 } | 669 } |
| 670 | 670 |
| 671 base::FilePath reference_file = | 671 base::FilePath reference_file = |
| 672 test::GetReferenceFilesDir().Append(kReferenceFile); | 672 test::GetReferenceFilesDir().Append(kReferenceFile); |
| 673 base::FilePath recording = CreateTemporaryWaveFile(); | 673 base::FilePath recording = CreateTemporaryWaveFile(); |
| 674 | 674 |
| 675 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( | 675 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( |
| 676 reference_file, recording, constraints, | 676 reference_file, recording, constraints, |
| 677 base::TimeDelta::FromSeconds(30))); | 677 base::TimeDelta::FromSeconds(30))); |
| 678 | 678 |
| 679 ComputeAndPrintPesqResults(reference_file, recording, perf_modifier); | 679 ComputeAndPrintPesqResults(reference_file, recording, perf_modifier); |
| 680 DeleteFileUnlessTestFailed(recording, false); | 680 DeleteFileUnlessTestFailed(recording, false); |
| 681 } | 681 } |
| 682 | 682 |
| 683 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 683 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 684 MANUAL_TestCallQualityWithAudioFromFakeDevice) { | 684 MANUAL_TestCallQualityWithAudioFromFakeDevice) { |
| 685 base::ThreadRestrictions::ScopedAllowIO allow_io; | 685 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 686 TestWithFakeDeviceGetUserMedia(kAudioOnlyCallConstraints, "_getusermedia"); | 686 TestWithFakeDeviceGetUserMedia(kAudioOnlyCallConstraints, "_getusermedia"); |
| 687 } | 687 } |
| 688 | 688 |
| 689 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 689 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 690 MANUAL_TestCallQualityWithAudioFromWebAudio) { | 690 MANUAL_TestCallQualityWithAudioFromWebAudio) { |
| 691 base::ThreadRestrictions::ScopedAllowIO allow_io; | 691 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 692 if (OnWin8()) { | 692 if (OnWin8OrHigher()) { |
| 693 // http://crbug.com/379798. | 693 // http://crbug.com/379798. |
| 694 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; | 694 LOG(ERROR) << "This test is not implemented for Win8 or higher."; |
| 695 return; | 695 return; |
| 696 } | 696 } |
| 697 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); | 697 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); |
| 698 ASSERT_TRUE(embedded_test_server()->Start()); | 698 ASSERT_TRUE(embedded_test_server()->Start()); |
| 699 | 699 |
| 700 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); | 700 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); |
| 701 | 701 |
| 702 content::WebContents* left_tab = | 702 content::WebContents* left_tab = |
| 703 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage); | 703 OpenPageWithoutGetUserMedia(kWebRtcAudioTestHtmlPage); |
| 704 content::WebContents* right_tab = | 704 content::WebContents* right_tab = |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 * The test only exercises digital AGC for now. | 757 * The test only exercises digital AGC for now. |
| 758 * | 758 * |
| 759 * We record in CD format here (44.1 kHz) because that's what the fake input | 759 * We record in CD format here (44.1 kHz) because that's what the fake input |
| 760 * device currently supports, and we want to be able to compare directly. See | 760 * device currently supports, and we want to be able to compare directly. See |
| 761 * http://crbug.com/421054. | 761 * http://crbug.com/421054. |
| 762 */ | 762 */ |
| 763 void MAYBE_WebRtcAudioQualityBrowserTest::TestAutoGainControl( | 763 void MAYBE_WebRtcAudioQualityBrowserTest::TestAutoGainControl( |
| 764 const base::FilePath::StringType& reference_filename, | 764 const base::FilePath::StringType& reference_filename, |
| 765 const std::string& constraints, | 765 const std::string& constraints, |
| 766 const std::string& perf_modifier) { | 766 const std::string& perf_modifier) { |
| 767 if (OnWin8()) { | 767 if (OnWin8OrHigher()) { |
| 768 // http://crbug.com/379798. | 768 // http://crbug.com/379798. |
| 769 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; | 769 LOG(ERROR) << "This test is not implemented for Win8 or higher."; |
| 770 return; | 770 return; |
| 771 } | 771 } |
| 772 base::FilePath reference_file = | 772 base::FilePath reference_file = |
| 773 test::GetReferenceFilesDir().Append(reference_filename); | 773 test::GetReferenceFilesDir().Append(reference_filename); |
| 774 base::FilePath recording = CreateTemporaryWaveFile(); | 774 base::FilePath recording = CreateTemporaryWaveFile(); |
| 775 | 775 |
| 776 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( | 776 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( |
| 777 reference_file, recording, constraints, | 777 reference_file, recording, constraints, |
| 778 base::TimeDelta::FromSeconds(30))); | 778 base::TimeDelta::FromSeconds(30))); |
| 779 | 779 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 811 |
| 812 // Since the AGC is off here there should be no gain at all. | 812 // Since the AGC is off here there should be no gain at all. |
| 813 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 813 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 814 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) { | 814 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) { |
| 815 base::ThreadRestrictions::ScopedAllowIO allow_io; | 815 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 816 const char* kAudioCallWithoutAudioProcessing = | 816 const char* kAudioCallWithoutAudioProcessing = |
| 817 "{audio: { mandatory: { echoCancellation: false } } }"; | 817 "{audio: { mandatory: { echoCancellation: false } } }"; |
| 818 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( | 818 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( |
| 819 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc")); | 819 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc")); |
| 820 } | 820 } |
| OLD | NEW |