Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

move integration test to null safety for multiple plugins. #3646

Merged
merged 9 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/connectivity/connectivity/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dependencies:
dev_dependencies:
flutter_driver:
sdk: flutter
test: ^1.16.3
integration_test:
path: ../../../integration_test
sdk: flutter
test: ^1.16.3
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -13,7 +10,7 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Connectivity test driver', () {
Connectivity _connectivity;
late Connectivity _connectivity;

setUpAll(() async {
_connectivity = Connectivity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// TODO(amirh): Remove this once flutter_driver supports null safety.
// https://github.com/flutter/flutter/issues/71379
// @dart = 2.9

import 'dart:convert';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/connectivity/connectivity/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ dev_dependencies:
flutter_driver:
sdk: flutter
test: ^1.16.3
integration_test:
path: ../../integration_test
plugin_platform_interface: ">=1.0.0 <3.0.0"
pedantic: ^1.10.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// 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.

// 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';
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion packages/device_info/device_info/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dev_dependencies:
flutter_driver:
sdk: flutter
integration_test:
path: ../../../integration_test
sdk: flutter
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// 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.

// TODO(cyanglaz): Remove once https://github.com/flutter/flutter/issues/59879 is fixed.
// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dev_dependencies:
flutter_driver:
sdk: flutter
integration_test:
path: ../../../integration_test
sdk: flutter
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 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 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
}

This file was deleted.

2 changes: 0 additions & 2 deletions packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
integration_test:
path: ../../integration_test
mockito: ^5.0.0-nullsafety.7
pedantic: ^1.10.0
plugin_platform_interface: ">=1.0.0 <3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dev_dependencies:
# the parent directory to use the current plugin's version.
path: ../
integration_test:
path: ../../integration_test
sdk: flutter
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.

// @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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.

// @dart = 2.9
import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.

// @dart = 2.9
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:quick_actions/quick_actions.dart';
Expand All @@ -12,7 +11,7 @@ void main() {

testWidgets('Can set shortcuts', (WidgetTester tester) async {
final QuickActions quickActions = QuickActions();
quickActions.initialize(null);
quickActions.initialize((String shortcutType) => {});

const ShortcutItem shortCutItem = ShortcutItem(
type: 'action_one',
Expand Down
2 changes: 1 addition & 1 deletion packages/quick_actions/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dev_dependencies:
flutter_driver:
sdk: flutter
integration_test:
path: ../../integration_test
sdk: flutter
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// 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.

// @dart = 2.9
import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
2 changes: 0 additions & 2 deletions packages/quick_actions/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ dev_dependencies:
test: ^1.16.3
flutter_test:
sdk: flutter
integration_test:
path: ../integration_test
pedantic: ^1.10.0

environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.

// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down Expand Up @@ -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/');
});

Expand All @@ -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/');
});

Expand Down Expand Up @@ -93,7 +91,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);
Expand Down Expand Up @@ -330,7 +328,7 @@ void main() {
});

group('Video playback policy', () {
String videoTestBase64;
late String videoTestBase64;
setUpAll(() async {
final ByteData videoData =
await rootBundle.load('assets/sample_video.mp4');
Expand Down Expand Up @@ -543,7 +541,7 @@ void main() {
});

group('Audio playback policy', () {
String audioTestBase64;
late String audioTestBase64;
setUpAll(() async {
final ByteData audioData =
await rootBundle.load('assets/sample_audio.ogg');
Expand Down Expand Up @@ -749,7 +747,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');
});

Expand Down Expand Up @@ -937,7 +935,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/');
});

Expand Down Expand Up @@ -1026,8 +1024,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')));
});

Expand Down Expand Up @@ -1064,7 +1062,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/');
});
});
Expand All @@ -1091,7 +1089,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/');
});

Expand All @@ -1118,7 +1116,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');
});

Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dev_dependencies:
flutter_driver:
sdk: flutter
integration_test:
path: ../../integration_test
sdk: flutter
pedantic: ^1.10.0

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.

// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:

dev_dependencies:
integration_test:
path: ../../../integration_test
sdk: flutter
flutter_test:
sdk: flutter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -12,7 +11,7 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('$WifiInfo test driver', () {
WifiInfo _wifiInfo;
late WifiInfo _wifiInfo;

setUpAll(() async {
_wifiInfo = WifiInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:convert';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';
Expand Down
Loading