Unverified Commit 1b477595 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Revert "[null-safety] enable null assertions for framework tests (#64071)" (#64118)

This reverts commit acdb909f.
parent d6c254be
......@@ -538,7 +538,7 @@ Future<void> _runAddToAppLifeCycleTests() async {
Future<void> _runFrameworkTests() async {
final bq.BigqueryApi bigqueryApi = await _getBigqueryApi();
final List<String> nullSafetyOptions = <String>['--enable-experiment=non-nullable', '--null-assertions'];
final List<String> nullSafetyOptions = <String>['--enable-experiment=non-nullable'];
final List<String> trackWidgetCreationAlternatives = <String>['--track-widget-creation', '--no-track-widget-creation'];
Future<void> runWidgets() async {
......
......@@ -36,7 +36,7 @@ class RawKeyEventDataWeb extends RawKeyEventData {
///
/// See <https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key>
/// for more information.
final String? key;
final String key;
/// The modifiers that were present when the key event occurred.
///
......@@ -56,7 +56,7 @@ class RawKeyEventDataWeb extends RawKeyEventData {
final int metaState;
@override
String? get keyLabel => key;
String get keyLabel => key;
@override
PhysicalKeyboardKey get physicalKey {
......
......@@ -149,7 +149,7 @@ void main() {
test('TextPainter error test', () {
final TextPainter painter = TextPainter(textDirection: TextDirection.ltr);
expect(() { painter.paint(null, Offset.zero); }, anyOf(throwsFlutterError, throwsAssertionError));
expect(() { painter.paint(null, Offset.zero); }, throwsFlutterError);
});
test('TextPainter requires textDirection', () {
......
......@@ -6,7 +6,8 @@
import 'package:flutter/painting.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import '../flutter_test_alternative.dart';
void main() {
test('TextSpan equals', () {
......@@ -43,6 +44,7 @@ void main() {
TextSpan(),
],
),
null,
TextSpan(
text: 'c',
),
......@@ -57,6 +59,7 @@ void main() {
' "b"\n'
' TextSpan:\n'
' (empty)\n'
' <null child>\n'
' TextSpan:\n'
' "c"\n'
));
......@@ -242,7 +245,21 @@ void main() {
null,
],
);
expect(() => text.computeToPlainText(StringBuffer()), anyOf(throwsFlutterError, throwsAssertionError));
FlutterError error;
try {
text.computeToPlainText(StringBuffer());
} on FlutterError catch (e) {
error = e;
}
expect(error, isNotNull);
expect(error.toStringDeep(),
'FlutterError\n'
' TextSpan contains a null child.\n'
' A TextSpan object with a non-null child list should not have any\n'
' nulls in its child list.\n'
' The full text in question was:\n'
' TextSpan("foo bar")\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