diff --git a/tests/lib/html/canvas_pixel_array_type_alias_test.dart b/tests/lib/html/canvas_pixel_array_type_alias_test.dart
index a62e2b50fbb..3c992defe3b 100644
--- a/tests/lib/html/canvas_pixel_array_type_alias_test.dart
+++ b/tests/lib/html/canvas_pixel_array_type_alias_test.dart
@@ -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.7
-
import 'dart:html';
import 'dart:typed_data';
@@ -23,7 +21,7 @@ main() {
int height = 100;
CanvasElement canvas = new CanvasElement(width: width, height: height);
- document.body.append(canvas);
+ document.body!.append(canvas);
CanvasRenderingContext2D context = canvas.context2D;
diff --git a/tests/lib/html/canvas_test.dart b/tests/lib/html/canvas_test.dart
index f2407a02f24..dd3910f69ec 100644
--- a/tests/lib/html/canvas_test.dart
+++ b/tests/lib/html/canvas_test.dart
@@ -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.7
-
library CanvasTest;
import 'dart:html';
@@ -17,7 +15,7 @@ main() {
int height = 100;
canvas = new CanvasElement(width: width, height: height);
- document.body.append(canvas);
+ document.body!.append(canvas);
context = canvas.context2D;
diff --git a/tests/lib/html/client_rect_test.dart b/tests/lib/html/client_rect_test.dart
index 1e99ad85a1c..a02fb0dab68 100644
--- a/tests/lib/html/client_rect_test.dart
+++ b/tests/lib/html/client_rect_test.dart
@@ -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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
@@ -25,7 +23,7 @@ main() {
block of text multiple times to see each line
highlight with every click of the mouse button.
''';
- document.body.append(element);
+ document.body!.append(element);
return element;
}
@@ -38,8 +36,8 @@ main() {
});
test("ClientRect ==", () {
- var rect1 = document.body.getBoundingClientRect();
- var rect2 = document.body.getBoundingClientRect();
+ var rect1 = document.body!.getBoundingClientRect();
+ var rect2 = document.body!.getBoundingClientRect();
expect(rect1, isRectangle);
expect(rect1, isDomRectReadOnly);
expect(rect1, equals(rect2));
diff --git a/tests/lib/html/cross_domain_iframe_test.dart b/tests/lib/html/cross_domain_iframe_test.dart
index f9bc0a43644..2f2aab41784 100644
--- a/tests/lib/html/cross_domain_iframe_test.dart
+++ b/tests/lib/html/cross_domain_iframe_test.dart
@@ -2,22 +2,20 @@
// 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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
main() {
var uri = Uri.parse(window.location.href);
- var crossOriginPort = int.parse(uri.queryParameters['crossOriginPort']);
+ var crossOriginPort = int.parse(uri.queryParameters['crossOriginPort']!);
var crossOrigin = '${uri.scheme}://${uri.host}:$crossOriginPort';
var crossOriginUrl =
'$crossOrigin/root_dart/tests/lib_2/html/cross_domain_iframe_script.html';
var iframe = new IFrameElement();
iframe.src = crossOriginUrl;
- document.body.append(iframe);
+ document.body!.append(iframe);
return window.onMessage
.where((MessageEvent event) {
diff --git a/tests/lib/html/cross_frame_test.dart b/tests/lib/html/cross_frame_test.dart
index 73add2d28cb..def8d7151d1 100644
--- a/tests/lib/html/cross_frame_test.dart
+++ b/tests/lib/html/cross_frame_test.dart
@@ -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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
@@ -17,7 +15,7 @@ main() {
var isHistory = predicate((x) => x is History, 'is a History');
final dynamic iframe = new IFrameElement();
- document.body.append(iframe);
+ document.body!.append(iframe);
test('window', () {
expect(window, isWindow);
diff --git a/tests/lib/html/custom_tags_test.dart b/tests/lib/html/custom_tags_test.dart
index b0e818fbc2d..98b60c2c326 100644
--- a/tests/lib/html/custom_tags_test.dart
+++ b/tests/lib/html/custom_tags_test.dart
@@ -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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
@@ -13,7 +11,7 @@ import 'utils.dart';
main() {
test('create via custom tag', () {
var element = new Element.tag('x-basic1')..id = 'basic1';
- document.body.nodes.add(element);
+ document.body!.nodes.add(element);
var queryById = querySelector('#basic1');
expect(queryById, equals(element));
@@ -27,7 +25,7 @@ main() {
var element = new DivElement();
element.setInnerHtml("",
treeSanitizer: new NullTreeSanitizer());
- document.body.nodes.add(element);
+ document.body!.nodes.add(element);
var queryById = querySelector('#basic2');
expect(queryById is Element, isTrue);
@@ -41,7 +39,7 @@ main() {
var element = new DivElement();
element.setInnerHtml("
",
treeSanitizer: new NullTreeSanitizer());
- document.body.nodes.add(element);
+ document.body!.nodes.add(element);
var queryById = querySelector('#basic3');
expect(queryById is DivElement, isTrue);
diff --git a/tests/lib/html/dart_object_local_storage_test.dart b/tests/lib/html/dart_object_local_storage_test.dart
index dd5f20ba0ab..3c7130bbaec 100644
--- a/tests/lib/html/dart_object_local_storage_test.dart
+++ b/tests/lib/html/dart_object_local_storage_test.dart
@@ -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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
@@ -14,7 +12,7 @@ import 'package:expect/minitest.dart';
// effectively testing dart_object_local_storage in the underlying dom
// object.
main() {
- BodyElement body = document.body;
+ BodyElement body = document.body!;
Storage localStorage = window.localStorage;
Storage sessionStorage = window.sessionStorage;
var element = new Element.tag('canvas');
diff --git a/tests/lib/html/datalistelement_test.dart b/tests/lib/html/datalistelement_test.dart
index 12d26cee661..2a9396d564f 100644
--- a/tests/lib/html/datalistelement_test.dart
+++ b/tests/lib/html/datalistelement_test.dart
@@ -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.7
-
import 'dart:html';
import 'package:expect/minitest.dart';
@@ -16,7 +14,7 @@ main() {
setUp(() {
div = new DivElement();
- document.body.append(div);
+ document.body!.append(div);
div.innerHtml = """