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 "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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 double average_time_between_callbacks_ms = | 517 double average_time_between_callbacks_ms = |
518 AverageTimeBetweenCallbacks(num_callbacks); | 518 AverageTimeBetweenCallbacks(num_callbacks); |
519 VLOG(0) << "expected time between callbacks: " | 519 VLOG(0) << "expected time between callbacks: " |
520 << expected_time_between_callbacks_ms << " ms"; | 520 << expected_time_between_callbacks_ms << " ms"; |
521 VLOG(0) << "average time between callbacks: " | 521 VLOG(0) << "average time between callbacks: " |
522 << average_time_between_callbacks_ms << " ms"; | 522 << average_time_between_callbacks_ms << " ms"; |
523 EXPECT_GE(average_time_between_callbacks_ms, | 523 EXPECT_GE(average_time_between_callbacks_ms, |
524 0.70 * expected_time_between_callbacks_ms); | 524 0.70 * expected_time_between_callbacks_ms); |
525 EXPECT_LE(average_time_between_callbacks_ms, | 525 EXPECT_LE(average_time_between_callbacks_ms, |
526 1.30 * expected_time_between_callbacks_ms); | 526 1.35 * expected_time_between_callbacks_ms); |
527 } | 527 } |
528 | 528 |
529 void GetDefaultOutputStreamParameters() { | 529 void GetDefaultOutputStreamParameters() { |
530 DCHECK(audio_manager()->GetTaskRunner()->BelongsToCurrentThread()); | 530 DCHECK(audio_manager()->GetTaskRunner()->BelongsToCurrentThread()); |
531 audio_output_parameters_ = | 531 audio_output_parameters_ = |
532 audio_manager()->GetDefaultOutputStreamParameters(); | 532 audio_manager()->GetDefaultOutputStreamParameters(); |
533 EXPECT_TRUE(audio_output_parameters_.IsValid()); | 533 EXPECT_TRUE(audio_output_parameters_.IsValid()); |
534 } | 534 } |
535 | 535 |
536 void MakeOutputStream(const AudioParameters& params) { | 536 void MakeOutputStream(const AudioParameters& params) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); | 979 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
980 printf("\n"); | 980 printf("\n"); |
981 StopAndCloseAudioOutputStreamOnAudioThread(); | 981 StopAndCloseAudioOutputStreamOnAudioThread(); |
982 StopAndCloseAudioInputStreamOnAudioThread(); | 982 StopAndCloseAudioInputStreamOnAudioThread(); |
983 } | 983 } |
984 | 984 |
985 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, | 985 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, |
986 testing::ValuesIn(RunAudioRecordInputPathTests())); | 986 testing::ValuesIn(RunAudioRecordInputPathTests())); |
987 | 987 |
988 } // namespace media | 988 } // namespace media |
OLD | NEW |