@@ -26,12 +26,14 @@ import 'package:flutter/material.dart';
2626import 'shared.dart' ;
2727
2828void main () {
29- for (final TestMapType testMapType in testMapTypes) {
30- patrol ('Test map types (${testMapType .name })' ,
31- (PatrolIntegrationTester $) async {
29+ final mapTypeVariants = getMapTypeVariants ();
30+ patrol (
31+ 'Test map types' ,
32+ (PatrolIntegrationTester $) async {
3233 /// Get viewController for the test type (navigation map or regular map).
3334 GoogleMapViewController viewController =
34- await getMapViewControllerForTestMapType ($, testMapType: testMapType);
35+ await getMapViewControllerForTestMapType ($,
36+ testMapType: mapTypeVariants.currentValue! );
3537
3638 // Test default type.
3739 expect (await viewController.getMapType (), MapType .normal);
@@ -47,17 +49,18 @@ void main() {
4749 await viewController.setMapType (mapType: type);
4850 expect (await viewController.getMapType (), type);
4951 }
50- });
51- }
52+ },
53+ variant: mapTypeVariants,
54+ );
5255
53- for ( final TestMapType testMapType in testMapTypes) {
54- patrol ( 'Test platform view creation params (${ testMapType . name }) ' ,
55- (PatrolIntegrationTester $) async {
56+ patrol (
57+ 'Test platform view creation params' ,
58+ (PatrolIntegrationTester $) async {
5659 final Completer <GoogleMapViewController > controllerCompleter =
5760 Completer <GoogleMapViewController >();
5861
59- switch (testMapType ) {
60- case TestMapType .map :
62+ switch (mapTypeVariants.currentValue ! ) {
63+ case TestMapType .mapView :
6164 final Key key = GlobalKey ();
6265 await pumpMapView (
6366 $,
@@ -78,7 +81,7 @@ void main() {
7881 ),
7982 );
8083 break ;
81- case TestMapType .navigation :
84+ case TestMapType .navigationView :
8285 final Key key = GlobalKey ();
8386 await pumpNavigationView (
8487 $,
@@ -119,12 +122,13 @@ void main() {
119122 expect (await controller.settings.isZoomControlsEnabled (), false );
120123 expect (await controller.settings.isMapToolbarEnabled (), false );
121124 }
122- });
123- }
125+ },
126+ variant: mapTypeVariants,
127+ );
124128
125- for ( final TestMapType testMapType in testMapTypes) {
126- patrol ( 'Test map UI settings (${ testMapType . name }) ' ,
127- (PatrolIntegrationTester $) async {
129+ patrol (
130+ 'Test map UI settings' ,
131+ (PatrolIntegrationTester $) async {
128132 /// The events are not tested because there's currently no reliable way to trigger them.
129133 void onMyLocationButtonClicked (MyLocationButtonClickedEvent event) {
130134 debugPrint ('My location button clicked event: currently $event ' );
@@ -149,7 +153,7 @@ void main() {
149153 /// Get viewController for the test type (navigation map or regular map).
150154 await getMapViewControllerForTestMapType (
151155 $,
152- testMapType: testMapType ,
156+ testMapType: mapTypeVariants.currentValue ! ,
153157 initializeNavigation: false ,
154158 onMapClicked: expectAsync1 ((LatLng msg) {
155159 expectSync (msg, isA <LatLng >());
@@ -247,15 +251,17 @@ void main() {
247251 expect (e, const TypeMatcher <UnsupportedError >());
248252 }
249253 }
250- });
251- }
254+ },
255+ variant: mapTypeVariants,
256+ );
252257
253- for ( final TestMapType testMapType in testMapTypes) {
254- patrol ( 'Test map style (${ testMapType . name }) ' ,
255- (PatrolIntegrationTester $) async {
258+ patrol (
259+ 'Test map style' ,
260+ (PatrolIntegrationTester $) async {
256261 /// Get viewController for the test type (navigation map or regular map).
257262 GoogleMapViewController viewController =
258- await getMapViewControllerForTestMapType ($, testMapType: testMapType);
263+ await getMapViewControllerForTestMapType ($,
264+ testMapType: mapTypeVariants.currentValue! );
259265
260266 // Test that valid json doens't throw exception.
261267 await viewController.setMapStyle (
@@ -271,21 +277,22 @@ void main() {
271277 } on MapStyleException catch (e) {
272278 expect (e, isNotNull);
273279 }
274- });
275- }
280+ },
281+ variant: mapTypeVariants,
282+ );
276283
277- for ( final TestMapType testMapType in testMapTypes) {
278- patrol ( 'Test min max zoom level (${ testMapType . name }) ' ,
279- (PatrolIntegrationTester $) async {
284+ patrol (
285+ 'Test min max zoom level' ,
286+ (PatrolIntegrationTester $) async {
280287 /// For some reason the functionality works on Android example app, but it doesn't work
281288 /// during the testing. Will skip Android testing for now.
282289 final Completer <GoogleMapViewController > viewControllerCompleter =
283290 Completer <GoogleMapViewController >();
284291
285292 await checkLocationDialogAcceptance ($);
286293
287- switch (testMapType ) {
288- case TestMapType .map :
294+ switch (mapTypeVariants.currentValue ! ) {
295+ case TestMapType .mapView :
289296
290297 /// Display map view.
291298 final Key key = GlobalKey ();
@@ -299,7 +306,7 @@ void main() {
299306 ),
300307 );
301308 break ;
302- case TestMapType .navigation :
309+ case TestMapType .navigationView :
303310
304311 /// Display navigation view.
305312 final Key key = GlobalKey ();
@@ -363,6 +370,7 @@ void main() {
363370 // Expect the same values. The actual zoom level will be limited by the map.
364371 expect (newMinZoomPreference, 0.0 );
365372 expect (newMaxZoomPreference, 50.0 );
366- });
367- }
373+ },
374+ variant: mapTypeVariants,
375+ );
368376}
0 commit comments