diff --git a/packages/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/CHANGELOG.md index 6ea04694815a..0bf3943256ed 100644 --- a/packages/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.21+12 + +* Update driver tests in the example app to e2e tests. + ## 0.5.21+11 * Define clang module for iOS, fix analyzer warnings. diff --git a/packages/google_maps_flutter/android/build.gradle b/packages/google_maps_flutter/android/build.gradle index f13de0b79a18..9baaea837d11 100644 --- a/packages/google_maps_flutter/android/build.gradle +++ b/packages/google_maps_flutter/android/build.gradle @@ -36,3 +36,29 @@ android { implementation 'com.google.android.gms:play-services-maps:17.0.0' } } + +// TODO(cyanglaz): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348 +afterEvaluate { + def containsEmbeddingDependencies = false + for (def configuration : configurations.all) { + for (def dependency : configuration.dependencies) { + if (dependency.group == 'io.flutter' && + dependency.name.startsWith('flutter_embedding') && + dependency.isTransitive()) + { + containsEmbeddingDependencies = true + break + } + } + } + if (!containsEmbeddingDependencies) { + android { + dependencies { + def lifecycle_version = "1.1.1" + compileOnly "android.arch.lifecycle:runtime:$lifecycle_version" + compileOnly "android.arch.lifecycle:common:$lifecycle_version" + compileOnly "android.arch.lifecycle:common-java8:$lifecycle_version" + } + } + } +} \ No newline at end of file diff --git a/packages/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/example/pubspec.yaml index 799d80e76328..7e533a8de3b3 100644 --- a/packages/google_maps_flutter/example/pubspec.yaml +++ b/packages/google_maps_flutter/example/pubspec.yaml @@ -15,6 +15,7 @@ dev_dependencies: flutter_driver: sdk: flutter test: ^1.6.0 + e2e: ^0.2.1 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/packages/google_maps_flutter/example/test_driver/google_maps.dart b/packages/google_maps_flutter/example/test_driver/google_maps_e2e.dart similarity index 86% rename from packages/google_maps_flutter/example/test_driver/google_maps.dart rename to packages/google_maps_flutter/example/test_driver/google_maps_e2e.dart index 90d065fbeb5b..53d0c90f99de 100644 --- a/packages/google_maps_flutter/example/test_driver/google_maps.dart +++ b/packages/google_maps_flutter/example/test_driver/google_maps_e2e.dart @@ -7,29 +7,25 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:flutter_driver/driver_extension.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:e2e/e2e.dart'; import 'google_map_inspector.dart'; -import 'test_widgets.dart'; const LatLng _kInitialMapCenter = LatLng(0, 0); +const double _kInitialZoomLevel = 5; const CameraPosition _kInitialCameraPosition = - CameraPosition(target: _kInitialMapCenter); + CameraPosition(target: _kInitialMapCenter, zoom: _kInitialZoomLevel); void main() { - final Completer allTestsCompleter = Completer(); - enableFlutterDriverExtension(handler: (_) => allTestsCompleter.future); + E2EWidgetsFlutterBinding.ensureInitialized(); - tearDownAll(() => allTestsCompleter.complete(null)); - - test('testCompassToggle', () async { + testWidgets('testCompassToggle', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -48,7 +44,7 @@ void main() { bool compassEnabled = await inspector.isCompassEnabled(); expect(compassEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -64,12 +60,12 @@ void main() { expect(compassEnabled, true); }); - test('testMapToolbarToggle', () async { + testWidgets('testMapToolbarToggle', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -88,7 +84,7 @@ void main() { bool mapToolbarEnabled = await inspector.isMapToolbarEnabled(); expect(mapToolbarEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -104,7 +100,7 @@ void main() { expect(mapToolbarEnabled, Platform.isAndroid); }); - test('updateMinMaxZoomLevels', () async { + testWidgets('updateMinMaxZoomLevels', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); @@ -112,7 +108,7 @@ void main() { const MinMaxZoomPreference initialZoomLevel = MinMaxZoomPreference(2, 4); const MinMaxZoomPreference finalZoomLevel = MinMaxZoomPreference(3, 8); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -131,7 +127,7 @@ void main() { MinMaxZoomPreference zoomLevel = await inspector.getMinMaxZoomLevels(); expect(zoomLevel, equals(initialZoomLevel)); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -147,12 +143,12 @@ void main() { expect(zoomLevel, equals(finalZoomLevel)); }); - test('testZoomGesturesEnabled', () async { + testWidgets('testZoomGesturesEnabled', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -171,7 +167,7 @@ void main() { bool zoomGesturesEnabled = await inspector.isZoomGesturesEnabled(); expect(zoomGesturesEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -187,12 +183,12 @@ void main() { expect(zoomGesturesEnabled, true); }); - test('testRotateGesturesEnabled', () async { + testWidgets('testRotateGesturesEnabled', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -211,7 +207,7 @@ void main() { bool rotateGesturesEnabled = await inspector.isRotateGesturesEnabled(); expect(rotateGesturesEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -227,12 +223,12 @@ void main() { expect(rotateGesturesEnabled, true); }); - test('testTiltGesturesEnabled', () async { + testWidgets('testTiltGesturesEnabled', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -251,7 +247,7 @@ void main() { bool tiltGesturesEnabled = await inspector.isTiltGesturesEnabled(); expect(tiltGesturesEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -267,12 +263,12 @@ void main() { expect(tiltGesturesEnabled, true); }); - test('testScrollGesturesEnabled', () async { + testWidgets('testScrollGesturesEnabled', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -291,7 +287,7 @@ void main() { bool scrollGesturesEnabled = await inspector.isScrollGesturesEnabled(); expect(scrollGesturesEnabled, false); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -307,7 +303,7 @@ void main() { expect(scrollGesturesEnabled, true); }); - test('testGetVisibleRegion', () async { + testWidgets('testGetVisibleRegion', (WidgetTester tester) async { final Key key = GlobalKey(); final LatLngBounds zeroLatLngBounds = LatLngBounds( southwest: const LatLng(0, 0), northeast: const LatLng(0, 0)); @@ -315,7 +311,7 @@ void main() { final Completer mapControllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -325,16 +321,15 @@ void main() { }, ), )); - final GoogleMapController mapController = - await mapControllerCompleter.future; - // We suspected a bug in the iOS Google Maps SDK caused the camera is not properly positioned at // initialization. https://github.com/flutter/flutter/issues/24806 // This temporary workaround fix is provided while the actual fix in the Google Maps SDK is // still being investigated. // TODO(cyanglaz): Remove this temporary fix once the Maps SDK issue is resolved. // https://github.com/flutter/flutter/issues/27550 - await Future.delayed(const Duration(seconds: 3)); + await tester.pumpAndSettle(const Duration(seconds: 3)); + final GoogleMapController mapController = + await mapControllerCompleter.future; final LatLngBounds firstVisibleRegion = await mapController.getVisibleRegion(); @@ -345,8 +340,12 @@ void main() { expect(firstVisibleRegion, isNot(zeroLatLngBounds)); expect(firstVisibleRegion.contains(_kInitialMapCenter), isTrue); - const LatLng southWest = LatLng(60, 75); - const LatLng northEast = LatLng(65, 80); + // Making a new `LatLngBounds` about (10, 10) distance south west to the `firstVisibleRegion`. + // The size of the `LatLngBounds` is 10 by 10. + final LatLng southWest = LatLng(firstVisibleRegion.southwest.latitude - 20, + firstVisibleRegion.southwest.longitude - 20); + final LatLng northEast = LatLng(firstVisibleRegion.southwest.latitude - 10, + firstVisibleRegion.southwest.longitude - 10); final LatLng newCenter = LatLng( (northEast.latitude + southWest.latitude) / 2, (northEast.longitude + southWest.longitude) / 2, @@ -363,6 +362,7 @@ void main() { final double padding = 0; await mapController .moveCamera(CameraUpdate.newLatLngBounds(latLngBounds, padding)); + await tester.pumpAndSettle(const Duration(seconds: 3)); final LatLngBounds secondVisibleRegion = await mapController.getVisibleRegion(); @@ -376,12 +376,12 @@ void main() { expect(secondVisibleRegion.contains(newCenter), isTrue); }); - test('testTraffic', () async { + testWidgets('testTraffic', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -401,12 +401,12 @@ void main() { expect(isTrafficEnabled, true); }); - test('testMyLocationButtonToggle', () async { + testWidgets('testMyLocationButtonToggle', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -426,7 +426,7 @@ void main() { bool myLocationButtonEnabled = await inspector.isMyLocationButtonEnabled(); expect(myLocationButtonEnabled, true); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -443,12 +443,13 @@ void main() { expect(myLocationButtonEnabled, false); }); - test('testMyLocationButton initial value false', () async { + testWidgets('testMyLocationButton initial value false', + (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -470,12 +471,13 @@ void main() { expect(myLocationButtonEnabled, false); }); - test('testMyLocationButton initial value true', () async { + testWidgets('testMyLocationButton initial value true', + (WidgetTester tester) async { final Key key = GlobalKey(); final Completer inspectorCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -497,12 +499,12 @@ void main() { expect(myLocationButtonEnabled, true); }); - test('testSetMapStyle valid Json String', () async { + testWidgets('testSetMapStyle valid Json String', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer controllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -519,12 +521,13 @@ void main() { await controller.setMapStyle(mapStyle); }); - test('testSetMapStyle invalid Json String', () async { + testWidgets('testSetMapStyle invalid Json String', + (WidgetTester tester) async { final Key key = GlobalKey(); final Completer controllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -546,12 +549,12 @@ void main() { } }); - test('testSetMapStyle null string', () async { + testWidgets('testSetMapStyle null string', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer controllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -566,12 +569,12 @@ void main() { await controller.setMapStyle(null); }); - test('testGetLatLng', () async { + testWidgets('testGetLatLng', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer controllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -590,7 +593,7 @@ void main() { // still being investigated. // TODO(cyanglaz): Remove this temporary fix once the Maps SDK issue is resolved. // https://github.com/flutter/flutter/issues/27550 - await Future.delayed(const Duration(seconds: 3)); + await tester.pumpAndSettle(const Duration(seconds: 3)); final LatLngBounds visibleRegion = await controller.getVisibleRegion(); final LatLng topLeft = @@ -603,12 +606,12 @@ void main() { expect(topLeft, northWest); }); - test('testScreenCoordinate', () async { + testWidgets('testScreenCoordinate', (WidgetTester tester) async { final Key key = GlobalKey(); final Completer controllerCompleter = Completer(); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: GoogleMap( key: key, @@ -618,7 +621,6 @@ void main() { }, ), )); - final GoogleMapController controller = await controllerCompleter.future; // We suspected a bug in the iOS Google Maps SDK caused the camera is not properly positioned at @@ -627,7 +629,7 @@ void main() { // still being investigated. // TODO(cyanglaz): Remove this temporary fix once the Maps SDK issue is resolved. // https://github.com/flutter/flutter/issues/27550 - await Future.delayed(const Duration(seconds: 3)); + await tester.pumpAndSettle(const Duration(seconds: 3)); final LatLngBounds visibleRegion = await controller.getVisibleRegion(); final LatLng northWest = LatLng( @@ -636,11 +638,10 @@ void main() { ); final ScreenCoordinate topLeft = await controller.getScreenCoordinate(northWest); - expect(topLeft, const ScreenCoordinate(x: 0, y: 0)); }); - test('testResizeWidget', () async { + testWidgets('testResizeWidget', (WidgetTester tester) async { final Completer controllerCompleter = Completer(); final GoogleMap map = GoogleMap( @@ -649,14 +650,14 @@ void main() { controllerCompleter.complete(controller); }, ); - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: MaterialApp( home: Scaffold( body: SizedBox(height: 100, width: 100, child: map))))); final GoogleMapController controller = await controllerCompleter.future; - await pumpWidget(Directionality( + await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: MaterialApp( home: Scaffold( @@ -668,7 +669,7 @@ void main() { // still being investigated. // TODO(cyanglaz): Remove this temporary fix once the Maps SDK issue is resolved. // https://github.com/flutter/flutter/issues/27550 - await Future.delayed(const Duration(seconds: 3)); + await tester.pumpAndSettle(const Duration(seconds: 3)); // Simple call to make sure that the app hasn't crashed. final LatLngBounds bounds1 = await controller.getVisibleRegion(); diff --git a/packages/path_provider/example/test_driver/path_provider_test.dart b/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart similarity index 72% rename from packages/path_provider/example/test_driver/path_provider_test.dart rename to packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart index b0d3305cd652..ff6e9ce74ad9 100644 --- a/packages/path_provider/example/test_driver/path_provider_test.dart +++ b/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart @@ -3,11 +3,13 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; - +import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); driver.close(); + exit(result == 'pass' ? 0 : 1); } diff --git a/packages/google_maps_flutter/example/test_driver/test_widgets.dart b/packages/google_maps_flutter/example/test_driver/test_widgets.dart deleted file mode 100644 index 5656c9f5610c..000000000000 --- a/packages/google_maps_flutter/example/test_driver/test_widgets.dart +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2019, 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 'dart:async'; - -import 'package:flutter/widgets.dart'; - -Future pumpWidget(Widget widget) { - runApp(widget); - return WidgetsBinding.instance.endOfFrame; -} diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml index fc683bb1bba6..320e942bf208 100644 --- a/packages/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter -version: 0.5.21+11 +version: 0.5.21+12 dependencies: flutter: diff --git a/packages/path_provider/CHANGELOG.md b/packages/path_provider/CHANGELOG.md index a8c91a2071f5..27dde4284b77 100644 --- a/packages/path_provider/CHANGELOG.md +++ b/packages/path_provider/CHANGELOG.md @@ -1,5 +1,10 @@ +## 1.4.4 + +* Update driver tests in the example app to e2e tests. + ## 1.4.3 +* Update driver tests in the example app to e2e tests. * Add missing DartDocs and a lint to prevent further regressions. ## 1.4.2 diff --git a/packages/path_provider/android/build.gradle b/packages/path_provider/android/build.gradle index 93460e761568..71ea49b2fb39 100644 --- a/packages/path_provider/android/build.gradle +++ b/packages/path_provider/android/build.gradle @@ -37,3 +37,29 @@ dependencies { implementation 'androidx.annotation:annotation:1.1.0' testImplementation 'junit:junit:4.12' } + +// TODO(cyanglaz): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348 +afterEvaluate { + def containsEmbeddingDependencies = false + for (def configuration : configurations.all) { + for (def dependency : configuration.dependencies) { + if (dependency.group == 'io.flutter' && + dependency.name.startsWith('flutter_embedding') && + dependency.isTransitive()) + { + containsEmbeddingDependencies = true + break + } + } + } + if (!containsEmbeddingDependencies) { + android { + dependencies { + def lifecycle_version = "1.1.1" + compileOnly "android.arch.lifecycle:runtime:$lifecycle_version" + compileOnly "android.arch.lifecycle:common:$lifecycle_version" + compileOnly "android.arch.lifecycle:common-java8:$lifecycle_version" + } + } + } +} \ No newline at end of file diff --git a/packages/path_provider/example/android/gradle.properties b/packages/path_provider/example/android/gradle.properties index 7be3d8b46841..38c8d4544ff1 100644 --- a/packages/path_provider/example/android/gradle.properties +++ b/packages/path_provider/example/android/gradle.properties @@ -1,2 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/path_provider/example/pubspec.yaml b/packages/path_provider/example/pubspec.yaml index 015a4fb46e5d..279a9138a608 100644 --- a/packages/path_provider/example/pubspec.yaml +++ b/packages/path_provider/example/pubspec.yaml @@ -11,6 +11,7 @@ dev_dependencies: flutter_driver: sdk: flutter test: any + e2e: ^0.2.1 flutter: uses-material-design: true diff --git a/packages/path_provider/example/test_driver/path_provider.dart b/packages/path_provider/example/test_driver/path_provider_e2e.dart similarity index 85% rename from packages/path_provider/example/test_driver/path_provider.dart rename to packages/path_provider/example/test_driver/path_provider_e2e.dart index ccbc62599e02..d3a1019a7c23 100644 --- a/packages/path_provider/example/test_driver/path_provider.dart +++ b/packages/path_provider/example/test_driver/path_provider_e2e.dart @@ -5,31 +5,29 @@ import 'dart:async'; import 'dart:io'; -import 'package:flutter_driver/driver_extension.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider/path_provider.dart'; +import 'package:e2e/e2e.dart'; void main() { - final Completer allTestsCompleter = Completer(); - enableFlutterDriverExtension(handler: (_) => allTestsCompleter.future); - tearDownAll(() => allTestsCompleter.complete(null)); + E2EWidgetsFlutterBinding.ensureInitialized(); - test('getTemporaryDirectory', () async { + testWidgets('getTemporaryDirectory', (WidgetTester tester) async { final Directory result = await getTemporaryDirectory(); _verifySampleFile(result, 'temporaryDirectory'); }); - test('getApplicationDocumentsDirectory', () async { + testWidgets('getApplicationDocumentsDirectory', (WidgetTester tester) async { final Directory result = await getApplicationDocumentsDirectory(); _verifySampleFile(result, 'applicationDocuments'); }); - test('getApplicationSupportDirectory', () async { + testWidgets('getApplicationSupportDirectory', (WidgetTester tester) async { final Directory result = await getApplicationSupportDirectory(); _verifySampleFile(result, 'applicationSupport'); }); - test('getLibraryDirectory', () async { + testWidgets('getLibraryDirectory', (WidgetTester tester) async { if (Platform.isIOS) { final Directory result = await getLibraryDirectory(); _verifySampleFile(result, 'library'); @@ -39,7 +37,7 @@ void main() { } }); - test('getExternalStorageDirectory', () async { + testWidgets('getExternalStorageDirectory', (WidgetTester tester) async { if (Platform.isIOS) { final Future result = getExternalStorageDirectory(); expect(result, throwsA(isInstanceOf())); @@ -49,7 +47,7 @@ void main() { } }); - test('getExternalCacheDirectories', () async { + testWidgets('getExternalCacheDirectories', (WidgetTester tester) async { if (Platform.isIOS) { final Future> result = getExternalCacheDirectories(); expect(result, throwsA(isInstanceOf())); diff --git a/packages/google_maps_flutter/example/test_driver/google_maps_test.dart b/packages/path_provider/example/test_driver/path_provider_e2e_test.dart similarity index 72% rename from packages/google_maps_flutter/example/test_driver/google_maps_test.dart rename to packages/path_provider/example/test_driver/path_provider_e2e_test.dart index b0d3305cd652..ff6e9ce74ad9 100644 --- a/packages/google_maps_flutter/example/test_driver/google_maps_test.dart +++ b/packages/path_provider/example/test_driver/path_provider_e2e_test.dart @@ -3,11 +3,13 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; - +import 'dart:io'; import 'package:flutter_driver/flutter_driver.dart'; Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); - await driver.requestData(null, timeout: const Duration(minutes: 1)); + final String result = + await driver.requestData(null, timeout: const Duration(minutes: 1)); driver.close(); + exit(result == 'pass' ? 0 : 1); } diff --git a/packages/path_provider/pubspec.yaml b/packages/path_provider/pubspec.yaml index d9d39409ae7f..15aa1a07db8b 100644 --- a/packages/path_provider/pubspec.yaml +++ b/packages/path_provider/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider -version: 1.4.3 +version: 1.4.4 flutter: plugin: