From 38b41f95f52b6e5e097c6268fc2aa623bc66e061 Mon Sep 17 00:00:00 2001 From: Ann Marie Mossman <233583+mossmana@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:40:01 -0700 Subject: [PATCH 1/4] Added delay to address timing issue with info window display status updates --- .../integration_test/google_maps_tests.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index d22767c44c2d..feac9e8f8588 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -936,26 +936,26 @@ void googleMapsTests() { final ExampleGoogleMapController controller = await controllerCompleter.future; + await tester.pumpAndSettle(); + + // TODO (mossmana): Adding this delay addresses + // https://github.com/flutter/flutter/issues/131783. It may be related + // to https://github.com/flutter/flutter/issues/54758 and should be + // re-evaluated when that issue is fixed. + await Future.delayed(const Duration(seconds: 1)); + bool iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId); expect(iwVisibleStatus, false); await controller.showMarkerInfoWindow(marker.markerId); - // The Maps SDK doesn't always return true for whether it is shown - // immediately after showing it, so wait for it to report as shown. - iwVisibleStatus = await waitForValueMatchingPredicate( - tester, - () => controller.isMarkerInfoWindowShown(marker.markerId), - (bool visible) => visible) ?? - false; + iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId); expect(iwVisibleStatus, true); await controller.hideMarkerInfoWindow(marker.markerId); iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId); expect(iwVisibleStatus, false); - }, - // TODO(camsim99): Fix https://github.com/flutter/flutter/issues/131783. - skip: true); + }); testWidgets('fromAssetImage', (WidgetTester tester) async { const double pixelRatio = 2; From e8aced7b1e51afb182fe158ec90fa5a5684885bb Mon Sep 17 00:00:00 2001 From: Ann Marie Mossman <233583+mossmana@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:51:51 -0700 Subject: [PATCH 2/4] Attempting to fix TODO style --- .../example/integration_test/google_maps_tests.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index feac9e8f8588..27ff7f49aed5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -938,7 +938,7 @@ void googleMapsTests() { await tester.pumpAndSettle(); - // TODO (mossmana): Adding this delay addresses + // TODO(mossmana): Adding this delay addresses // https://github.com/flutter/flutter/issues/131783. It may be related // to https://github.com/flutter/flutter/issues/54758 and should be // re-evaluated when that issue is fixed. From 7222352fa685559a8fc2eda28e888df7600b35a4 Mon Sep 17 00:00:00 2001 From: Ann Marie Mossman <233583+mossmana@users.noreply.github.com> Date: Thu, 24 Aug 2023 12:57:09 -0700 Subject: [PATCH 3/4] Fixed formatting issue --- .../example/integration_test/google_maps_tests.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index 27ff7f49aed5..dc8fd691c0dc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -938,7 +938,7 @@ void googleMapsTests() { await tester.pumpAndSettle(); - // TODO(mossmana): Adding this delay addresses + // TODO(mossmana): Adding this delay addresses // https://github.com/flutter/flutter/issues/131783. It may be related // to https://github.com/flutter/flutter/issues/54758 and should be // re-evaluated when that issue is fixed. From b9a655c24a731103e93ce9bd6dceb6a9fcdf3b93 Mon Sep 17 00:00:00 2001 From: Ann Marie Mossman <233583+mossmana@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:08:51 -0700 Subject: [PATCH 4/4] reverted removal of waitForValueMatchingPredicate --- .../example/integration_test/google_maps_tests.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index dc8fd691c0dc..97e7dfa0a37e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -949,7 +949,13 @@ void googleMapsTests() { expect(iwVisibleStatus, false); await controller.showMarkerInfoWindow(marker.markerId); - iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId); + // The Maps SDK doesn't always return true for whether it is shown + // immediately after showing it, so wait for it to report as shown. + iwVisibleStatus = await waitForValueMatchingPredicate( + tester, + () => controller.isMarkerInfoWindowShown(marker.markerId), + (bool visible) => visible) ?? + false; expect(iwVisibleStatus, true); await controller.hideMarkerInfoWindow(marker.markerId);