diff options
author | Ryan Wilson <wilsonryan@google.com> | 2018-07-11 17:40:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 17:40:25 -0400 |
commit | 79f663d5eaaa4b7f9fe46d176c82660d38e4be8a (patch) | |
tree | 47b27cb93aa0372eb141668526552b3559ac1dbb /Example | |
parent | c6b4b03fffc3cea7c9525e5c79dce28f52900521 (diff) |
Add Auth interoperability library. (#1501)
* Add Auth interoperability library.
This allows other SDKs to retrieve the user ID and fetch a new
Auth token in a type-safe way through the Core container.
* Remove unnecessary import.
* Add missing copyright.
* Resolve comments.
- Remove unnecessary umbrella header.
- Move to version 1.0.
- Add tvOS support for app lifecycle changes.
* Move public interop headers to private.
* Add public_header_files too.
* Moved headers back into public.
* Shorten Interoperability and Interoperable to Interop.
* Add AuthInterop to travis linting.
* Fixed tag format in AuthInterop.podspec.
* Add AuthInterop path to Firestore Podfile.
Diffstat (limited to 'Example')
-rw-r--r-- | Example/Auth/Tests/FIRAuthTests.m | 25 | ||||
-rw-r--r-- | Example/Core/Tests/FIRAppTest.m | 1 | ||||
-rw-r--r-- | Example/Podfile | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m index 6a047a4..c008bab 100644 --- a/Example/Auth/Tests/FIRAuthTests.m +++ b/Example/Auth/Tests/FIRAuthTests.m @@ -18,7 +18,11 @@ #import <XCTest/XCTest.h> +#import <FirebaseAuth/FirebaseAuth.h> +#import <FirebaseAuthInterop/FIRAuthInterop.h> #import <FirebaseCore/FIRAppInternal.h> +#import <FirebaseCore/FIRComponent.h> +#import <FirebaseCore/FIRComponentRegistrant.h> #import "FIRAdditionalUserInfo.h" #import "FIRAuth_Internal.h" @@ -221,6 +225,10 @@ static const NSTimeInterval kExpectationTimeout = 2; */ static const NSTimeInterval kWaitInterval = .5; +/** Category for FIRAuth to expose FIRComponentRegistrant conformance. */ +@interface FIRAuth () <FIRComponentRegistrant> +@end + /** @class FIRAuthTests @brief Tests for @c FIRAuth. */ @@ -362,6 +370,8 @@ static const NSTimeInterval kWaitInterval = .5; @brief Verifies that FIRApp's getUIDImplementation is correctly set by FIRAuth. */ - (void)testGetUID { + // TODO: Remove this test once Firestore, Database, and Storage move over to the new Auth interop + // library. FIRApp *app = [FIRApp defaultApp]; XCTAssertNotNil(app.getUIDImplementation); [[FIRAuth auth] signOut:NULL]; @@ -2221,6 +2231,21 @@ static const NSTimeInterval kWaitInterval = .5; } #endif +#pragma mark - Interoperability Tests + +/** @fn testComponentsBeingRegistered + @brief Tests that Auth provides the necessary components for interoperability with other SDKs. + */ +- (void)testComponentsBeingRegistered { + // Verify that the components are registered properly. Check the count, because any time a new + // component is added it should be added to the test suite as well. + NSArray<FIRComponent *> *components = [FIRAuth componentsToRegister]; + XCTAssertTrue(components.count == 1); + + FIRComponent *component = [components firstObject]; + XCTAssert(component.protocol == @protocol(FIRAuthInterop)); +} + #pragma mark - Helpers /** @fn mockSecureTokenResponseWithError: diff --git a/Example/Core/Tests/FIRAppTest.m b/Example/Core/Tests/FIRAppTest.m index 656f046..d88ed66 100644 --- a/Example/Core/Tests/FIRAppTest.m +++ b/Example/Core/Tests/FIRAppTest.m @@ -754,6 +754,7 @@ NSString *const kFIRTestAppName2 = @"test-app-name-2"; #pragma mark - Internal Methods +// TODO: Remove this test once the `getUIDImplementation` block doesn't need to be set in Core. - (void)testAuthGetUID { [FIRApp configure]; diff --git a/Example/Podfile b/Example/Podfile index dc3acd0..373471f 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -4,6 +4,7 @@ use_frameworks! +pod 'FirebaseAuthInterop', :path => '../' pod 'FirebaseCore', :path => '../' pod 'GoogleUtilities', :path => '../' |