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

Unified Diff: webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm

Issue 1782363002: Fix lock behavior on RTCAudioSession. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove autoreleasepool bits Created 4 years, 9 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/modules/audio_device/ios/objc/RTCAudioSession+Private.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm
diff --git a/webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm b/webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..ac065c7e3790acea8bc4487e422579504cecb9f3
--- /dev/null
+++ b/webrtc/modules/audio_device/ios/objc/RTCAudioSessionTest.mm
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2016 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 "testing/gtest/include/gtest/gtest.h"
+
+#import "webrtc/modules/audio_device/ios/objc/RTCAudioSession.h"
+
+@interface RTCAudioSessionTest : NSObject
+
+- (void)testLockForConfiguration;
+
+@end
+
+@implementation RTCAudioSessionTest
+
+- (void)testLockForConfiguration {
+ RTCAudioSession *session = [RTCAudioSession sharedInstance];
+
+ for (size_t i = 0; i < 2; i++) {
+ [session lockForConfiguration];
+ EXPECT_TRUE(session.isLocked);
+ }
+ for (size_t i = 0; i < 2; i++) {
+ EXPECT_TRUE(session.isLocked);
+ [session unlockForConfiguration];
+ }
+ EXPECT_FALSE(session.isLocked);
+}
+
+@end
+
+TEST(RTCAudioSessionTest, LockForConfiguration) {
+ RTCAudioSessionTest *test = [[RTCAudioSessionTest alloc] init];
+ [test testLockForConfiguration];
+}
« no previous file with comments | « webrtc/modules/audio_device/ios/objc/RTCAudioSession+Private.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698