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

Side by Side Diff: media/audio/android/audio_android_unittest.cc

Issue 509893002: Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/alsa/audio_manager_alsa.cc ('k') | media/audio/android/audio_manager_android.cc » ('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 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 "base/android/build_info.h" 5 #include "base/android/build_info.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 591
592 AudioParameters GetInputStreamParameters() { 592 AudioParameters GetInputStreamParameters() {
593 GetDefaultInputStreamParametersOnAudioThread(); 593 GetDefaultInputStreamParametersOnAudioThread();
594 594
595 // Override the platform effects setting to use the AudioRecord or OpenSLES 595 // Override the platform effects setting to use the AudioRecord or OpenSLES
596 // path as requested. 596 // path as requested.
597 int effects = GetParam() ? AudioParameters::ECHO_CANCELLER : 597 int effects = GetParam() ? AudioParameters::ECHO_CANCELLER :
598 AudioParameters::NO_EFFECTS; 598 AudioParameters::NO_EFFECTS;
599 AudioParameters params(audio_input_parameters().format(), 599 AudioParameters params(audio_input_parameters().format(),
600 audio_input_parameters().channel_layout(), 600 audio_input_parameters().channel_layout(),
601 audio_input_parameters().input_channels(),
601 audio_input_parameters().sample_rate(), 602 audio_input_parameters().sample_rate(),
602 audio_input_parameters().bits_per_sample(), 603 audio_input_parameters().bits_per_sample(),
603 audio_input_parameters().frames_per_buffer(), 604 audio_input_parameters().frames_per_buffer(),
604 effects); 605 effects);
605 return params; 606 return params;
606 } 607 }
607 608
608 void GetDefaultInputStreamParametersOnAudioThread() { 609 void GetDefaultInputStreamParametersOnAudioThread() {
609 RunOnAudioThread( 610 RunOnAudioThread(
610 base::Bind(&AudioAndroidInputTest::GetDefaultInputStreamParameters, 611 base::Bind(&AudioAndroidInputTest::GetDefaultInputStreamParameters,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 } 798 }
798 799
799 // Start input streaming using non default input parameters and ensure that the 800 // Start input streaming using non default input parameters and ensure that the
800 // callback sequence is sane. The only change we make in this test is to select 801 // callback sequence is sane. The only change we make in this test is to select
801 // a 10ms buffer size instead of the default size. 802 // a 10ms buffer size instead of the default size.
802 TEST_P(AudioAndroidInputTest, 803 TEST_P(AudioAndroidInputTest,
803 DISABLED_StartInputStreamCallbacksNonDefaultParameters) { 804 DISABLED_StartInputStreamCallbacksNonDefaultParameters) {
804 AudioParameters native_params = GetInputStreamParameters(); 805 AudioParameters native_params = GetInputStreamParameters();
805 AudioParameters params(native_params.format(), 806 AudioParameters params(native_params.format(),
806 native_params.channel_layout(), 807 native_params.channel_layout(),
808 native_params.input_channels(),
807 native_params.sample_rate(), 809 native_params.sample_rate(),
808 native_params.bits_per_sample(), 810 native_params.bits_per_sample(),
809 native_params.sample_rate() / 100, 811 native_params.sample_rate() / 100,
810 native_params.effects()); 812 native_params.effects());
811 StartInputStreamCallbacks(params); 813 StartInputStreamCallbacks(params);
812 } 814 }
813 815
814 // Start output streaming using default output parameters and ensure that the 816 // Start output streaming using default output parameters and ensure that the
815 // callback sequence is sane. 817 // callback sequence is sane.
816 TEST_F(AudioAndroidOutputTest, StartOutputStreamCallbacks) { 818 TEST_F(AudioAndroidOutputTest, StartOutputStreamCallbacks) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); 969 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
968 printf("\n"); 970 printf("\n");
969 StopAndCloseAudioOutputStreamOnAudioThread(); 971 StopAndCloseAudioOutputStreamOnAudioThread();
970 StopAndCloseAudioInputStreamOnAudioThread(); 972 StopAndCloseAudioInputStreamOnAudioThread();
971 } 973 }
972 974
973 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, 975 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest,
974 testing::ValuesIn(RunAudioRecordInputPathTests())); 976 testing::ValuesIn(RunAudioRecordInputPathTests()));
975 977
976 } // namespace media 978 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/alsa/audio_manager_alsa.cc ('k') | media/audio/android/audio_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698