-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(firestore, web): expose
webExperimentalForceLongPolling
, `webE…
…xperimentalAutoDetectLongPolling` and `timeoutSeconds` on web (#13201) * fix(firestore): expose on FireStoreSettings * fix(firestore): expose on FireStoreSettings * fix(firestore): change experimentalForceLongPolling to webExperimentalForceLongPolling since it applies to web only. * feat(firestore, web): expose (webExperimentalAutoDetectLongPolling, webExperimentalForceLongPolling, timeoutSeconds) * correct variable name * abstract timeoutDuration within an object * remove description on webExperimentalLongPollingOptions field * resolve documentation * fix analyzer issues * test(firestore, web): add e2e tests for long polling fields * test(firestore, web): add e2e tests for long polling fields * remove skip field from test * remove unused import * tests(firestore,web): make adjustments long polling tests * tests(firestore,web): make adjustments long polling tests --------- Co-authored-by: jude.kwashie <[email protected]>
- Loading branch information
Showing
14 changed files
with
229 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/cloud_firestore/cloud_firestore/example/integration_test/settings_e2e.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void runSettingsTest() { | ||
group( | ||
'$Settings', | ||
() { | ||
late FirebaseFirestore firestore; | ||
|
||
setUpAll(() async { | ||
firestore = FirebaseFirestore.instance; | ||
}); | ||
|
||
Future<Settings> initializeTest() async { | ||
Settings firestoreSettings = const Settings( | ||
persistenceEnabled: false, | ||
webExperimentalForceLongPolling: true, | ||
webExperimentalAutoDetectLongPolling: true, | ||
webExperimentalLongPollingOptions: WebExperimentalLongPollingOptions( | ||
timeoutDuration: Duration(seconds: 15), | ||
), | ||
); | ||
|
||
return firestore.settings = firestoreSettings; | ||
} | ||
|
||
testWidgets('checks if long polling settings were applied', (_) async { | ||
Settings settings = await initializeTest(); | ||
|
||
expect(settings.webExperimentalForceLongPolling, true); | ||
|
||
expect(settings.webExperimentalAutoDetectLongPolling, true); | ||
|
||
expect( | ||
settings.webExperimentalLongPollingOptions, | ||
settings.webExperimentalLongPollingOptions, | ||
); | ||
}); | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.