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

Unified Diff: webrtc/sdk/objc/Framework/UnitTests/RTCAudioSessionTest.mm

Issue 2813493004: Added audioSessionDidActivate and audioSessionDidDectivate (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/external/webrtc into activeCount Created 3 years, 8 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 | « webrtc/sdk/objc/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
+ }
+}
+
+
« no previous file with comments | « webrtc/sdk/objc/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698