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

Unified Diff: webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm

Issue 2886183002: Updated comments for unit tests to validate iOS audio session isInterrupted flag does not get reset… (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm
diff --git a/webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm b/webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm
index 82f4426482ad3f93ecdafe3600d1f3335a043d80..d7eed0f870aa5530a142e8b0e9954dc36b3f43d9 100644
--- a/webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm
+++ b/webrtc/modules/audio_device/ios/audio_device_unittest_ios.mm
@@ -825,6 +825,18 @@ TEST_F(AudioDeviceTest, DISABLED_MeasureLoopbackLatency) {
latency_audio_stream->PrintResults();
}
+// Verifies that the AudioDeviceIOS is_interrupted_ flag is reset correctly
tkchin_webrtc 2017/05/17 18:15:26 I think this needs some information about when Aud
+// after an iOS AVAudioSessionInterruptionTypeEnded notification event.
+// When AudioDeviceIOS is interrupted, is_interrupted_ is set to true.
+// When the audio device is stopped, the AudioDeviceIOS's
+// audio_session_observer_ is removed from RTCAudioSession's delegate list.
+// Then when the iOS AVAudioSessionInterruptionTypeEnded notification is
+// received by RTCAudioSession, RTCAudioSession can't propagate the event
+// back to AudioDeviceIOS as AudioDeviceIOS's audio_session_observer_ is no
+// longer in RTCAudioSession's delegate list.
+// The fix is to set AudioDeviceIOS's is_interrupted_ flag to RTCAudioSession's
+// isInterrupted flag when AudioDeviceIOS is initialized the next time audio
+// is to be started.
TEST_F(AudioDeviceTest, testInterruptedAudioSession) {
RTCAudioSession *session = [RTCAudioSession sharedInstance];
std::unique_ptr<webrtc::AudioDeviceIOS> audio_device;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698