Skip to content

Inject the device and LAContext into GIDEMMSupport and GIDMDMPasscodeCache - #659

Open
w-goog wants to merge 4 commits into
mainfrom
codegen/ocmock-02-device-lacontext-seams
Open

w-goog wants to merge 4 commits into
mainfrom
codegen/ocmock-02-device-lacontext-seams

Conversation

@w-goog

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

Copy link
Copy Markdown
Contributor

Second of the OCMock removal stack, on top of #658. This one removes the UIDevice.systemName and LAContext swizzles (and the MDM test's iOS 9 guards).

  • GIDEMMSupport gets the device dep it needs. The class methods stay and delegate.
  • GIDMDMPasscodeCache gets LAContext through the initializer (yay for DI).
  • UIDevice and LAContext each get a protocol + a fake for the tests to use.

@w-goog
w-goog requested a review from mingyokim October 21, 2026 00:57
@w-goog
w-goog force-pushed the codegen/ocmock-02-device-lacontext-seams branch from eac9534 to 39a9801 Compare October 21, 2026 22:03
Base automatically changed from codegen/ocmock-01-bundle-seam to main October 21, 2026 22:37
@w-goog
w-goog force-pushed the codegen/ocmock-02-device-lacontext-seams branch from 39a9801 to c7207b1 Compare October 23, 2026 23:21
Comment on lines +25 to +26
#import "GoogleSignIn/Sources/GIDDevice/API/GIDDevice.h"
#import "GoogleSignIn/Sources/GIDEMMErrorHandler.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do these need to be imported or can we use forward declaration? i.e. @class GIDEMMErrorHandler and @protocol GIDDevice


#import <Foundation/Foundation.h>

#import "GoogleSignIn/Sources/GIDLocalAuthentication/API/GIDLocalAuthenticationContext.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we use forward declaration here?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay for Fake files to live in Sources/**/Fake/*? Ideally these Fake files are not included in production targets and only included in test targets - please let me know if that is already the case.

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.

2 participants