Skip to content

Commit c7b2ccd

Browse files
Merge
2 parents 7e7b82e + 958f866 commit c7b2ccd

File tree

8 files changed

+1
-207
lines changed

8 files changed

+1
-207
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
AFE6114F0D4DAECBA7B7C089 /* Pods_Firestore_IntegrationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2FA635DF5D116A67A7441CD /* Pods_Firestore_IntegrationTests.framework */; };
6060
C4E749275AD0FBDF9F4716A8 /* Pods_SwiftBuildTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32AD40BF6B0E849B07FFD05E /* Pods_SwiftBuildTest.framework */; };
6161
D5B2532E4676014F57A7EAB9 /* FSTStreamTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D5B25C0D4AADFCA3ADB883E4 /* FSTStreamTests.m */; };
62-
D5B25B66FE2390963E000FDE /* FIRTestDispatchQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = D5B25F48D1536205E8E67F2A /* FIRTestDispatchQueue.m */; };
63-
D5B25EF6FF29F02249573A35 /* FIRTestDispatchQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = D5B25F48D1536205E8E67F2A /* FIRTestDispatchQueue.m */; };
6462
DE03B2C91F2149D600A30B9C /* FSTTransactionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DE51B1C61F0D48AC0013853F /* FSTTransactionTests.m */; };
6563
DE03B2D41F2149D600A30B9C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6664
DE03B2D51F2149D600A30B9C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -225,8 +223,6 @@
225223
CE00BABB5A3AAB44A4C209E2 /* Pods-Firestore_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Tests/Pods-Firestore_Tests.debug.xcconfig"; sourceTree = "<group>"; };
226224
D3CC3DC5338DCAF43A211155 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
227225
D5B25C0D4AADFCA3ADB883E4 /* FSTStreamTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSTStreamTests.m; sourceTree = "<group>"; };
228-
D5B25C8BBBB84E96C06ED244 /* FIRTestDispatchQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRTestDispatchQueue.h; sourceTree = "<group>"; };
229-
D5B25F48D1536205E8E67F2A /* FIRTestDispatchQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRTestDispatchQueue.m; sourceTree = "<group>"; };
230226
DB17FEDFB80770611A935A60 /* Pods-Firestore_IntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_IntegrationTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_IntegrationTests/Pods-Firestore_IntegrationTests.release.xcconfig"; sourceTree = "<group>"; };
231227
DE03B2E91F2149D600A30B9C /* Firestore_IntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_IntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
232228
DE03B3621F215E1600A30B9C /* CAcert.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = CAcert.pem; sourceTree = "<group>"; };
@@ -565,8 +561,6 @@
565561
DE51B18A1F0D48AC0013853F /* FSTUtilTests.m */,
566562
54E9282A1F339CAD00C1953E /* XCTestCase+Await.h */,
567563
54E9282B1F339CAD00C1953E /* XCTestCase+Await.m */,
568-
D5B25F48D1536205E8E67F2A /* FIRTestDispatchQueue.m */,
569-
D5B25C8BBBB84E96C06ED244 /* FIRTestDispatchQueue.h */,
570564
);
571565
path = Util;
572566
sourceTree = "<group>";
@@ -1181,7 +1175,6 @@
11811175
DE51B1CD1F0D48CD0013853F /* FSTDatabaseInfoTests.m in Sources */,
11821176
DE51B1F21F0D49140013853F /* FSTPathTests.m in Sources */,
11831177
DE51B1DD1F0D490D0013853F /* FSTLocalStoreTests.m in Sources */,
1184-
D5B25B66FE2390963E000FDE /* FIRTestDispatchQueue.m in Sources */,
11851178
);
11861179
runOnlyForDeploymentPostprocessing = 0;
11871180
};
@@ -1206,7 +1199,6 @@
12061199
DE03B2C91F2149D600A30B9C /* FSTTransactionTests.m in Sources */,
12071200
54DA12B11F315F3800DD57A1 /* FIRValidationTests.m in Sources */,
12081201
D5B2532E4676014F57A7EAB9 /* FSTStreamTests.m in Sources */,
1209-
D5B25EF6FF29F02249573A35 /* FIRTestDispatchQueue.m in Sources */,
12101202
);
12111203
runOnlyForDeploymentPostprocessing = 0;
12121204
};

Firestore/Example/Tests/Integration/API/FIRDatabaseTests.m

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -845,22 +845,4 @@ - (void)testCantGetDocumentsWhileOffline {
845845
[self awaitExpectations];
846846
}
847847

