[flutter_web_plugins] Migrate to null safety. (#69844)

This commit is contained in:
David Iglesias
2020-11-06 15:34:10 -08:00
committed by GitHub
parent 2b512781a0
commit e148bf8785
11 changed files with 79 additions and 103 deletions

View File

@@ -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.8
import 'dart:html';
@TestOn('chrome') // Uses web-only Flutter SDK
@@ -13,16 +11,12 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
void main() {
group('$HashUrlStrategy', () {
TestPlatformLocation location;
late TestPlatformLocation location;
setUp(() {
location = TestPlatformLocation();
});
tearDown(() {
location = null;
});
test('leading slash is optional', () {
final HashUrlStrategy strategy = HashUrlStrategy(location);
@@ -48,16 +42,12 @@ void main() {
});
group('$PathUrlStrategy', () {
TestPlatformLocation location;
late TestPlatformLocation location;
setUp(() {
location = TestPlatformLocation();
});
tearDown(() {
location = null;
});
test('validates base href', () {
location.baseHref = '/';
expect(
@@ -153,7 +143,7 @@ class TestPlatformLocation extends PlatformLocation {
String hash = '';
@override
dynamic state;
Object? Function() state = () => null;
/// Mocks the base href of the document.
String baseHref = '';

View File

@@ -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.8
@TestOn('browser') // Uses web-only Flutter SDK
import 'package:flutter_test/flutter_test.dart';