Skip to content

Commit

Permalink
Improve style.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-4-Git committed Jan 20, 2023
1 parent 7e76eae commit df7f780
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
/// The block type providing the response for the method `startWithOptions:emmSupport:completion:`.
///
/// @param authorizationResponse The `OIDAuthorizationResponse` object returned on success.
/// @param error The error returned on failure.
/// @param error An `NSError` returned on failure.
typedef void(^GIDAuthorizationFlowProcessorFakeResponseProviderBlock)
(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ - (BOOL)isStarted {
}

- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)url {
NSAssert(NO, @"Not implemented.");
return YES;
}

Expand Down
13 changes: 8 additions & 5 deletions GoogleSignIn/Tests/Unit/GIDSignInTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@
static NSString * const kFakeUserFamilyName = @"username";
static NSString * const kFakeUserPictureURL = @"fake_user_picture_url";

static NSString * const kContinueURL = @"com.google.UnitTests:/oauth2callback";
static NSString * const kContinueURLWithClientID = @"FakeClientID:/oauth2callback";
static NSString * const kWrongSchemeURL = @"wrong.app:/oauth2callback";
static NSString * const kRightPathURL = @"com.google.UnitTests:/oauth2callback";
static NSString * const kWrongPathURL = @"com.google.UnitTests:/wrong_path";

static NSString * const kEMMRestartAuthURL =
Expand Down Expand Up @@ -572,6 +570,11 @@ - (void)testSignOut {
XCTAssertNil([_keychainHandler loadAuthState]);
}

- (void)testHandleRightPath {
XCTAssertTrue([_signIn handleURL:[NSURL URLWithString:kRightPathURL]]);
XCTAssertFalse(_completionCalled, @"should not call delegate");
}

- (void)testNotHandleWrongPath {
XCTAssertFalse([_signIn handleURL:[NSURL URLWithString:kWrongPathURL]], @"should not handle URL");
XCTAssertFalse(_completionCalled, @"should not call delegate");
Expand Down Expand Up @@ -1077,10 +1080,10 @@ - (void)OAuthLoginWithAddScopesFlow:(BOOL)addScopesFlow
// Mock `maybeFetchToken:` method in Sign in flow.
if (!(authError || modalCancel)) {
[[[_authState expect] andReturn:nil] lastTokenResponse];
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
// Corresponds to EMM support
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
[[[_authState expect] andReturn:nil] lastTokenResponse];
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];
Expand Down

0 comments on commit df7f780

Please sign in to comment.