Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Stop using the List constructor. #22793

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/web_ui/dev/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,21 +220,21 @@ bool get isVerboseLoggingEnabled => GeneralTestsArgumentParser.instance.verbose;
/// There might be proccesses started during the tests.
///
/// 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.
///
/// Use this list to store those directories and for deleteing them before
/// shutdown.
final List<io.Directory> temporaryDirectories = List<io.Directory>();
final List<io.Directory> temporaryDirectories = <io.Directory>[];

typedef AsyncCallback = Future<void> Function();

/// There might be additional cleanup needs to be done after the tools ran.
///
/// Add these operations here to make sure that they will run before felt
/// exit.
final List<AsyncCallback> cleanupCallbacks = List<AsyncCallback>();
final List<AsyncCallback> cleanupCallbacks = <AsyncCallback>[];

/// Cleanup the remaning processes, close open browsers, delete temp files.
void cleanup() async {
Expand Down
14 changes: 7 additions & 7 deletions lib/web_ui/test/text/font_collection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void testMain() {
group('regular special characters', () {
test('Register Asset with no special characters', () async {
final String _testFontFamily = "Ahem";
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -48,7 +48,7 @@ void testMain() {

test('Register Asset with white space in the family name', () async {
final String _testFontFamily = "Ahem ahem ahem";
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -68,7 +68,7 @@ void testMain() {

test('Register Asset with capital case letters', () async {
final String _testFontFamily = "AhEm";
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -88,7 +88,7 @@ void testMain() {
group('fonts with special characters', () {
test('Register Asset twice with special character slash', () async {
final String _testFontFamily = '/Ahem';
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -114,7 +114,7 @@ void testMain() {

test('Register Asset twice with exclamation mark', () async {
final String _testFontFamily = 'Ahem!!ahem';
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -140,7 +140,7 @@ void testMain() {

test('Register Asset twice with comma', () async {
final String _testFontFamily = 'Ahem ,ahem';
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
_testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand All @@ -167,7 +167,7 @@ void testMain() {
test('Register Asset twice with a digit at the start of a token',
() async {
final String testFontFamily = 'Ahem 1998';
final List<String> fontFamilyList = List<String>();
final List<String> fontFamilyList = <String>[];

fontManager.registerAsset(
testFontFamily, 'url($_testFontUrl)', const <String, String>{});
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/text_editing_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ void checkInputEditingState(

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