-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
90 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
Tests/UID2GMAPluginTests/TestExtensions/GADRTBAdapter+TestExtensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// GADRTBAdapter.swift | ||
// | ||
|
||
import GoogleMobileAds | ||
|
||
/// Adds an async wrapper interface to simplify testing | ||
extension GADRTBAdapter { | ||
func collectSignals(for params: GADRTBRequestParameters) async throws -> String? { | ||
try await withCheckedThrowingContinuation { continuation in | ||
collectSignals(for: params, completionHandler: { signal, error in | ||
guard error == nil else { | ||
continuation.resume(throwing: error!) | ||
return | ||
} | ||
continuation.resume(returning: signal) | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters