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/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/aligned_memory.h" | 8 #include "base/memory/aligned_memory.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 EXPECT_EQ(processed_data->channel(0)[0], 0); | 485 EXPECT_EQ(processed_data->channel(0)[0], 0); |
486 EXPECT_NE(processed_data->channel(1)[0], 0); | 486 EXPECT_NE(processed_data->channel(1)[0], 0); |
487 EXPECT_EQ(pushed_capture_delay, capture_delay); | 487 EXPECT_EQ(pushed_capture_delay, capture_delay); |
488 } | 488 } |
489 | 489 |
490 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives | 490 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives |
491 // |audio_processor|. | 491 // |audio_processor|. |
492 audio_processor = NULL; | 492 audio_processor = NULL; |
493 } | 493 } |
494 | 494 |
495 TEST_F(MediaStreamAudioProcessorTest, TestWithKeyboardMicChannel) { | 495 // Disabled on android clang builds due to crbug.com/470499 |
| 496 #if defined(__clang__) && defined(OS_ANDROID) |
| 497 #define MAYBE_TestWithKeyboardMicChannel DISABLED_TestWithKeyboardMicChannel |
| 498 #else |
| 499 #define MAYBE_TestWithKeyboardMicChannel TestWithKeyboardMicChannel |
| 500 #endif |
| 501 |
| 502 TEST_F(MediaStreamAudioProcessorTest, MAYBE_TestWithKeyboardMicChannel) { |
496 MockMediaConstraintFactory constraint_factory; | 503 MockMediaConstraintFactory constraint_factory; |
497 constraint_factory.AddMandatory( | 504 constraint_factory.AddMandatory( |
498 MediaAudioConstraints::kGoogExperimentalNoiseSuppression, true); | 505 MediaAudioConstraints::kGoogExperimentalNoiseSuppression, true); |
499 scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( | 506 scoped_refptr<WebRtcAudioDeviceImpl> webrtc_audio_device( |
500 new WebRtcAudioDeviceImpl()); | 507 new WebRtcAudioDeviceImpl()); |
501 scoped_refptr<MediaStreamAudioProcessor> audio_processor( | 508 scoped_refptr<MediaStreamAudioProcessor> audio_processor( |
502 new rtc::RefCountedObject<MediaStreamAudioProcessor>( | 509 new rtc::RefCountedObject<MediaStreamAudioProcessor>( |
503 constraint_factory.CreateWebMediaConstraints(), 0, | 510 constraint_factory.CreateWebMediaConstraints(), 0, |
504 webrtc_audio_device.get())); | 511 webrtc_audio_device.get())); |
505 EXPECT_TRUE(audio_processor->has_audio_processing()); | 512 EXPECT_TRUE(audio_processor->has_audio_processing()); |
506 | 513 |
507 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 514 media::AudioParameters params(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
508 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC, | 515 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC, |
509 48000, 16, 512); | 516 48000, 16, 512); |
510 audio_processor->OnCaptureFormatChanged(params); | 517 audio_processor->OnCaptureFormatChanged(params); |
511 | 518 |
512 ProcessDataAndVerifyFormat(audio_processor.get(), | 519 ProcessDataAndVerifyFormat(audio_processor.get(), |
513 kAudioProcessingSampleRate, | 520 kAudioProcessingSampleRate, |
514 kAudioProcessingNumberOfChannel, | 521 kAudioProcessingNumberOfChannel, |
515 kAudioProcessingSampleRate / 100); | 522 kAudioProcessingSampleRate / 100); |
516 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives | 523 // Set |audio_processor| to NULL to make sure |webrtc_audio_device| outlives |
517 // |audio_processor|. | 524 // |audio_processor|. |
518 audio_processor = NULL; | 525 audio_processor = NULL; |
519 } | 526 } |
520 | 527 |
521 } // namespace content | 528 } // namespace content |
OLD | NEW |