848-
- (void)testWriteStreamReconnectsAfterIdle {
849-
FIRDocumentReference *doc = [self documentRef];
850-
FIRFirestore *firestore = doc.firestore;
851-
852-
[self writeDocumentRef:doc data:@{@"foo" : @"bar"}];
853-
[self waitForIdle:firestore];
854-
[self writeDocumentRef:doc data:@{@"foo" : @"bar"}];
855-
}
856-
857-
- (void)testWatchStreamReconnectsAfterIdle {
858-
FIRDocumentReference *doc = [self documentRef];
859-
FIRFirestore *firestore = doc.firestore;
860-
861-
[self readSnapshotForRef:[self documentRef] online:YES];
862-
[self waitForIdle:firestore];
863-
[self readSnapshotForRef:[self documentRef] online:YES];
864-
}
865-
866848
@end

Firestore/Example/Tests/Util/FIRTestDispatchQueue.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

Firestore/Example/Tests/Util/FIRTestDispatchQueue.m

Lines changed: 0 additions & 62 deletions
This file was deleted.

Firestore/Example/Tests/Util/FSTIntegrationTestCase.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ NS_ASSUME_NONNULL_BEGIN
5656
- (FIRCollectionReference *)collectionRefWithDocuments:
5757
(NSDictionary<NSString *, NSDictionary<NSString *, id> *> *)documents;
5858

59-
- (void)waitForIdle:(FIRFirestore *)firestore;
60-
6159
- (void)writeAllDocuments:(NSDictionary<NSString *, NSDictionary<NSString *, id> *> *)documents
6260
toCollection:(FIRCollectionReference *)collection;
6361

@@ -69,8 +67,6 @@ NS_ASSUME_NONNULL_BEGIN
6967

7068
- (FIRQuerySnapshot *)readDocumentSetForRef:(FIRQuery *)query;
7169

72-
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)query online:(BOOL)online;
73-
7470
- (void)writeDocumentRef:(FIRDocumentReference *)ref data:(NSDictionary<NSString *, id> *)data;
7571

7672
- (void)updateDocumentRef:(FIRDocumentReference *)ref data:(NSDictionary<NSString *, id> *)data;

Firestore/Example/Tests/Util/FSTIntegrationTestCase.m

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@
2929
#import "Util/FSTDispatchQueue.h"
3030
#import "Util/FSTUtil.h"
3131

32-
#import "FIRTestDispatchQueue.h"
3332
#import "FSTEventAccumulator.h"
3433

3534
NS_ASSUME_NONNULL_BEGIN
3635

