Skip to content

Commit

Permalink
[google_maps] Relax the Android renderer requset test (flutter#3364)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stuartmorgan committed Mar 3, 2023
1 parent ca7205b commit dbce04e
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -22,7 +22,14 @@ void main() {
});

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

testWidgets('throws PlatformException on multiple renderer initializations',
Expand Down

0 comments on commit dbce04e

Please sign in to comment.