Skip to content

Commit 3a8e6bd

Browse files
stuartmorgan-gnploi
authored andcommitted
[google_maps] Relax the Android renderer requset test (flutter#3364)
Updates the "initialized with latest renderer" test to just test that the rest resulted in some valid response, since we can't actually control what the server returns; the request is non-binding, and there are cases where (e.g., depending on the device details) the legacy renderer will be returned regardless.
1 parent 6151cc9 commit 3a8e6bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/latest_renderer_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ void main() {
2222
});
2323

2424
testWidgets('initialized with latest renderer', (WidgetTester _) async {
25-
expect(initializedRenderer, AndroidMapRenderer.latest);
25+
// There is no guarantee that the server will return the latest renderer
26+
// even when requested, so there's no way to deterministically test that.
27+
// Instead, just test that the request succeeded and returned a valid
28+
// value.
29+
expect(
30+
initializedRenderer == AndroidMapRenderer.latest ||
31+
initializedRenderer == AndroidMapRenderer.legacy,
32+
true);
2633
});
2734

2835
testWidgets('throws PlatformException on multiple renderer initializations',

0 commit comments

Comments
 (0)