Add injectable URL opener and unit tests for OIDExternalUserAgentIOSCustomBrowser by w-goog · Pull Request #984 · openid/AppAuth-iOS · GitHub
Skip to content

Add injectable URL opener and unit tests for OIDExternalUserAgentIOSCustomBrowser - #984

Open
w-goog wants to merge 2 commits into
masterfrom
codegen/pr981-url-opener-seam
Open

w-goog wants to merge 2 commits into
masterfrom
codegen/pr981-url-opener-seam

Conversation

@w-goog

@w-goog w-goog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #981.

OIDExternalUserAgentIOSCustomBrowser called UIApplication.sharedApplication directly, so -presentExternalUserAgentRequest:session: was untestable. (The iOS unit test target has no host app, so the completion handler will never fire)

Functional-programming-enjoyer added DI so that the behaviour in #981 is testable:

  • OIDExternalUserAgentIOSCustomBrowserURLOpener, a two-method protocol to which UIApplication can conform.
  • A URLOpener property and a new designated initializer initWithURLTransformation:canOpenURLScheme:appStoreURL:URLOpener:.
  • UnitTests/OIDExternalUserAgentIOSCustomBrowserTests.m (iOS only):

@w-goog
w-goog requested a review from camden-king October 20, 2026 23:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant