in firestore/testapp/Assets/Firebase/Sample/Firestore/UIHandlerAutomated.cs [80:187]
protected override void Start() {
// Set the list of tests to run, note this is done at Start since they are
// non-static.
Func<Task>[] tests = {
// clang-format off
TestDeleteDocument,
TestWriteDocument,
TestWriteDocumentViaCollection,
TestWriteDocumentWithIntegers,
TestUpdateDocument,
TestListenForSnapshotsInSync,
TestMultiInstanceDocumentReferenceListeners,
TestMultiInstanceQueryListeners,
TestMultiInstanceSnapshotsInSyncListeners,
TestUpdateFieldInDocument,
TestArrayUnionAndRemove,
TestUpdateFieldPath,
TestWriteBatches,
TestTransaction,
TestTransactionWithNonGenericTask,
TestTransactionAbort,
TestTransactionTaskFailures,
TestTransactionRollsBackIfException,
TestTransactionPermanentError,
TestTransactionDispose,
TestTransactionsInParallel,
// Waiting for all retries is slow, so we usually leave this test disabled.
// TestTransactionMaxRetryFailure,
TestSetOptions,
TestCanTraverseCollectionsAndDocuments,
TestCanTraverseCollectionAndDocumentParents,
TestDocumentSnapshot,
TestDocumentSnapshotIntegerIncrementBehavior,
TestDocumentSnapshotDoubleIncrementBehavior,
TestDocumentSnapshotServerTimestampBehavior,
TestSnapshotMetadataEqualsAndGetHashCode,
TestAuthIntegration,
TestDocumentListen,
TestDocumentListenWithMetadataChanges,
TestQueryListen,
TestQueryListenWithMetadataChanges,
TestQuerySnapshotChanges,
TestQueries,
TestLimitToLast,
TestArrayContains,
TestArrayContainsAny,
TestInQueries,
TestDefaultInstanceStable,
TestGetAsyncSource,
TestWaitForPendingWrites,
TestTerminate,
TestClearPersistence,
TestObjectMappingSmokeTest,
TestObjectMapping,
TestNotSupportedObjectMapping,
TestFirestoreSingleton,
TestFirestoreSettings,
TestDocumentReferenceTaskFailures,
TestCollectionReferenceTaskFailures,
TestAssertTaskFaults,
TestInternalExceptions,
TestListenerRegistrationDispose,
TestLoadBundles,
TestQueryEqualsAndGetHashCode,
TestQuerySnapshotEqualsAndGetHashCode,
TestDocumentSnapshotEqualsAndGetHashCode,
TestDocumentChangeEqualsAndGetHashCode,
TestLoadBundlesForASecondTime_ShouldSkip,
TestLoadBundlesFromOtherProjects_ShouldFail,
LoadedBundleDocumentsAlreadyPulledFromBackend_ShouldNotOverwrite,
TestInvalidArgumentAssertions,
TestFirestoreDispose,
TestFirestoreGetInstance,
// clang-format on
};
// For local development convenience, populate `testFilter` with the tests that you would like
// to run (instead of running the entire suite).
Func<Task>[] testFilter = {
// THIS LIST MUST BE EMPTY WHEN CHECKED INTO SOURCE CONTROL!
};
// Unity "helpfully" adds stack traces whenever you call Debug.Log. Unfortunately, these stack
// traces are basically useless, since the good parts are always truncated. (See comments on
// LogInBatches.) So just disable them.
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
mainThreadDispatcher = gameObject.AddComponent<MainThreadDispatcher>();
if (mainThreadDispatcher == null) {
Debug.LogError("Could not create MainThreadDispatcher component!");
return;
}
mainThreadDispatcher.RunOnMainThread(() => {
MainThreadId = Thread.CurrentThread.ManagedThreadId;
});
testRunner = AutomatedTestRunner.CreateTestRunner(
testsToRun: testFilter.Length > 0 ? testFilter : tests,
logFunc: LogInBatches
);
Debug.Log("NOTE: Some API calls report failures using UnityEngine.Debug.LogError which will " +
"pause execution in the editor when 'Error Pause' in the console window is " +
"enabled. `Error Pause` should be disabled to execute this test.");
UIEnabled = false;
base.Start();
}