Stop using the List constructor. (flutter/engine#22793)

This commit is contained in:
Lasse R.H. Nielsen
2020-12-02 20:53:01 +01:00
committed by GitHub
parent 7055732455
commit bcb3c39d79
3 changed files with 11 additions and 11 deletions

View File

@@ -220,13 +220,13 @@ bool get isVerboseLoggingEnabled => GeneralTestsArgumentParser.instance.verbose;
/// There might be proccesses started during the tests. /// There might be proccesses started during the tests.
/// ///
/// Use this list to store those Processes, for cleaning up before shutdown. /// Use this list to store those Processes, for cleaning up before shutdown.
final List<io.Process> processesToCleanUp = List<io.Process>(); final List<io.Process> processesToCleanUp = <io.Process>[];
/// There might be temporary directories created during the tests. /// There might be temporary directories created during the tests.
/// ///
/// Use this list to store those directories and for deleteing them before /// Use this list to store those directories and for deleteing them before
/// shutdown. /// shutdown.
final List<io.Directory> temporaryDirectories = List<io.Directory>(); final List<io.Directory> temporaryDirectories = <io.Directory>[];
typedef AsyncCallback = Future<void> Function(); typedef AsyncCallback = Future<void> Function();
@@ -234,7 +234,7 @@ typedef AsyncCallback = Future<void> Function();
/// ///
/// Add these operations here to make sure that they will run before felt /// Add these operations here to make sure that they will run before felt
/// exit. /// exit.
final List<AsyncCallback> cleanupCallbacks = List<AsyncCallback>(); final List<AsyncCallback> cleanupCallbacks = <AsyncCallback>[];
/// Cleanup the remaning processes, close open browsers, delete temp files. /// Cleanup the remaning processes, close open browsers, delete temp files.
void cleanup() async { void cleanup() async {

View File

@@ -30,7 +30,7 @@ void testMain() {
group('regular special characters', () { group('regular special characters', () {
test('Register Asset with no special characters', () async { test('Register Asset with no special characters', () async {
final String _testFontFamily = "Ahem"; final String _testFontFamily = "Ahem";
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -48,7 +48,7 @@ void testMain() {
test('Register Asset with white space in the family name', () async { test('Register Asset with white space in the family name', () async {
final String _testFontFamily = "Ahem ahem ahem"; final String _testFontFamily = "Ahem ahem ahem";
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -68,7 +68,7 @@ void testMain() {
test('Register Asset with capital case letters', () async { test('Register Asset with capital case letters', () async {
final String _testFontFamily = "AhEm"; final String _testFontFamily = "AhEm";
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -88,7 +88,7 @@ void testMain() {
group('fonts with special characters', () { group('fonts with special characters', () {
test('Register Asset twice with special character slash', () async { test('Register Asset twice with special character slash', () async {
final String _testFontFamily = '/Ahem'; final String _testFontFamily = '/Ahem';
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -114,7 +114,7 @@ void testMain() {
test('Register Asset twice with exclamation mark', () async { test('Register Asset twice with exclamation mark', () async {
final String _testFontFamily = 'Ahem!!ahem'; final String _testFontFamily = 'Ahem!!ahem';
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -140,7 +140,7 @@ void testMain() {
test('Register Asset twice with comma', () async { test('Register Asset twice with comma', () async {
final String _testFontFamily = 'Ahem ,ahem'; final String _testFontFamily = 'Ahem ,ahem';
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{}); _testFontFamily, 'url($_testFontUrl)', const <String, String>{});
@@ -167,7 +167,7 @@ void testMain() {
test('Register Asset twice with a digit at the start of a token', test('Register Asset twice with a digit at the start of a token',
() async { () async {
final String testFontFamily = 'Ahem 1998'; final String testFontFamily = 'Ahem 1998';
final List<String> fontFamilyList = List<String>(); final List<String> fontFamilyList = <String>[];
fontManager.registerAsset( fontManager.registerAsset(
testFontFamily, 'url($_testFontUrl)', const <String, String>{}); testFontFamily, 'url($_testFontUrl)', const <String, String>{});

View File

@@ -2163,7 +2163,7 @@ void checkInputEditingState(
/// In case of an exception backup DOM element(s) can still stay on the DOM. /// In case of an exception backup DOM element(s) can still stay on the DOM.
void clearBackUpDomElementIfExists() { void clearBackUpDomElementIfExists() {
List<Node> domElementsToRemove = List<Node>(); List<Node> domElementsToRemove = <Node>[];
if (document.getElementsByTagName('input').length > 0) { if (document.getElementsByTagName('input').length > 0) {
domElementsToRemove..addAll(document.getElementsByTagName('input')); domElementsToRemove..addAll(document.getElementsByTagName('input'));
} }