|
23 | 23 | #import <GoogleUtilities/GULSwizzler+Unswizzle.h>
|
24 | 24 | #import <GoogleUtilities/GULSwizzler.h>
|
25 | 25 | #import <OCMock/OCMock.h>
|
| 26 | +#import "FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.h" |
26 | 27 | #import "FirebaseDynamicLinks/Sources/FIRDLRetrievalProcessFactory.h"
|
27 | 28 | #import "FirebaseDynamicLinks/Sources/FIRDLRetrievalProcessResult+Private.h"
|
28 | 29 | #import "FirebaseDynamicLinks/Sources/FIRDynamicLink+Private.h"
|
@@ -1171,6 +1172,31 @@ - (void)test_multipleRequestsToRetrievePendingDeepLinkShouldNotCrash {
|
1171 | 1172 | isClassSelector:NO];
|
1172 | 1173 | }
|
1173 | 1174 |
|
| 1175 | +- (void)test_retrievePendingDeepLinkShouldSetkFIRDLOpenURLKeyRegardlessOfFailures { |
| 1176 | + [self.service setUpWithLaunchOptions:nil |
| 1177 | + apiKey:kAPIKey |
| 1178 | + clientID:kClientID |
| 1179 | + urlScheme:nil |
| 1180 | + userDefaults:[NSUserDefaults standardUserDefaults]]; |
| 1181 | + FIRDynamicLinks<FIRDLRetrievalProcessDelegate> *deleagte = |
| 1182 | + (FIRDynamicLinks<FIRDLRetrievalProcessDelegate> *)self.service; |
| 1183 | + |
| 1184 | + // Error Result to pass |
| 1185 | + FIRDLRetrievalProcessResult *result = [[FIRDLRetrievalProcessResult alloc] |
| 1186 | + initWithDynamicLink:nil |
| 1187 | + error:[NSError errorWithDomain:@"unknown domain" code:500 userInfo:nil] |
| 1188 | + message:nil |
| 1189 | + matchSource:nil]; |
| 1190 | + |
| 1191 | + FIRDLDefaultRetrievalProcessV2 *defaultRetrievalProcess = [FIRDLDefaultRetrievalProcessV2 alloc]; |
| 1192 | + |
| 1193 | + [deleagte retrievalProcess:defaultRetrievalProcess completedWithResult:result]; |
| 1194 | + |
| 1195 | + NSString *kFIRDLOpenURLKey = @"com.google.appinvite.openURL"; |
| 1196 | + XCTAssertEqual([[NSUserDefaults standardUserDefaults] boolForKey:kFIRDLOpenURLKey], YES, |
| 1197 | + @"kFIRDLOpenURL key should be set regardless of failures"); |
| 1198 | +} |
| 1199 | + |
1174 | 1200 | #pragma mark - Self-diagnose tests
|
1175 | 1201 |
|
1176 | 1202 | - (void)testSelfDiagnoseWithNilCompletion {
|
|
0 commit comments