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

Commit 105004d

Browse files
authored
Stop using the List constructor. (#22793)
1 parent 644dd65 commit 105004d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/web_ui/dev/utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,21 +220,21 @@ bool get isVerboseLoggingEnabled => GeneralTestsArgumentParser.instance.verbose;
220220
/// There might be proccesses started during the tests.
221221
///
222222
/// Use this list to store those Processes, for cleaning up before shutdown.
223-
final List<io.Process> processesToCleanUp = List<io.Process>();
223+
final List<io.Process> processesToCleanUp = <io.Process>[];
224224

225225
/// There might be temporary directories created during the tests.
226226
///
227227
/// Use this list to store those directories and for deleteing them before
228228
/// shutdown.
229-
final List<io.Directory> temporaryDirectories = List<io.Directory>();
229+
final List<io.Directory> temporaryDirectories = <io.Directory>[];
230230

231231
typedef AsyncCallback = Future<void> Function();
232232

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

239239
/// Cleanup the remaning processes, close open browsers, delete temp files.
240240
void cleanup() async {

lib/web_ui/test/text/font_collection_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void testMain() {
3030
group('regular special characters', () {
3131
test('Register Asset with no special characters', () async {
3232
final String _testFontFamily = "Ahem";
33-
final List<String> fontFamilyList = List<String>();
33+
final List<String> fontFamilyList = <String>[];
3434

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

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

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

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

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

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

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

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

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

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

172172
fontManager.registerAsset(
173173
testFontFamily, 'url($_testFontUrl)', const <String, String>{});

lib/web_ui/test/text_editing_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@ void checkInputEditingState(
21632163

21642164
/// In case of an exception backup DOM element(s) can still stay on the DOM.
21652165
void clearBackUpDomElementIfExists() {
2166-
List<Node> domElementsToRemove = List<Node>();
2166+
List<Node> domElementsToRemove = <Node>[];
21672167
if (document.getElementsByTagName('input').length > 0) {
21682168
domElementsToRemove..addAll(document.getElementsByTagName('input'));
21692169
}

0 commit comments

Comments
 (0)