diff --git a/packages/connectivity/connectivity/example/integration_test/connectivity_test.dart b/packages/connectivity/connectivity/example/integration_test/connectivity_test.dart index 454ddd4c351b..ab6e71e23bb6 100644 --- a/packages/connectivity/connectivity/example/integration_test/connectivity_test.dart +++ b/packages/connectivity/connectivity/example/integration_test/connectivity_test.dart @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(cyanglaz): Remove once https://github.com/flutter/plugins/pull/3158 is landed. -// @dart = 2.9 - import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:connectivity/connectivity.dart'; @@ -13,7 +10,7 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('Connectivity test driver', () { - Connectivity _connectivity; + late Connectivity _connectivity; setUpAll(() async { _connectivity = Connectivity(); diff --git a/packages/connectivity/connectivity/example/test_driver/integration_test.dart b/packages/connectivity/connectivity/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/connectivity/connectivity/example/test_driver/integration_test.dart +++ b/packages/connectivity/connectivity/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/connectivity/connectivity/pubspec.yaml b/packages/connectivity/connectivity/pubspec.yaml index 44b135496c96..604e9ad520fc 100644 --- a/packages/connectivity/connectivity/pubspec.yaml +++ b/packages/connectivity/connectivity/pubspec.yaml @@ -30,11 +30,9 @@ dev_dependencies: sdk: flutter flutter_driver: sdk: flutter - test: ^1.16.3 - integration_test: - sdk: flutter plugin_platform_interface: ^2.0.0 pedantic: ^1.10.0 + test: ^1.16.3 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/packages/connectivity/connectivity_macos/example/integration_test/connectivity_test.dart b/packages/connectivity/connectivity_macos/example/integration_test/connectivity_test.dart index c6b05c73cde9..3e2b1c008a84 100644 --- a/packages/connectivity/connectivity_macos/example/integration_test/connectivity_test.dart +++ b/packages/connectivity/connectivity_macos/example/integration_test/connectivity_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'dart:io'; import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -12,7 +11,7 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('Connectivity test driver', () { - ConnectivityPlatform _connectivity; + late ConnectivityPlatform _connectivity; setUpAll(() async { _connectivity = ConnectivityPlatform.instance; diff --git a/packages/connectivity/connectivity_macos/example/test_driver/integration_test.dart b/packages/connectivity/connectivity_macos/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/connectivity/connectivity_macos/example/test_driver/integration_test.dart +++ b/packages/connectivity/connectivity_macos/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/device_info/device_info/example/integration_test/device_info_test.dart b/packages/device_info/device_info/example/integration_test/device_info_test.dart index abb2b5ea0b03..953eb856d62a 100644 --- a/packages/device_info/device_info/example/integration_test/device_info_test.dart +++ b/packages/device_info/device_info/example/integration_test/device_info_test.dart @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(cyanglaz): Remove once https://github.com/flutter/plugins/pull/3158 is landed. -// @dart = 2.9 - import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:device_info/device_info.dart'; @@ -13,8 +10,8 @@ import 'package:integration_test/integration_test.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - IosDeviceInfo iosInfo; - AndroidDeviceInfo androidInfo; + late IosDeviceInfo iosInfo; + late AndroidDeviceInfo androidInfo; setUpAll(() async { final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); diff --git a/packages/device_info/device_info/example/test_driver/integration_test.dart b/packages/device_info/device_info/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/device_info/device_info/example/test_driver/integration_test.dart +++ b/packages/device_info/device_info/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/image_picker/image_picker/example/integration_test/old_image_picker_test.dart b/packages/image_picker/image_picker/example/integration_test/old_image_picker_test.dart index 528c8b9f127a..120c9e221c24 100644 --- a/packages/image_picker/image_picker/example/integration_test/old_image_picker_test.dart +++ b/packages/image_picker/image_picker/example/integration_test/old_image_picker_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test.dart'; void main() { diff --git a/packages/image_picker/image_picker/example/test_driver/integration_test.dart b/packages/image_picker/image_picker/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/image_picker/image_picker/example/test_driver/integration_test.dart +++ b/packages/image_picker/image_picker/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 31adc996da36..4a9e3da77612 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -30,8 +30,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - integration_test: - sdk: flutter mockito: ^5.0.0-nullsafety.7 pedantic: ^1.10.0 plugin_platform_interface: ^2.0.0 diff --git a/packages/in_app_purchase/in_app_purchase/example/integration_test/in_app_purchase_test.dart b/packages/in_app_purchase/in_app_purchase/example/integration_test/in_app_purchase_test.dart index 4a870778a934..437ee99e9f36 100644 --- a/packages/in_app_purchase/in_app_purchase/example/integration_test/in_app_purchase_test.dart +++ b/packages/in_app_purchase/in_app_purchase/example/integration_test/in_app_purchase_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; import 'package:integration_test/integration_test.dart'; diff --git a/packages/in_app_purchase/in_app_purchase/example/test_driver/integration_test.dart b/packages/in_app_purchase/in_app_purchase/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/in_app_purchase/in_app_purchase/example/test_driver/integration_test.dart +++ b/packages/in_app_purchase/in_app_purchase/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/in_app_purchase/in_app_purchase_android/example/integration_test/in_app_purchase_test.dart b/packages/in_app_purchase/in_app_purchase_android/example/integration_test/in_app_purchase_test.dart index b6fdf1d7fabc..8b655306a2b5 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/integration_test/in_app_purchase_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/example/integration_test/in_app_purchase_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase_android/in_app_purchase_android.dart'; import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; diff --git a/packages/in_app_purchase/in_app_purchase_android/example/test_driver/test/integration_test.dart b/packages/in_app_purchase/in_app_purchase_android/example/test_driver/test/integration_test.dart index 4c4c006068b8..4f10f2a522f3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/test_driver/test/integration_test.dart +++ b/packages/in_app_purchase/in_app_purchase_android/example/test_driver/test/integration_test.dart @@ -2,17 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'package:flutter_driver/flutter_driver.dart'; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - final String data = - await driver.requestData(null, timeout: const Duration(minutes: 1)); - await driver.close(); - final Map result = jsonDecode(data); - exit(result['result'] == 'true' ? 0 : 1); -} +Future main() => integrationDriver(); diff --git a/packages/in_app_purchase/in_app_purchase_ios/example/integration_test/in_app_purchase_test.dart b/packages/in_app_purchase/in_app_purchase_ios/example/integration_test/in_app_purchase_test.dart index e626f4f074a6..3d68d0f1f4f0 100644 --- a/packages/in_app_purchase/in_app_purchase_ios/example/integration_test/in_app_purchase_test.dart +++ b/packages/in_app_purchase/in_app_purchase_ios/example/integration_test/in_app_purchase_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase_ios/in_app_purchase_ios.dart'; import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; diff --git a/packages/in_app_purchase/in_app_purchase_ios/example/test_driver/test/integration_test.dart b/packages/in_app_purchase/in_app_purchase_ios/example/test_driver/test/integration_test.dart index 4c4c006068b8..4f10f2a522f3 100644 --- a/packages/in_app_purchase/in_app_purchase_ios/example/test_driver/test/integration_test.dart +++ b/packages/in_app_purchase/in_app_purchase_ios/example/test_driver/test/integration_test.dart @@ -2,17 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'package:flutter_driver/flutter_driver.dart'; +import 'package:integration_test/integration_test_driver.dart'; -Future main() async { - final FlutterDriver driver = await FlutterDriver.connect(); - final String data = - await driver.requestData(null, timeout: const Duration(minutes: 1)); - await driver.close(); - final Map result = jsonDecode(data); - exit(result['result'] == 'true' ? 0 : 1); -} +Future main() => integrationDriver(); diff --git a/packages/quick_actions/quick_actions/example/integration_test/quick_actions_test.dart b/packages/quick_actions/quick_actions/example/integration_test/quick_actions_test.dart index cfe3eb0db656..9539b46ed883 100644 --- a/packages/quick_actions/quick_actions/example/integration_test/quick_actions_test.dart +++ b/packages/quick_actions/quick_actions/example/integration_test/quick_actions_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:quick_actions/quick_actions.dart'; @@ -12,7 +11,7 @@ void main() { testWidgets('Can set shortcuts', (WidgetTester tester) async { final QuickActions quickActions = QuickActions(); - await quickActions.initialize(null); + await quickActions.initialize((String shortcutType) => {}); const ShortcutItem shortCutItem = ShortcutItem( type: 'action_one', diff --git a/packages/quick_actions/quick_actions/example/test_driver/integration_test.dart b/packages/quick_actions/quick_actions/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/quick_actions/quick_actions/example/test_driver/integration_test.dart +++ b/packages/quick_actions/quick_actions/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/quick_actions/quick_actions/pubspec.yaml b/packages/quick_actions/quick_actions/pubspec.yaml index 52a97b9e842c..f4693d4d69d7 100644 --- a/packages/quick_actions/quick_actions/pubspec.yaml +++ b/packages/quick_actions/quick_actions/pubspec.yaml @@ -27,8 +27,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - integration_test: - sdk: flutter - mockito: ^5.0.0-nullsafety.7 + mockito: ^5.0.0 pedantic: ^1.11.0 plugin_platform_interface: ^2.0.0 diff --git a/packages/webview_flutter/example/integration_test/webview_flutter_test.dart b/packages/webview_flutter/example/integration_test/webview_flutter_test.dart index ff4437589f7a..4b9fecaee8a1 100644 --- a/packages/webview_flutter/example/integration_test/webview_flutter_test.dart +++ b/packages/webview_flutter/example/integration_test/webview_flutter_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 - import 'dart:async'; import 'dart:convert'; import 'dart:io'; @@ -36,7 +34,7 @@ void main() { ), ); final WebViewController controller = await controllerCompleter.future; - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://flutter.dev/'); }); @@ -57,7 +55,7 @@ void main() { ); final WebViewController controller = await controllerCompleter.future; await controller.loadUrl('https://www.google.com/'); - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://www.google.com/'); }); @@ -91,7 +89,7 @@ void main() { }; await controller.loadUrl('https://flutter-header-echo.herokuapp.com/', headers: headers); - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://flutter-header-echo.herokuapp.com/'); await pageStarts.stream.firstWhere((String url) => url == currentUrl); @@ -328,7 +326,7 @@ void main() { }); group('Video playback policy', () { - String videoTestBase64; + late String videoTestBase64; setUpAll(() async { final ByteData videoData = await rootBundle.load('assets/sample_video.mp4'); @@ -587,7 +585,7 @@ void main() { }); group('Audio playback policy', () { - String audioTestBase64; + late String audioTestBase64; setUpAll(() async { final ByteData audioData = await rootBundle.load('assets/sample_audio.ogg'); @@ -793,7 +791,7 @@ void main() { await pageStarted.future; await pageLoaded.future; - final String title = await controller.getTitle(); + final String? title = await controller.getTitle(); expect(title, 'Some title'); }); @@ -1094,7 +1092,7 @@ void main() { .evaluateJavascript('location.href = "https://www.google.com/"'); await pageLoads.stream.first; // Wait for the next page load. - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://www.google.com/'); }); @@ -1123,7 +1121,7 @@ void main() { expect(error.failingUrl, isNull); } else if (Platform.isAndroid) { expect(error.errorType, isNotNull); - expect(error.failingUrl.startsWith('https://www.notawebsite..com'), + expect(error.failingUrl?.startsWith('https://www.notawebsite..com'), isTrue); } }); @@ -1184,8 +1182,8 @@ void main() { // blocked. Still wait for a potential page change for some time in order // to give the test a chance to fail. await pageLoads.stream.first - .timeout(const Duration(milliseconds: 500), onTimeout: () => null); - final String currentUrl = await controller.currentUrl(); + .timeout(const Duration(milliseconds: 500), onTimeout: () => ''); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, isNot(contains('youtube.com'))); }); @@ -1222,7 +1220,7 @@ void main() { .evaluateJavascript('location.href = "https://www.google.com"'); await pageLoads.stream.first; // Wait for second page to load. - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://www.google.com/'); }); }); @@ -1249,7 +1247,7 @@ void main() { ), ); final WebViewController controller = await controllerCompleter.future; - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'https://flutter.dev/'); }); @@ -1276,7 +1274,7 @@ void main() { final WebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript('window.open("about:blank", "_blank")'); await pageLoaded.future; - final String currentUrl = await controller.currentUrl(); + final String? currentUrl = await controller.currentUrl(); expect(currentUrl, 'about:blank'); }); diff --git a/packages/webview_flutter/example/test_driver/integration_test.dart b/packages/webview_flutter/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/webview_flutter/example/test_driver/integration_test.dart +++ b/packages/webview_flutter/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/wifi_info_flutter/wifi_info_flutter/example/integration_test/wifi_info_test.dart b/packages/wifi_info_flutter/wifi_info_flutter/example/integration_test/wifi_info_test.dart index e72db0a9f7b0..8190062e3ebd 100644 --- a/packages/wifi_info_flutter/wifi_info_flutter/example/integration_test/wifi_info_test.dart +++ b/packages/wifi_info_flutter/wifi_info_flutter/example/integration_test/wifi_info_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 - import 'dart:io'; import 'package:integration_test/integration_test.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -13,7 +11,7 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('$WifiInfo test driver', () { - WifiInfo _wifiInfo; + late WifiInfo _wifiInfo; setUpAll(() async { _wifiInfo = WifiInfo(); diff --git a/packages/wifi_info_flutter/wifi_info_flutter/example/test_driver/integration_test.dart b/packages/wifi_info_flutter/wifi_info_flutter/example/test_driver/integration_test.dart index 6a0e6fa82dbe..4f10f2a522f3 100644 --- a/packages/wifi_info_flutter/wifi_info_flutter/example/test_driver/integration_test.dart +++ b/packages/wifi_info_flutter/wifi_info_flutter/example/test_driver/integration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart=2.9 - import 'package:integration_test/integration_test_driver.dart'; Future main() => integrationDriver(); diff --git a/packages/wifi_info_flutter/wifi_info_flutter/pubspec.yaml b/packages/wifi_info_flutter/wifi_info_flutter/pubspec.yaml index 2562389d0813..91aa93eceb06 100644 --- a/packages/wifi_info_flutter/wifi_info_flutter/pubspec.yaml +++ b/packages/wifi_info_flutter/wifi_info_flutter/pubspec.yaml @@ -13,8 +13,6 @@ dependencies: wifi_info_flutter_platform_interface: ^2.0.0 dev_dependencies: - integration_test: - sdk: flutter flutter_test: sdk: flutter