Skip to content

merge master into googledatalogger branch #2224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bc08550
Clean up FIRAuth bits from FIRApp (#2110)
bstpierr Dec 7, 2018
fbc0897
Fix tvOS sample's Auth APIs. (#2158)
ryanwilson Dec 10, 2018
4469b97
Update CHANGELOG for Firestore v0.16.1 (#2164)
wilhuff Dec 10, 2018
c1c7506
Update the name of certificates bundle (#2171)
var-const Dec 10, 2018
4dac884
Fix format string in FSTRemoteStore error logging (#2172)
var-const Dec 10, 2018
673b085
C++: replace `FSTMaybeDocumentDictionary` with a C++ equivalent (#2139)
var-const Dec 10, 2018
9f6ed13
Port performance optimizations to speed up reading large collections …
var-const Dec 10, 2018
07c60c5
When searching for gRPC certificates, search the main bundle as well …
var-const Dec 13, 2018
b7d4594
Fix Rome instructions (#2184)
paulb777 Dec 13, 2018
943141e
Use registerLibrary for pods in Firebase workspace (#2137)
paulb777 Dec 13, 2018
8def2aa
Port Memory remote document cache to C++ (#2176)
Dec 13, 2018
f963bfb
Minor tweaks to release note (#2182)
alexg33 Dec 13, 2018
2bce70d
Port leveldb remote document cache to C++ (#2186)
Dec 14, 2018
598bc55
Remove start from persistence interface (#2173)
Dec 14, 2018
676c616
Fix small typos in public documentation. (#2192)
ryanwilson Dec 17, 2018
bc0329f
fix the unit test #1451 (#2187)
charlotteliang Dec 17, 2018
e226001
Port FSTRemoteDocumentCacheTest to use C++ interface (#2194)
Dec 17, 2018
dd9c760
Release 5.15.0 (#2195)
bstpierr Dec 18, 2018
ab05b96
Port FSTRemoteDocumentCache (#2196)
Dec 18, 2018
5063e9f
Fix leaks in Firestore (#2199)
wilhuff Dec 19, 2018
f39cdf3
Port DocumentState and UnknownDocument. (#2160)
rsgowman Dec 19, 2018
65f2709
Port FSTMemoryQueryCache to C++ (#2197)
Dec 19, 2018
7415a32
Port FSTLevelDBQueryCache to C++ (#2202)
Dec 20, 2018
22f6701
Fix Storage private imports. (#2206)
ryanwilson Dec 21, 2018
fa2cbe7
Add missing Foundation imports to Interop headers (#2207)
paulb777 Dec 21, 2018
6af931d
Migrate Firestore to the v1 protocol (#2200)
wilhuff Dec 21, 2018
05f43db
Add SymbolCollisionTest comment for ARCore (#2210)
paulb777 Dec 21, 2018
466880b
Continue work on ReferenceSet (#2213)
Dec 22, 2018
900ca3b
Implement QueryCache interface and port QueryCache tests (#2209)
Dec 22, 2018
ff19c73
Keep imports consistent (#2217)
paulb777 Dec 26, 2018
db62a27
Fix private tests by removing unnecessary storyboard entries (#2218)
paulb777 Dec 26, 2018
6759b0c
Fix xcode 9 build of FDLBuilderTestAppObjC (#2219)
paulb777 Dec 26, 2018
074de00
Rework FieldMask to use a (ordered) set of FieldPaths (#2136)
rsgowman Jan 2, 2019
7c53489
Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/20…
paulb777 Jan 2, 2019
52e2744
Merge branch 'master' into mph-googledatalogger
mikehaney24 Jan 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: osx
osx_image: xcode10
osx_image: xcode10.1
language: objective-c
cache:
- bundler
Expand Down
2 changes: 1 addition & 1 deletion Carthage.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseStorageBinary.jso
into the Xcode project and make sure they're added to the
`Copy Bundle Resources` Build Phase :
- For Firestore:
- ./Carthage/Build/iOS/FirebaseFirestore.framework/gRPCCertificates.bundle
- ./Carthage/Build/iOS/FirebaseFirestore.framework/gRPCCertificates-Firestore.bundle
- For Invites:
- ./Carthage/Build/iOS/FirebaseInvites.framework/GoogleSignIn.bundle
- ./Carthage/Build/iOS/FirebaseInvites.framework/GPPACLPickerResources.bundle
Expand Down
22 changes: 4 additions & 18 deletions Example/Auth/Tests/FIRAuthTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import <FirebaseAuthInterop/FIRAuthInterop.h>
#import <FirebaseCore/FIRAppInternal.h>
#import <FirebaseCore/FIRComponent.h>
#import <FirebaseCore/FIRComponentRegistrant.h>
#import <FirebaseCore/FIRLibrary.h>

#import "FIRAdditionalUserInfo.h"
#import "FIRAuth_Internal.h"
Expand Down Expand Up @@ -225,7 +225,7 @@
static const NSTimeInterval kWaitInterval = .5;

/** Category for FIRAuth to expose FIRComponentRegistrant conformance. */
@interface FIRAuth () <FIRComponentRegistrant>
@interface FIRAuth () <FIRLibrary>
@end

/** @class FIRAuthTests
Expand Down Expand Up @@ -365,20 +365,6 @@ - (void)testLifeCycle {
XCTAssertNil(auth);
}

/** @fn testGetUID
@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];
XCTAssertNil(app.getUIDImplementation());
[self waitForSignIn];
XCTAssertEqualObjects(app.getUIDImplementation(), kLocalID);
}

#pragma mark - Server API Tests

/** @fn testFetchProvidersForEmailSuccess
Expand Down Expand Up @@ -2283,8 +2269,8 @@ - (void)mockSecureTokenResponseWithError:(nullable NSError *)error {
*/
- (void)enableAutoTokenRefresh {
XCTestExpectation *expectation = [self expectationWithDescription:@"autoTokenRefreshcallback"];
[[FIRAuth auth].app getTokenForcingRefresh:NO withCallback:^(NSString *_Nullable token,
NSError *_Nullable error) {
[[FIRAuth auth] getTokenForcingRefresh:NO withCallback:^(NSString *_Nullable token,
NSError *_Nullable error) {
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
Expand Down
8 changes: 2 additions & 6 deletions Example/Core/Tests/FIRAnalyticsConfigurationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,15 @@ - (void)testSettingAnalyticsCollectionEnabled {
[self.observerMock setExpectationOrderMatters:YES];
[[self.observerMock expect] notificationWithName:notificationName
object:config
userInfo:@{
notificationName : @YES
}];
userInfo:@{notificationName : @YES}];

// Test setting to enabled.
[config setAnalyticsCollectionEnabled:YES];

// Expect the second notification.
[[self.observerMock expect] notificationWithName:notificationName
object:config
userInfo:@{
notificationName : @NO
}];
userInfo:@{notificationName : @NO}];

// Test setting to disabled.
[config setAnalyticsCollectionEnabled:NO];
Expand Down
241 changes: 96 additions & 145 deletions Example/Core/Tests/FIRAppTest.m

Large diffs are not rendered by default.

29 changes: 19 additions & 10 deletions Example/Core/Tests/FIRComponentContainerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,26 @@ @interface FIRComponentContainer (TestInternal)
@property(nonatomic, strong) NSMutableDictionary<NSString *, FIRComponentCreationBlock> *components;
@property(nonatomic, strong) NSMutableDictionary<NSString *, id> *cachedInstances;

+ (void)registerAsComponentRegistrant:(Class)klass inSet:(NSMutableSet<Class> *)allRegistrants;

+ (void)registerAsComponentRegistrant:(Class<FIRLibrary>)klass
inSet:(NSMutableSet<Class> *)allRegistrants;
- (instancetype)initWithApp:(FIRApp *)app registrants:(NSMutableSet<Class> *)allRegistrants;
@end

@interface FIRComponentContainer (TestInternalImplementations)
- (instancetype)initWithApp:(FIRApp *)app
components:(NSDictionary<NSString *, FIRComponentCreationBlock> *)components;
@end

@implementation FIRComponentContainer (TestInternalImplementations)

- (instancetype)initWithApp:(FIRApp *)app
components:(NSDictionary<NSString *, FIRComponentCreationBlock> *)components {
self = [self initWithApp:app registrants:[[NSMutableSet alloc] init]];
if (self) {
self.components = [components mutableCopy];
}
return self;
}

@end

Expand All @@ -47,13 +64,6 @@ - (void)testRegisteringConformingClass {
XCTAssertTrue([allRegistrants containsObject:testClass]);
}

- (void)testRegisteringNonConformingClass {
NSMutableSet<Class> *allRegistrants = [NSMutableSet<Class> set];
XCTAssertThrows(
[FIRComponentContainer registerAsComponentRegistrant:[NSString class] inSet:allRegistrants]);
XCTAssertTrue(allRegistrants.count == 0);
}

- (void)testComponentsPopulatedOnInit {
FIRComponentContainer *container = [self containerWithRegistrants:@ [[FIRTestClass class]]];

Expand Down Expand Up @@ -149,7 +159,6 @@ - (FIRComponentContainer *)containerWithRegistrants:(NSArray<Class> *)registrant
for (Class c in registrants) {
[FIRComponentContainer registerAsComponentRegistrant:c inSet:allRegistrants];
}

return [[FIRComponentContainer alloc] initWithApp:appMock registrants:allRegistrants];
}

Expand Down
64 changes: 27 additions & 37 deletions Example/Core/Tests/FIROptionsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ - (void)testDefaultOptions {
}

- (void)testInitCustomizedOptions {
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
options.APIKey = kAPIKey;
options.bundleID = kBundleID;
options.clientID = kClientID;
Expand All @@ -98,8 +98,8 @@ - (void)testInitCustomizedOptions {
}

- (void)testInitWithContentsOfFile {
NSString *filePath =
[[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info"
ofType:@"plist"];
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
[self assertOptionsMatchDefaults:options andProjectID:YES];
XCTAssertNil(options.deepLinkURLScheme);
Expand Down Expand Up @@ -136,8 +136,8 @@ - (void)assertOptionsMatchDefaults:(FIROptions *)options andProjectID:(BOOL)matc

- (void)testCopyingProperties {
NSMutableString *mutableString;
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.APIKey = mutableString;
[mutableString appendString:@"2"];
Expand Down Expand Up @@ -208,8 +208,8 @@ - (void)testCopyWithZone {
XCTAssertEqualObjects(newOptions.deepLinkURLScheme, kDeepLinkURLScheme);

// customized options
FIROptions *customizedOptions =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *customizedOptions = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
customizedOptions.deepLinkURLScheme = kDeepLinkURLScheme;
FIROptions *copyCustomizedOptions = [customizedOptions copy];
[copyCustomizedOptions setDeepLinkURLScheme:kNewDeepLinkURLScheme];
Expand Down Expand Up @@ -466,20 +466,16 @@ - (void)testAnalyticsCollectionGlobalSwitchOverrideToDisable {
OCMStub([appMock isDataCollectionDefaultEnabled]).andReturn(YES);

// Test the three Analytics flags that override to disable Analytics collection.
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionEnabled : @NO
}];
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @NO}];
XCTAssertFalse(collectionEnabledOptions.isAnalyticsCollectionEnabled);

FIROptions *collectionDeactivatedOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionDeactivated : @YES
}];
FIROptions *collectionDeactivatedOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionDeactivated : @YES}];
XCTAssertFalse(collectionDeactivatedOptions.isAnalyticsCollectionEnabled);

FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
FIROptions *measurementEnabledOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertFalse(measurementEnabledOptions.isAnalyticsCollectionEnabled);
}

Expand All @@ -491,14 +487,12 @@ - (void)testAnalyticsCollectionGlobalSwitchOverrideToEnable {
OCMStub([appMock isDataCollectionDefaultEnabled]).andReturn(NO);

// Test the two Analytics flags that can override and enable collection.
FIROptions *collectionEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsAnalyticsCollectionEnabled : @YES
}];
FIROptions *collectionEnabledOptions = [[FIROptions alloc]
initInternalWithOptionsDictionary:@{kFIRIsAnalyticsCollectionEnabled : @YES}];
XCTAssertTrue(collectionEnabledOptions.isAnalyticsCollectionEnabled);

FIROptions *measurementEnabledOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:@{
kFIRIsMeasurementEnabled : @YES
}];
FIROptions *measurementEnabledOptions =
[[FIROptions alloc] initInternalWithOptionsDictionary:@{kFIRIsMeasurementEnabled : @YES}];
XCTAssertTrue(measurementEnabledOptions.isAnalyticsCollectionEnabled);
}

Expand Down Expand Up @@ -534,31 +528,27 @@ - (void)testAnalyticsCollectionExplicitlySet {

// Test the old measurement flag.
options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @YES
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @YES}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);

options = [[FIROptions alloc] initInternalWithOptionsDictionary:@{}];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);

// For good measure, a combination of all 3 (even if they conflict).
optionsDictionary =
@{kFIRIsAnalyticsCollectionDeactivated : @YES,
kFIRIsAnalyticsCollectionEnabled : @YES};
@{kFIRIsAnalyticsCollectionDeactivated : @YES, kFIRIsAnalyticsCollectionEnabled : @YES};
options = [[FIROptions alloc] initInternalWithOptionsDictionary:optionsDictionary];
analyticsOptions = [options analyticsOptionsDictionaryWithInfoDictionary:@{
kFIRIsMeasurementEnabled : @NO
}];
analyticsOptions =
[options analyticsOptionsDictionaryWithInfoDictionary:@{kFIRIsMeasurementEnabled : @NO}];
XCTAssertTrue([options isAnalyticsCollectionExpicitlySet]);
}

- (void)testModifyingOptionsThrows {
FIROptions *options =
[[FIROptions alloc] initWithGoogleAppID:kGoogleAppID GCMSenderID:kGCMSenderID];
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:kGoogleAppID
GCMSenderID:kGCMSenderID];
options.editingLocked = YES;

// Modification to every property should result in an exception.
Expand Down
11 changes: 5 additions & 6 deletions Example/Core/Tests/FIRTestComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <FirebaseCore/FIRComponent.h>
#import <FirebaseCore/FIRComponentContainer.h>
#import <FirebaseCore/FIRComponentRegistrant.h>
#import <FirebaseCore/FIRLibrary.h>

@protocol FIRComponentRegistrant;

Expand All @@ -28,13 +28,12 @@
@end

/// A test class that is a component registrant.
@interface FIRTestClass
: NSObject <FIRTestProtocol, FIRComponentRegistrant, FIRComponentLifecycleMaintainer>
@interface FIRTestClass : NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
@end

/// A test class that is a component registrant, a duplicate of FIRTestClass.
@interface FIRTestClassDuplicate
: NSObject <FIRTestProtocol, FIRComponentRegistrant, FIRComponentLifecycleMaintainer>
: NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
@end

#pragma mark - Eager Component
Expand All @@ -47,7 +46,7 @@
/// A test class that is a component registrant that provides a component requiring eager
/// instantiation, and is cached for easier validation that it was instantiated.
@interface FIRTestClassEagerCached
: NSObject <FIRTestProtocolEagerCached, FIRComponentRegistrant, FIRComponentLifecycleMaintainer>
: NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
@end

#pragma mark - Cached Component
Expand All @@ -59,5 +58,5 @@
/// A test class that is a component registrant that provides a component that requests to be
/// cached.
@interface FIRTestClassCached
: NSObject <FIRTestProtocolCached, FIRComponentRegistrant, FIRComponentLifecycleMaintainer>
: NSObject <FIRTestProtocol, FIRComponentLifecycleMaintainer, FIRLibrary>
@end
12 changes: 9 additions & 3 deletions Example/Core/Tests/FIRTestComponents.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ @implementation FIRTestClassDuplicate
- (void)doSomething {
}

/// FIRComponentRegistrant conformance.
/// FIRLibrary conformance.
+ (nonnull NSArray<FIRComponent *> *)componentsToRegister {
FIRComponent *testComponent =
[FIRComponent componentWithProtocol:@protocol(FIRTestProtocol)
Expand All @@ -72,7 +72,7 @@ @implementation FIRTestClassEagerCached
- (void)doSomethingFaster {
}

/// FIRComponentRegistrant conformance.
/// FIRLibrary conformance.
+ (nonnull NSArray<FIRComponent *> *)componentsToRegister {
FIRComponent *testComponent = [FIRComponent
componentWithProtocol:@protocol(FIRTestProtocolEagerCached)
Expand All @@ -92,13 +92,16 @@ - (void)doSomethingFaster {
- (void)appWillBeDeleted:(FIRApp *)app {
}

- (void)doSomething {
}

@end

#pragma mark - Cached Component

@implementation FIRTestClassCached

/// FIRComponentRegistrant conformance.
/// FIRLibrary conformance.
+ (nonnull NSArray<FIRComponent *> *)componentsToRegister {
FIRComponent *testComponent = [FIRComponent
componentWithProtocol:@protocol(FIRTestProtocolCached)
Expand All @@ -115,4 +118,7 @@ @implementation FIRTestClassCached
- (void)appWillBeDeleted:(FIRApp *)app {
}

- (void)doSomething {
}

@end
21 changes: 21 additions & 0 deletions Example/Database/Tests/Helpers/FIRFakeApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ @interface FIRDatabaseComponent (Internal)
- (instancetype)initWithApp:(FIRApp *)app;
@end

@interface FIRComponentContainer (TestInternal)
@property(nonatomic, strong) NSMutableDictionary<NSString *, FIRComponentCreationBlock> *components;
@end

@interface FIRComponentContainer (TestInternalImplementations)
- (instancetype)initWithApp:(FIRApp *)app
components:(NSDictionary<NSString *, FIRComponentCreationBlock> *)components;
@end

@implementation FIRComponentContainer (TestInternalImplementations)

- (instancetype)initWithApp:(FIRApp *)app
components:(NSDictionary<NSString *, FIRComponentCreationBlock> *)components {
self = [self initWithApp:app registrants:[[NSMutableSet alloc] init]];
if (self) {
self.components = [components mutableCopy];
}
return self;
}
@end

@implementation FIRFakeApp

- (instancetype)initWithName:(NSString *)name URL:(NSString *)url {
Expand Down
4 changes: 0 additions & 4 deletions Example/DynamicLinks/App/iOS/DL-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Loading