37-
@interface FIRFirestore (Testing)
38-
@property(nonatomic, strong) FSTDispatchQueue *workerDispatchQueue;
39-
@end
40-
4136
@implementation FSTIntegrationTestCase {
4237
NSMutableArray<FIRFirestore *> *_firestores;
4338
}
@@ -126,7 +121,7 @@ + (FIRFirestoreSettings *)settings {
126121
- (FIRFirestore *)firestoreWithProjectID:(NSString *)projectID {
127122
NSString *persistenceKey = [NSString stringWithFormat:@"db%lu", (unsigned long)_firestores.count];
128123

129-
FSTTestDispatchQueue *workerDispatchQueue = [FSTTestDispatchQueue
124+
FSTDispatchQueue *workerDispatchQueue = [FSTDispatchQueue
130125
queueWith:dispatch_queue_create("com.google.firebase.firestore", DISPATCH_QUEUE_SERIAL)];
131126

132127
FSTEmptyCredentialsProvider *credentialsProvider = [[FSTEmptyCredentialsProvider alloc] init];
@@ -147,14 +142,6 @@ - (FIRFirestore *)firestoreWithProjectID:(NSString *)projectID {
147142
return firestore;
148143
}
149144

150-
- (void)waitForIdle:(FIRFirestore *)firestore {
151-
XCTestExpectation *expectation = [self expectationWithDescription:@"idle"];
152-
// Note that we wait on any task that is scheduled with a delay. Currently, the idle timeout is
153-
// the only task that uses delays.
154-
[((FSTTestDispatchQueue *)firestore.workerDispatchQueue) fulfillOnExecution:expectation];
155-
[self awaitExpectations];
156-
}
157-
158145
- (void)shutdownFirestore:(FIRFirestore *)firestore {
159146
XCTestExpectation *shutdownCompletion = [self expectationWithDescription:@"shutdown"];
160147
[firestore shutdownWithCompletion:^(NSError *_Nullable error) {
@@ -235,26 +222,6 @@ - (FIRQuerySnapshot *)readDocumentSetForRef:(FIRQuery *)query {
235222
return result;
236223
}
237224

238-
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)ref online:(BOOL)online {
239-
__block FIRDocumentSnapshot *result;
240-
241-
XCTestExpectation *expectation = [self expectationWithDescription:@"listener"];
242-
id<FIRListenerRegistration> listener = [ref
243-
addSnapshotListenerWithOptions:[[FIRDocumentListenOptions options] includeMetadataChanges:YES]
244-
listener:^(FIRDocumentSnapshot *snapshot, NSError *error) {
245-
XCTAssertNil(error);
246-
if (!online || !snapshot.metadata.fromCache) {
247-
result = snapshot;
248-
[expectation fulfill];
249-
}
250-
}];
251-
252-
[self awaitExpectations];
253-
[listener remove];
254-
255-
return result;
256-
}
257-
258225
- (void)writeDocumentRef:(FIRDocumentReference *)ref data:(NSDictionary<NSString *, id> *)data {
259226
XCTestExpectation *expectation = [self expectationWithDescription:@"setData"];
260227
[ref setData:data

Firestore/Source/Util/FSTDispatchQueue.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
2323
/** Creates and returns an FSTDispatchQueue wrapping the specified dispatch_queue_t. */
2424
+ (instancetype)queueWith:(dispatch_queue_t)dispatchQueue;
2525

26-
- (instancetype)initWithQueue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
27-
2826
- (instancetype)init __attribute__((unavailable("Use static constructor method.")));
2927

3028
/**
@@ -41,17 +39,6 @@ NS_ASSUME_NONNULL_BEGIN
4139
*/
4240
- (void)dispatchAsync:(void (^)(void))block;
4341

44-
/**
45-
* Schedules a callback after the specified delay.
46-
*
47-
* Same as dispatch_after() except it asserts that we're not already on the queue, since this
48-
* generally indicates a bug (and can lead to re-ordering of operations, etc).
49-
*
50-
* @param block The block to run.
51-
* @param delay The delay (in seconds) after which to run the block.
52-
*/
53-
- (void)dispatchAsync:(void (^)(void))block after:(NSTimeInterval)delay;
54-
5542
/**
5643
* Unlike dispatchAsync: this method does not require you to dispatch to a different queue than
5744
* the current one (thus it is equivalent to a raw dispatch_async()).
@@ -63,20 +50,6 @@ NS_ASSUME_NONNULL_BEGIN
6350
*/
6451
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block;
6552

66-
/**
67-
* Schedules a callback after the specified delay.
68-
*
69-
* Unlike dispatchAsync: this method does not require you to dispatch to a different queue than
70-
* the current one (thus it is equivalent to a raw dispatch_async()).
71-
*
72-
* This is useful, e.g. for dispatching to the user's queue directly from user API call (in which
73-
* case we don't know if we're already on the user's queue or not).
74-
*
75-
* @param block The block to run.
76-
* @param delay The delay (in seconds) after which to run the block.
77-
*/
78-
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block after:(NSTimeInterval)delay;
79-
8053
/** The underlying wrapped dispatch_queue_t */
8154
@property(nonatomic, strong, readonly) dispatch_queue_t queue;
8255

Firestore/Source/Util/FSTDispatchQueue.m

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,10 @@ - (void)dispatchAsync:(void (^)(void))block {
5252
dispatch_async(self.queue, block);
5353
}
5454

55-
- (void)dispatchAsync:(void (^)(void))block after:(NSTimeInterval)delay {
56-
FSTAssert(
57-
![self onTargetQueue],
58-
@"dispatchAsync:after: called when we are already running on target dispatch queue '%@'",
59-
[self targetQueueLabel]);
60-
61-
dispatch_time_t delayNs = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC));
62-
dispatch_after(delayNs, self.queue, block);
63-
}
64-
6555
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block {
6656
dispatch_async(self.queue, block);
6757
}
6858

69-
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block after:(NSTimeInterval)delay {
70-
dispatch_time_t delayNs = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC));
71-
dispatch_after(delayNs, self.queue, block);
72-
}
73-
7459
#pragma mark - Private Methods
7560

7661
- (NSString *)currentQueueLabel {

0 commit comments

Comments
 (0)