Chromium Code Reviews| Index: webrtc/sdk/objc/Framework/UnitTests/RTCAudioSessionTest.mm |
| diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCAudioSessionTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCAudioSessionTest.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..802342fb46a07b0386ad273bcf1bc4880823cb7e |
| --- /dev/null |
| +++ b/webrtc/sdk/objc/Framework/UnitTests/RTCAudioSessionTest.mm |
| @@ -0,0 +1,46 @@ |
| +/* |
| + * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#import <Foundation/Foundation.h> |
| + |
| +#include <vector> |
| + |
| +#include "webrtc/base/gunit.h" |
| + |
| +#import "NSString+StdString.h" |
| +#import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h" |
| +#import "webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h" |
| +#import "webrtc/modules/audio_device/ios/objc/RTCAudioSessionConfiguration.h" |
| + |
| +@interface RTCAudioSessionTest : NSObject |
| +- (void)testAudioSessionActivation; |
| +@end |
| + |
| +@implementation RTCAudioSessionTest |
| + |
|
tkchin_webrtc
2017/04/13 20:17:30
it'd be nice to have a unit test here that capture
|
| +- (void)testAudioSessionActivation { |
| + RTCAudioSession *audioSession = [RTCAudioSession sharedInstance]; |
| + EXPECT_EQ(0, audioSession.activationCount); |
| + [audioSession audioSessionDidActivate:[AVAudioSession sharedInstance]]; |
| + EXPECT_EQ(1, audioSession.activationCount); |
| + [audioSession audioSessionDidDeactivate:[AVAudioSession sharedInstance]]; |
| + EXPECT_EQ(0, audioSession.activationCount); |
| +} |
| + |
| +@end |
| + |
| +TEST(RTCAudioSessionTest, ConfigurationGetterTest) { |
| + @autoreleasepool { |
| + RTCAudioSessionTest *test = [[RTCAudioSessionTest alloc] init]; |
| + [test testAudioSessionActivation]; |
| + } |
| +} |
| + |
| + |