소스 검색

Improve style.

pinlu 3 년 전
부모
커밋
df7f780296

+ 1 - 1
GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.h

@@ -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);
 

+ 0 - 1
GoogleSignIn/Sources/GIDAuthorizationFlowProcessor/Implementations/Fakes/GIDFakeAuthorizationFlowProcessor.m

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

+ 8 - 5
GoogleSignIn/Tests/Unit/GIDSignInTest.m

@@ -104,9 +104,7 @@ static NSString * const kFakeUserGivenName = @"fake";
 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 =
@@ -572,6 +570,11 @@ static NSString *const kNewScope = @"newScope";
   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");
@@ -1077,10 +1080,10 @@ static NSString *const kNewScope = @"newScope";
       // 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];