Unverified Commit 0c796599 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] make most integration tests null safe (#70334)

parent b5a4d089
......@@ -12,7 +12,7 @@ class BackgroundProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -62,7 +62,7 @@ class RepeatingBackgroundProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class BasicProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -63,7 +63,7 @@ class BasicProjectWithFlutterGen extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -75,6 +75,8 @@ class BasicProjectWithFlutterGen extends Project {
@override
final String main = r'''
// @dart = 2.8
// generated package does not syupport null safety.
import 'dart:async';
import 'package:flutter_gen/flutter_gen.dart';
......@@ -88,7 +90,7 @@ class BasicProjectWithUnaryMain extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
sdk: flutter
......
......@@ -47,6 +47,8 @@ dependencies:
@override
final String main = r'''
// @dart = 2.8
// generated localizations do not support null safety.
import 'package:flutter/material.dart';
import 'l10n/app_localizations.dart';
......
......@@ -10,7 +10,7 @@ class HotReloadConstProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -26,8 +26,8 @@ class HotReloadConstProject extends Project {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(const MyApp());
}
......
......@@ -10,7 +10,7 @@ class HotReloadProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -26,8 +26,8 @@ class HotReloadProject extends Project {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(MyApp());
}
......@@ -51,8 +51,8 @@ class HotReloadProject extends Project {
// breakpoint.
// tick 3 = second hot reload warmup reassemble frame (pre breakpoint)
if (count == 2) {
SchedulerBinding.instance.scheduleFrameCallback((Duration timestamp) {
SchedulerBinding.instance.scheduleFrameCallback((Duration timestamp) {
SchedulerBinding.instance!.scheduleFrameCallback((Duration timestamp) {
SchedulerBinding.instance!.scheduleFrameCallback((Duration timestamp) {
print('breakpoint line'); // SCHEDULED BREAKPOINT
});
});
......
......@@ -10,7 +10,7 @@ class HotReloadWithAssetProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -29,8 +29,8 @@ import 'package:flutter/widgets.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(MyApp());
}
......
......@@ -10,7 +10,7 @@ class ProjectWithEarlyError extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class ProjectWithImmediateExit extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -10,7 +10,7 @@ class SingleWidgetReloadProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -26,8 +26,8 @@ class SingleWidgetReloadProject extends Project {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(MyApp());
}
......
......@@ -10,7 +10,7 @@ class HotReloadProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -29,8 +29,8 @@ class HotReloadProject extends Project {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed');
await ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
final ByteData message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
runApp(MyApp());
}
......
......@@ -9,7 +9,7 @@ class SteppingProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: '>=2.10.0 <3.0.0'
sdk: '>=2.12.0-0 <3.0.0'
dependencies:
flutter:
sdk: flutter
......
......@@ -10,7 +10,7 @@ class TestProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......
......@@ -14,7 +14,7 @@ class TestsProject extends Project {
final String pubspec = '''
name: test
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
dependencies:
flutter:
......@@ -29,7 +29,6 @@ class TestsProject extends Project {
String get main => '// Unused';
final String testContent = r'''
// @dart = 2.8
import 'package:flutter_test/flutter_test.dart';
void main() {
......
......@@ -369,7 +369,7 @@ abstract class FlutterTestDriver {
} else if (!ignoreAppStopEvent && json['event'] == 'app.stop') {
await subscription.cancel();
final StringBuffer error = StringBuffer();
error.write('Received app.stop event while waiting for $interestingOccurrence\n\n');
error.write('Received app.stop event while waiting for $interestingOccurrence\n\n$_errorBuffer');
if (json['params'] != null && json['params']['error'] != null) {
error.write('${json['params']['error']}\n\n');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment