rtc::Event: Finalize migration to TimeDelta.

Bug: webrtc:14366
Change-Id: Icd8792a2f9efa5609dd13da2e175042fac101d36
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272101
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Auto-Submit: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37844}
This commit is contained in:
Markus Handell
2022-08-19 12:42:31 +00:00
committed by WebRTC LUCI CQ
parent 99d7d6b4f6
commit 0cd0dd3b07
7 changed files with 41 additions and 61 deletions

View File

@ -287,15 +287,15 @@ OCMLocation *OCMMakeLocation(id testCase, const char *fileCString, int line){
rtc::Event waitLock;
rtc::Event waitCleanup;
constexpr int timeoutMs = 5000;
thread->PostTask([audioSession, &waitLock, &waitCleanup] {
constexpr webrtc::TimeDelta timeout = webrtc::TimeDelta::Seconds(5);
thread->PostTask([audioSession, &waitLock, &waitCleanup, timeout] {
[audioSession lockForConfiguration];
waitLock.Set();
waitCleanup.Wait(timeoutMs);
waitCleanup.Wait(timeout);
[audioSession unlockForConfiguration];
});
waitLock.Wait(timeoutMs);
waitLock.Wait(timeout);
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:0 error:&error];
EXPECT_TRUE(error != nil);
EXPECT_EQ(error.domain, kRTCAudioSessionErrorDomain);