| 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" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/process/launch.h" | 14 #include "base/process/launch.h" |
| 15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
| 16 #include "base/scoped_native_library.h" | 16 #include "base/scoped_native_library.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/threading/thread_restrictions.h" |
| 21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 22 #include "chrome/browser/media/webrtc/webrtc_browsertest_audio.h" | 23 #include "chrome/browser/media/webrtc/webrtc_browsertest_audio.h" |
| 23 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" | 24 #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" |
| 24 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" | 25 #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/browser/ui/browser_tabstrip.h" | 28 #include "chrome/browser/ui/browser_tabstrip.h" |
| 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 29 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( | 675 ASSERT_NO_FATAL_FAILURE(SetupAndRecordAudioCall( |
| 675 reference_file, recording, constraints, | 676 reference_file, recording, constraints, |
| 676 base::TimeDelta::FromSeconds(30))); | 677 base::TimeDelta::FromSeconds(30))); |
| 677 | 678 |
| 678 ComputeAndPrintPesqResults(reference_file, recording, perf_modifier); | 679 ComputeAndPrintPesqResults(reference_file, recording, perf_modifier); |
| 679 DeleteFileUnlessTestFailed(recording, false); | 680 DeleteFileUnlessTestFailed(recording, false); |
| 680 } | 681 } |
| 681 | 682 |
| 682 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 683 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 683 MANUAL_TestCallQualityWithAudioFromFakeDevice) { | 684 MANUAL_TestCallQualityWithAudioFromFakeDevice) { |
| 685 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 684 TestWithFakeDeviceGetUserMedia(kAudioOnlyCallConstraints, "_getusermedia"); | 686 TestWithFakeDeviceGetUserMedia(kAudioOnlyCallConstraints, "_getusermedia"); |
| 685 } | 687 } |
| 686 | 688 |
| 687 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 689 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 688 MANUAL_TestCallQualityWithAudioFromWebAudio) { | 690 MANUAL_TestCallQualityWithAudioFromWebAudio) { |
| 691 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 689 if (OnWin8()) { | 692 if (OnWin8()) { |
| 690 // http://crbug.com/379798. | 693 // http://crbug.com/379798. |
| 691 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; | 694 LOG(ERROR) << "This test is not implemented for Windows XP/Win8."; |
| 692 return; | 695 return; |
| 693 } | 696 } |
| 694 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); | 697 ASSERT_TRUE(test::HasReferenceFilesInCheckout()); |
| 695 ASSERT_TRUE(embedded_test_server()->Start()); | 698 ASSERT_TRUE(embedded_test_server()->Start()); |
| 696 | 699 |
| 697 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); | 700 ASSERT_TRUE(ForceMicrophoneVolumeTo100Percent()); |
| 698 | 701 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 AnalyzeSegmentsAndPrintResult( | 797 AnalyzeSegmentsAndPrintResult( |
| 795 ref_segments, actual_segments, reference_file, perf_modifier); | 798 ref_segments, actual_segments, reference_file, perf_modifier); |
| 796 | 799 |
| 797 DeleteFileUnlessTestFailed(recording, false); | 800 DeleteFileUnlessTestFailed(recording, false); |
| 798 DeleteFileUnlessTestFailed(actual_files_dir, true); | 801 DeleteFileUnlessTestFailed(actual_files_dir, true); |
| 799 } | 802 } |
| 800 | 803 |
| 801 // The AGC should apply non-zero gain here. | 804 // The AGC should apply non-zero gain here. |
| 802 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 805 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 803 MANUAL_TestAutoGainControlOnLowAudio) { | 806 MANUAL_TestAutoGainControlOnLowAudio) { |
| 807 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 804 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( | 808 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( |
| 805 kReferenceFile, kAudioOnlyCallConstraints, "_with_agc")); | 809 kReferenceFile, kAudioOnlyCallConstraints, "_with_agc")); |
| 806 } | 810 } |
| 807 | 811 |
| 808 // 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. |
| 809 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, | 813 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcAudioQualityBrowserTest, |
| 810 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) { | 814 MANUAL_TestAutoGainIsOffWithAudioProcessingOff) { |
| 815 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 811 const char* kAudioCallWithoutAudioProcessing = | 816 const char* kAudioCallWithoutAudioProcessing = |
| 812 "{audio: { mandatory: { echoCancellation: false } } }"; | 817 "{audio: { mandatory: { echoCancellation: false } } }"; |
| 813 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( | 818 ASSERT_NO_FATAL_FAILURE(TestAutoGainControl( |
| 814 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc")); | 819 kReferenceFile, kAudioCallWithoutAudioProcessing, "_no_agc")); |
| 815 } | 820 } |
| OLD | NEW |