Skip to content

Commit efae7fc

Browse files
Cleanup
1 parent 1c078fe commit efae7fc

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,9 @@ - (void)testWatchStreamReconnectsAfterIdle {
858858
FIRDocumentReference *doc = [self documentRef];
859859
FIRFirestore *firestore = doc.firestore;
860860

861-
[self readSnapshotForRef:[self documentRef] online:YES];
861+
[self readSnapshotForRef:[self documentRef] requireOnline:YES];
862862
[self waitForIdle:firestore];
863-
[self readSnapshotForRef:[self documentRef] online:YES];
863+
[self readSnapshotForRef:[self documentRef] requireOnline:YES];
864864
}
865865

866866
@end

Firestore/Example/Tests/Integration/FSTStreamTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
#import "Auth/FSTEmptyCredentialsProvider.h"
2222
#import "Core/FSTDatabaseInfo.h"
23-
#import "FSTTestDispatchQueue.h"
2423
#import "FSTHelpers.h"
2524
#import "FSTIntegrationTestCase.h"
25+
#import "FSTTestDispatchQueue.h"
2626
#import "Model/FSTDatabaseID.h"
2727
#import "Remote/FSTDatastore.h"
2828
#import "Util/FSTAssert.h"

Firestore/Example/Tests/Util/FSTIntegrationTestCase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ NS_ASSUME_NONNULL_BEGIN
6969

7070
- (FIRQuerySnapshot *)readDocumentSetForRef:(FIRQuery *)query;
7171

72-
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)query online:(BOOL)online;
72+
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)query
73+
requireOnline:(BOOL)online;
7374

7475
- (void)writeDocumentRef:(FIRDocumentReference *)ref data:(NSDictionary<NSString *, id> *)data;
7576

Firestore/Example/Tests/Util/FSTIntegrationTestCase.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ - (FIRQuerySnapshot *)readDocumentSetForRef:(FIRQuery *)query {
235235
return result;
236236
}
237237

238-
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)ref online:(BOOL)online {
238+
- (FIRDocumentSnapshot *)readSnapshotForRef:(FIRDocumentReference *)ref requireOnline:(BOOL)online {
239239
__block FIRDocumentSnapshot *result;
240240

241241
XCTestExpectation *expectation = [self expectationWithDescription:@"listener"];

Firestore/Example/Tests/Util/FSTTestDispatchQueue.m

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ @interface FSTTestDispatchQueue ()
2828

2929
@implementation FSTTestDispatchQueue
3030

31+
static const NSTimeInterval kMaxDispatchDelay = 1.0;
32+
3133
+ (instancetype)queueWith:(dispatch_queue_t)dispatchQueue {
3234
return [[FSTTestDispatchQueue alloc] initWithQueue:dispatchQueue];
3335
}
@@ -38,20 +40,20 @@ - (instancetype)initWithQueue:(dispatch_queue_t)dispatchQueue {
3840

3941
- (void)dispatchAsync:(void (^)(void))block after:(NSTimeInterval)delay {
4042
[super dispatchAsyncAllowingSameQueue:^() {
41-
block();
42-
[_expectation fulfill];
43-
_expectation = nil;
44-
}
45-
after:MIN(delay, 1.0)];
43+
block();
44+
[_expectation fulfill];
45+
_expectation = nil;
46+
}
47+
after:MIN(delay, kMaxDispatchDelay)];
4648
}
4749

4850
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block after:(NSTimeInterval)delay {
4951
[super dispatchAsyncAllowingSameQueue:^() {
50-
block();
51-
[_expectation fulfill];
52-
_expectation = nil;
53-
}
54-
after:MIN(delay, 1.0)];
52+
block();
53+
[_expectation fulfill];
54+
_expectation = nil;
55+
}
56+
after:MIN(delay, kMaxDispatchDelay)];
5557
}
5658

5759
- (void)fulfillOnExecution:(XCTestExpectation*)expectation {

Firestore/Source/Remote/FSTDatastore.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ NS_ASSUME_NONNULL_BEGIN
213213

214214
@end
215215

216-
#pragma mark - FSTWatchStream
216+
#pragma mark - FSTWatchStreamDelegate
217217

218218
/** A protocol defining the events that can be emitted by the FSTWatchStream. */
219219
@protocol FSTWatchStreamDelegate <NSObject>
@@ -240,6 +240,8 @@ NS_ASSUME_NONNULL_BEGIN
240240

241241
@end
242242

243+
#pragma mark - FSTWatchStream
244+
243245
/**
244246
* An FSTStream that implements the StreamingWatch RPC.
245247
*
@@ -276,7 +278,7 @@ NS_ASSUME_NONNULL_BEGIN
276278

277279
@end
278280

279-
#pragma mark - FSTWriteStream
281+
#pragma mark - FSTWriteStreamDelegate
280282

281283
@protocol FSTWriteStreamDelegate <NSObject>
282284

@@ -308,6 +310,8 @@ NS_ASSUME_NONNULL_BEGIN
308310

309311
@end
310312

313+
#pragma mark - FSTWriteStream
314+
311315
/**
312316
* An FSTStream that implements the StreamingWrite RPC.
313317
*

Firestore/Source/Remote/FSTDatastore.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ - (instancetype)initWithDatabase:(FSTDatabaseInfo *)database
120120
- (instancetype)initWithDatabase:(FSTDatabaseInfo *)database
121121
workerDispatchQueue:(FSTDispatchQueue *)workerDispatchQueue
122122
credentials:(id<FSTCredentialsProvider>)credentials
123-
responseMessageClass:(Class)responseMessageClassNS_UNAVAILABLE;
123+
responseMessageClass:(Class)responseMessageClass NS_UNAVAILABLE;
124124

125125
@end
126126

0 commit comments

Comments
 (0)