Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth Unit Test Fixes #14223

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ import Foundation
)
}

return try await withCheckedThrowingContinuation { continuation in
return try await withUnsafeThrowingContinuation { continuation in
paulb777 marked this conversation as resolved.
Show resolved Hide resolved
self.auth.authURLPresenter.present(url,
uiDelegate: uiDelegate,
callbackMatcher: callbackMatcher) { callbackURL, error in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}

func getToken() async throws -> AuthAPNSToken {
return try await withCheckedThrowingContinuation { continuation in
return try await withUnsafeThrowingContinuation { continuation in
self.getTokenInternal { result in
switch result {
case let .success(token):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

func didStartVerification(withReceipt receipt: String,
timeout: TimeInterval) async -> AuthAppCredential {
return await withCheckedContinuation { continuation in
return await withUnsafeContinuation { continuation in
self.didStartVerificationInternal(withReceipt: receipt, timeout: timeout) { credential in
continuation.resume(returning: credential)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

func checkNotificationForwarding() async -> Bool {
return await withCheckedContinuation { continuation in
return await withUnsafeContinuation { continuation in
checkNotificationForwardingInternal { value in
continuation.resume(returning: value)
}
Expand Down
18 changes: 9 additions & 9 deletions FirebaseAuth/Tests/Unit/AuthBackendTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AuthBackendTests: RPCBaseTests {
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
let responseError = NSError(domain: self.kFakeErrorDomain, code: self.kFakeErrorCode)
try self.rpcIssuer.respond(withData: nil, error: responseError)
return (nil, responseError)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -122,7 +122,7 @@ class AuthBackendTests: RPCBaseTests {
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
let responseError = NSError(domain: self.kFakeErrorDomain, code: self.kFakeErrorCode)
try self.rpcIssuer.respond(withData: data, error: responseError)
return (data, error: responseError)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -159,7 +159,7 @@ class AuthBackendTests: RPCBaseTests {
let data = "<xml>Some non-JSON value.</xml>".data(using: .utf8)
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
try self.rpcIssuer.respond(withData: data, error: nil)
(data, nil)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -201,7 +201,7 @@ class AuthBackendTests: RPCBaseTests {
let responseError = NSError(domain: kFakeErrorDomain, code: kFakeErrorCode)
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
try self.rpcIssuer.respond(withData: data, error: responseError)
(data, responseError)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -243,7 +243,7 @@ class AuthBackendTests: RPCBaseTests {
let data = "[]".data(using: .utf8)
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
try self.rpcIssuer.respond(withData: data, error: nil)
(data, nil)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -277,8 +277,8 @@ class AuthBackendTests: RPCBaseTests {
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
let responseError = NSError(domain: self.kFakeErrorDomain, code: self.kFakeErrorCode)
try self.rpcIssuer.respond(serverErrorMessage: kErrorMessageCaptchaRequired,
error: responseError)
return try self.rpcIssuer.respond(serverErrorMessage: kErrorMessageCaptchaRequired,
error: responseError)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down Expand Up @@ -317,7 +317,7 @@ class AuthBackendTests: RPCBaseTests {
let request = FakeRequest(withRequestBody: [:])
rpcIssuer.respondBlock = {
let responseError = NSError(domain: self.kFakeErrorDomain, code: self.kFakeErrorCode)
try self.rpcIssuer.respond(
return try self.rpcIssuer.respond(
serverErrorMessage: kErrorMessageCaptchaCheckFailed,
error: responseError
)
Expand Down Expand Up @@ -427,7 +427,7 @@ class AuthBackendTests: RPCBaseTests {
let request = FakeRequest(withRequestBody: [:])
let responseError = NSError(domain: kFakeErrorDomain, code: kFakeErrorCode)
rpcIssuer.respondBlock = {
let _ = try self.rpcIssuer.respond(withJSON: [:], error: responseError)
try self.rpcIssuer.respond(withJSON: [:], error: responseError)
}
do {
let _ = try await authBackend.call(with: request)
Expand Down
Loading
Loading