|
104 | 104 | static NSString * const kFakeUserFamilyName = @"username"; |
105 | 105 | static NSString * const kFakeUserPictureURL = @"fake_user_picture_url"; |
106 | 106 |
|
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"; |
110 | 108 | static NSString * const kWrongPathURL = @"com.google.UnitTests:/wrong_path"; |
111 | 109 |
|
112 | 110 | static NSString * const kEMMRestartAuthURL = |
@@ -572,6 +570,11 @@ - (void)testSignOut { |
572 | 570 | XCTAssertNil([_keychainHandler loadAuthState]); |
573 | 571 | } |
574 | 572 |
|
| 573 | +- (void)testHandleRightPath { |
| 574 | + XCTAssertTrue([_signIn handleURL:[NSURL URLWithString:kRightPathURL]]); |
| 575 | + XCTAssertFalse(_completionCalled, @"should not call delegate"); |
| 576 | +} |
| 577 | + |
575 | 578 | - (void)testNotHandleWrongPath { |
576 | 579 | XCTAssertFalse([_signIn handleURL:[NSURL URLWithString:kWrongPathURL]], @"should not handle URL"); |
577 | 580 | XCTAssertFalse(_completionCalled, @"should not call delegate"); |
@@ -1077,10 +1080,10 @@ - (void)OAuthLoginWithAddScopesFlow:(BOOL)addScopesFlow |
1077 | 1080 | // Mock `maybeFetchToken:` method in Sign in flow. |
1078 | 1081 | if (!(authError || modalCancel)) { |
1079 | 1082 | [[[_authState expect] andReturn:nil] lastTokenResponse]; |
1080 | | - #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST |
| 1083 | +#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST |
1081 | 1084 | // Corresponds to EMM support |
1082 | 1085 | [[[_authState expect] andReturn:authResponse] lastAuthorizationResponse]; |
1083 | | - #endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST |
| 1086 | +#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST |
1084 | 1087 | [[[_authState expect] andReturn:nil] lastTokenResponse]; |
1085 | 1088 | [[[_authState expect] andReturn:authResponse] lastAuthorizationResponse]; |
1086 | 1089 | [[[_authState expect] andReturn:authResponse] lastAuthorizationResponse]; |
|
0 commit comments