Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #import <Foundation/Foundation.h> | |
| 12 | |
| 13 #include <vector> | |
| 14 | |
| 15 #include "webrtc/base/gunit.h" | |
| 16 | |
| 17 #import "NSString+StdString.h" | |
| 18 #import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h" | |
| 19 #import "webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h" | |
| 20 #import "webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.h" | |
| 21 | |
| 22 @interface RTCAudioSessionTest : NSObject | |
| 23 - (void)testAudioSessionActivation; | |
| 24 @end | |
| 25 | |
| 26 @implementation RTCAudioSessionTest | |
| 27 | |
|
tkchin_webrtc
2017/04/13 20:17:30
it'd be nice to have a unit test here that capture
| |
| 28 - (void)testAudioSessionActivation { | |
| 29 RTCAudioSession *audioSession = [RTCAudioSession sharedInstance]; | |
| 30 EXPECT_EQ(0, audioSession.activationCount); | |
| 31 [audioSession audioSessionDidActivate:[AVAudioSession sharedInstance]]; | |
| 32 EXPECT_EQ(1, audioSession.activationCount); | |
| 33 [audioSession audioSessionDidDeactivate:[AVAudioSession sharedInstance]]; | |
| 34 EXPECT_EQ(0, audioSession.activationCount); | |
| 35 } | |
| 36 | |
| 37 @end | |
| 38 | |
| 39 TEST(RTCAudioSessionTest, ConfigurationGetterTest) { | |
| 40 @autoreleasepool { | |
| 41 RTCAudioSessionTest *test = [[RTCAudioSessionTest alloc] init]; | |
| 42 [test testAudioSessionActivation]; | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 | |
| OLD | NEW |