Skip to content

Commit df7f780

Browse files
committed
Improve style.
1 parent 7e76eae commit df7f780

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
2525
/// The block type providing the response for the method `startWithOptions:emmSupport:completion:`.
2626
///
2727
/// @param authorizationResponse The `OIDAuthorizationResponse` object returned on success.
28-
/// @param error The error returned on failure.
28+
/// @param error An `NSError` returned on failure.
2929
typedef void(^GIDAuthorizationFlowProcessorFakeResponseProviderBlock)
3030
(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error);
3131

GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ - (BOOL)isStarted {
4141
}
4242

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

GoogleSignIn/Tests/Unit/GIDSignInTest.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@
104104
static NSString * const kFakeUserFamilyName = @"username";
105105
static NSString * const kFakeUserPictureURL = @"fake_user_picture_url";
106106

107-
static NSString * const kContinueURL = @"com.google.UnitTests:/oauth2callback";
108-
static NSString * const kContinueURLWithClientID = @"FakeClientID:/oauth2callback";
109-
static NSString * const kWrongSchemeURL = @"wrong.app:/oauth2callback";
107+
static NSString * const kRightPathURL = @"com.google.UnitTests:/oauth2callback";
110108
static NSString * const kWrongPathURL = @"com.google.UnitTests:/wrong_path";
111109

112110
static NSString * const kEMMRestartAuthURL =
@@ -572,6 +570,11 @@ - (void)testSignOut {
572570
XCTAssertNil([_keychainHandler loadAuthState]);
573571
}
574572

573+
- (void)testHandleRightPath {
574+
XCTAssertTrue([_signIn handleURL:[NSURL URLWithString:kRightPathURL]]);
575+
XCTAssertFalse(_completionCalled, @"should not call delegate");
576+
}
577+
575578
- (void)testNotHandleWrongPath {
576579
XCTAssertFalse([_signIn handleURL:[NSURL URLWithString:kWrongPathURL]], @"should not handle URL");
577580
XCTAssertFalse(_completionCalled, @"should not call delegate");
@@ -1077,10 +1080,10 @@ - (void)OAuthLoginWithAddScopesFlow:(BOOL)addScopesFlow
10771080
// Mock `maybeFetchToken:` method in Sign in flow.
10781081
if (!(authError || modalCancel)) {
10791082
[[[_authState expect] andReturn:nil] lastTokenResponse];
1080-
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
1083+
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
10811084
// Corresponds to EMM support
10821085
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];
1083-
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
1086+
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
10841087
[[[_authState expect] andReturn:nil] lastTokenResponse];
10851088
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];
10861089
[[[_authState expect] andReturn:authResponse] lastAuthorizationResponse];

0 commit comments

Comments
 (0)