Skip to content

Commit 237e104

Browse files
committed
fixed linting - test part2
1 parent a905838 commit 237e104

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

dwds/test/dart_uri_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ void main() {
156156
final logs = <String>[];
157157

158158
void logWriter(
159-
level,
160-
message, {
159+
Object? level,
160+
String message, {
161161
String? error,
162162
String? loggerName,
163163
String? stackTrace,

dwds/test/debug_extension_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main() async {
5050
final title = await context.webDriver.title;
5151
if (title == 'Dart DevTools') return;
5252

53-
await Future.delayed(retryWait);
53+
await Future<void>.delayed(retryWait);
5454
return waitForDartDevToolsWithRetry(
5555
retryCount: retryCount--,
5656
retryWait: retryWait,

dwds/test/debugger_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final sampleSyncFrame = WipCallFrame({
5555
'functionLocation': {'scriptId': '69', 'lineNumber': 88, 'columnNumber': 72},
5656
'location': {'scriptId': '69', 'lineNumber': 37, 'columnNumber': 0},
5757
'url': '',
58-
'scopeChain': [],
58+
'scopeChain': <dynamic>[],
5959
'this': {'type': 'undefined'},
6060
});
6161

@@ -145,10 +145,10 @@ void main() async {
145145
asyncStackTrace: StackTrace({
146146
'callFrames': [sampleAsyncFrame.json],
147147
'parent': StackTrace({
148-
'callFrames': [],
148+
'callFrames': <dynamic>[],
149149
'parent': StackTrace({
150150
'callFrames': [sampleAsyncFrame.json],
151-
'parent': StackTrace({'callFrames': []}).json,
151+
'parent': StackTrace({'callFrames': <dynamic>[]}).json,
152152
}).json,
153153
}).json,
154154
}),

dwds/test/devtools_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Future<void> _waitForPageReady(TestContext context) async {
2424
while (attempt-- > 0) {
2525
final content = await context.webDriver.pageSource;
2626
if (content.contains('hello_world')) return;
27-
await Future.delayed(const Duration(milliseconds: 100));
27+
await Future<void>.delayed(const Duration(milliseconds: 100));
2828
}
2929
throw StateError('Page never initialized');
3030
}
@@ -51,7 +51,7 @@ void main() {
5151
'd',
5252
]);
5353
// Wait for DevTools to actually open.
54-
await Future.delayed(const Duration(seconds: 2));
54+
await Future<void>.delayed(const Duration(seconds: 2));
5555
});
5656

5757
tearDown(() async {
@@ -75,7 +75,7 @@ void main() {
7575
"window.open('$appUrl', '_blank');",
7676
[],
7777
);
78-
await Future.delayed(const Duration(seconds: 2));
78+
await Future<void>.delayed(const Duration(seconds: 2));
7979
final newAppWindow = await context.webDriver.windows.last;
8080
await newAppWindow.setAsActive();
8181

@@ -87,7 +87,7 @@ void main() {
8787
Keyboard.alt,
8888
'd',
8989
]);
90-
await Future.delayed(const Duration(seconds: 2));
90+
await Future<void>.delayed(const Duration(seconds: 2));
9191
final alert = context.webDriver.driver.switchTo.alert;
9292
expect(alert, isNotNull);
9393
expect(
@@ -109,7 +109,7 @@ void main() {
109109
Keyboard.alt,
110110
'd',
111111
]);
112-
await Future.delayed(const Duration(seconds: 2));
112+
await Future<void>.delayed(const Duration(seconds: 2));
113113
windows = await context.webDriver.windows.toList();
114114
final devToolsWindow = windows.firstWhere(
115115
(window) => window != newAppWindow,
@@ -178,7 +178,7 @@ void main() {
178178
test('gives a good error if devtools is not served', () async {
179179
// Try to open devtools and check for the alert.
180180
await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
181-
await Future.delayed(const Duration(seconds: 2));
181+
await Future<void>.delayed(const Duration(seconds: 2));
182182
final alert = context.webDriver.driver.switchTo.alert;
183183
expect(alert, isNotNull);
184184
expect(await alert.text, contains('--debug'));
@@ -208,7 +208,7 @@ void main() {
208208
});
209209
// Try to open devtools and check for the alert.
210210
await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
211-
await Future.delayed(const Duration(seconds: 2));
211+
await Future<void>.delayed(const Duration(seconds: 2));
212212
final alert = context.webDriver.driver.switchTo.alert;
213213
expect(alert, isNotNull);
214214
expect(await alert.text, contains('--debug'));

dwds/test/events_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141

4242
test('emits HTTP_REQUEST_EXCEPTION event', () async {
4343
Future<void> throwAsyncException() async {
44-
await Future.delayed(const Duration(milliseconds: 100));
44+
await Future<void>.delayed(const Duration(milliseconds: 100));
4545
throw Exception('async error');
4646
}
4747

@@ -77,7 +77,7 @@ void main() {
7777

7878
// Ignore the response.
7979
final response = await request.close();
80-
await response.drain();
80+
await response.drain<void>();
8181

8282
// Wait for expected events.
8383
await events;

dwds/test/execution_context_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class TestDebuggerConnection {
187187
/// Return the initial context ID from the DevToolsRequest.
188188
Future<TestContextId> defaultContextId() async {
189189
// Give the previous events time to propagate.
190-
await Future.delayed(Duration(milliseconds: 100));
190+
await Future<void>.delayed(const Duration(milliseconds: 100));
191191
return TestContextId.from(await extensionDebugger.executionContext!.id);
192192
}
193193

@@ -201,7 +201,7 @@ class TestDebuggerConnection {
201201
final executionContextId = extensionDebugger.executionContext!.id;
202202

203203
// Give it time to send the evaluate request.
204-
await Future.delayed(Duration(milliseconds: 100));
204+
await Future<void>.delayed(const Duration(milliseconds: 100));
205205

206206
// Respond to the evaluate request.
207207
_sendEvaluationResponse({
@@ -221,7 +221,7 @@ class TestDebuggerConnection {
221221
final executionContextId = extensionDebugger.executionContext!.id;
222222

223223
// Give it time to send the evaluate request.
224-
await Future.delayed(Duration(milliseconds: 100));
224+
await Future<void>.delayed(const Duration(milliseconds: 100));
225225

226226
// Respond to the evaluate request.
227227
_sendEvaluationResponse({
@@ -297,7 +297,7 @@ class TestDebuggerConnection {
297297

298298
Future<ExecutionContext?> _waitForExecutionContext() async {
299299
while (extensionDebugger.executionContext == null) {
300-
await Future.delayed(Duration(milliseconds: 20));
300+
await Future<void>.delayed(const Duration(milliseconds: 20));
301301
}
302302
return extensionDebugger.executionContext;
303303
}

dwds/test/expression_evaluator_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void main() async {
133133
pausedController.sink.add(
134134
DebuggerPausedEvent({
135135
'method': '',
136-
'params': {'reason': 'other', 'callFrames': []},
136+
'params': {'reason': 'other', 'callFrames': <Object>[]},
137137
}),
138138
);
139139

dwds/test/extension_debugger_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void main() async {
4242
..id = 0
4343
..success = true,
4444
);
45-
final resultCompleter = Completer();
45+
final resultCompleter = Completer<dynamic>();
4646
unawaited(
4747
extensionDebugger
4848
.sendCommand('Runtime.evaluate', params: {'expression': '\$pi'})

0 commit comments

Comments
 (0)