aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h')
-rw-r--r--Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h
index 46601d7..466a347 100644
--- a/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h
+++ b/Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.h
@@ -16,16 +16,19 @@
#import <Foundation/Foundation.h>
+#include <unordered_map>
+
#import "Firestore/Source/Core/FSTTypes.h"
#import "Firestore/Source/Remote/FSTRemoteStore.h"
+#include "Firestore/core/src/firebase/firestore/auth/user.h"
+
@class FSTDocumentKey;
@class FSTMutation;
@class FSTMutationResult;
@class FSTQuery;
@class FSTQueryData;
@class FSTSnapshotVersion;
-@class FSTUser;
@class FSTViewSnapshot;
@class FSTWatchChange;
@protocol FSTGarbageCollector;
@@ -54,7 +57,10 @@ NS_ASSUME_NONNULL_BEGIN
@end
/** Mapping of user => array of FSTMutations for that user. */
-typedef NSDictionary<FSTUser *, NSArray<FSTOutstandingWrite *> *> FSTOutstandingWriteQueues;
+typedef std::unordered_map<firebase::firestore::auth::User,
+ NSMutableArray<FSTOutstandingWrite *> *,
+ firebase::firestore::auth::HashUser>
+ FSTOutstandingWriteQueues;
/**
* A test driver for FSTSyncEngine that allows simulated event delivery and capture. As much as
@@ -93,8 +99,8 @@ typedef NSDictionary<FSTUser *, NSArray<FSTOutstandingWrite *> *> FSTOutstanding
*/
- (instancetype)initWithPersistence:(id<FSTPersistence>)persistence
garbageCollector:(id<FSTGarbageCollector>)garbageCollector
- initialUser:(FSTUser *)initialUser
- outstandingWrites:(FSTOutstandingWriteQueues *)outstandingWrites
+ initialUser:(const firebase::firestore::auth::User &)initialUser
+ outstandingWrites:(const FSTOutstandingWriteQueues &)outstandingWrites
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@@ -222,7 +228,7 @@ typedef NSDictionary<FSTUser *, NSArray<FSTOutstandingWrite *> *> FSTOutstanding
* each user, so future receiveWriteAck/Error operations will validate the write sent to the mock
* datastore matches the next outstanding write for that user.
*/
-- (void)changeUser:(FSTUser *)user;
+- (void)changeUser:(const firebase::firestore::auth::User &)user;
/**
* Returns all query events generated by the FSTSyncEngine in response to the event injection
@@ -246,10 +252,10 @@ typedef NSDictionary<FSTUser *, NSArray<FSTOutstandingWrite *> *> FSTOutstanding
* sentWritesCount, but not necessarily, since the FSTRemoteStore limits the number of
* outstanding writes to the backend at a given time.
*/
-@property(nonatomic, strong, readonly) FSTOutstandingWriteQueues *outstandingWrites;
+@property(nonatomic, assign, readonly) const FSTOutstandingWriteQueues &outstandingWrites;
/** The current user for the FSTSyncEngine; determines which mutation queue is active. */
-@property(nonatomic, strong, readonly) FSTUser *currentUser;
+@property(nonatomic, assign, readonly) const firebase::firestore::auth::User &currentUser;
/** The current set of documents in limbo. */
@property(nonatomic, strong, readonly)