Reland "Replace RecursiveCriticalSection with Mutex in RTCAudioSession."
This is a reland of f8da43d179043f1df2e1c3e2c49494bc23f4ec28 Original change's description: > Replace RecursiveCriticalSection with Mutex in RTCAudioSession. > > Bug: webrtc:11567 > Change-Id: I2a2ddbce57d070d6cbad5a64defb4c27be77a665 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206472 > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Reviewed-by: Kári Helgason <kthelgason@webrtc.org> > Commit-Queue: Niels Moller <nisse@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#33259} Bug: webrtc:11567 Change-Id: I4f7235dd164d8f698fe0bedea8c5dca50849f6d3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207432 Reviewed-by: Markus Handell <handellm@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33302}
This commit is contained in:
@ -113,26 +113,10 @@
|
||||
|
||||
@interface RTCAudioSessionTest : NSObject
|
||||
|
||||
- (void)testLockForConfiguration;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RTCAudioSessionTest
|
||||
|
||||
- (void)testLockForConfiguration {
|
||||
RTC_OBJC_TYPE(RTCAudioSession) *session = [RTC_OBJC_TYPE(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);
|
||||
}
|
||||
|
||||
- (void)testAddAndRemoveDelegates {
|
||||
RTC_OBJC_TYPE(RTCAudioSession) *session = [RTC_OBJC_TYPE(RTCAudioSession) sharedInstance];
|
||||
NSMutableArray *delegates = [NSMutableArray array];
|
||||
@ -264,7 +248,6 @@ OCMLocation *OCMMakeLocation(id testCase, const char *fileCString, int line){
|
||||
RTC_OBJC_TYPE(RTCAudioSession) *audioSession = mockAudioSession;
|
||||
EXPECT_EQ(0, audioSession.activationCount);
|
||||
[audioSession lockForConfiguration];
|
||||
EXPECT_TRUE([audioSession checkLock:nil]);
|
||||
// configureWebRTCSession is forced to fail in the above mock interface,
|
||||
// so activationCount should remain 0
|
||||
OCMExpect([[mockAVAudioSession ignoringNonObjectArgs] setActive:YES
|
||||
@ -316,11 +299,6 @@ class AudioSessionTest : public ::testing::Test {
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(AudioSessionTest, LockForConfiguration) {
|
||||
RTCAudioSessionTest *test = [[RTCAudioSessionTest alloc] init];
|
||||
[test testLockForConfiguration];
|
||||
}
|
||||
|
||||
TEST_F(AudioSessionTest, AddAndRemoveDelegates) {
|
||||
RTCAudioSessionTest *test = [[RTCAudioSessionTest alloc] init];
|
||||
[test testAddAndRemoveDelegates];
|
||||
|
||||
Reference in New Issue
Block a user