Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixed linting - test part2
  • Loading branch information
jyameo committed Dec 1, 2025
commit 237e104ee97573d97dee7be05d2ef9b50ea1a344
4 changes: 2 additions & 2 deletions dwds/test/dart_uri_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ void main() {
final logs = <String>[];

void logWriter(
level,
message, {
Object? level,
String message, {
String? error,
String? loggerName,
String? stackTrace,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/debug_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void main() async {
final title = await context.webDriver.title;
if (title == 'Dart DevTools') return;

await Future.delayed(retryWait);
await Future<void>.delayed(retryWait);
return waitForDartDevToolsWithRetry(
retryCount: retryCount--,
retryWait: retryWait,
Expand Down
6 changes: 3 additions & 3 deletions dwds/test/debugger_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final sampleSyncFrame = WipCallFrame({
'functionLocation': {'scriptId': '69', 'lineNumber': 88, 'columnNumber': 72},
'location': {'scriptId': '69', 'lineNumber': 37, 'columnNumber': 0},
'url': '',
'scopeChain': [],
'scopeChain': <dynamic>[],
'this': {'type': 'undefined'},
});

Expand Down Expand Up @@ -145,10 +145,10 @@ void main() async {
asyncStackTrace: StackTrace({
'callFrames': [sampleAsyncFrame.json],
'parent': StackTrace({
'callFrames': [],
'callFrames': <dynamic>[],
'parent': StackTrace({
'callFrames': [sampleAsyncFrame.json],
'parent': StackTrace({'callFrames': []}).json,
'parent': StackTrace({'callFrames': <dynamic>[]}).json,
}).json,
}).json,
}),
Expand Down
14 changes: 7 additions & 7 deletions dwds/test/devtools_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Future<void> _waitForPageReady(TestContext context) async {
while (attempt-- > 0) {
final content = await context.webDriver.pageSource;
if (content.contains('hello_world')) return;
await Future.delayed(const Duration(milliseconds: 100));
await Future<void>.delayed(const Duration(milliseconds: 100));
}
throw StateError('Page never initialized');
}
Expand All @@ -51,7 +51,7 @@ void main() {
'd',
]);
// Wait for DevTools to actually open.
await Future.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
});

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

Expand All @@ -87,7 +87,7 @@ void main() {
Keyboard.alt,
'd',
]);
await Future.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
final alert = context.webDriver.driver.switchTo.alert;
expect(alert, isNotNull);
expect(
Expand All @@ -109,7 +109,7 @@ void main() {
Keyboard.alt,
'd',
]);
await Future.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
windows = await context.webDriver.windows.toList();
final devToolsWindow = windows.firstWhere(
(window) => window != newAppWindow,
Expand Down Expand Up @@ -178,7 +178,7 @@ void main() {
test('gives a good error if devtools is not served', () async {
// Try to open devtools and check for the alert.
await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
await Future.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
final alert = context.webDriver.driver.switchTo.alert;
expect(alert, isNotNull);
expect(await alert.text, contains('--debug'));
Expand Down Expand Up @@ -208,7 +208,7 @@ void main() {
});
// Try to open devtools and check for the alert.
await context.webDriver.driver.keyboard.sendChord([Keyboard.alt, 'd']);
await Future.delayed(const Duration(seconds: 2));
await Future<void>.delayed(const Duration(seconds: 2));
final alert = context.webDriver.driver.switchTo.alert;
expect(alert, isNotNull);
expect(await alert.text, contains('--debug'));
Expand Down
4 changes: 2 additions & 2 deletions dwds/test/events_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {

test('emits HTTP_REQUEST_EXCEPTION event', () async {
Future<void> throwAsyncException() async {
await Future.delayed(const Duration(milliseconds: 100));
await Future<void>.delayed(const Duration(milliseconds: 100));
throw Exception('async error');
}

Expand Down Expand Up @@ -77,7 +77,7 @@ void main() {

// Ignore the response.
final response = await request.close();
await response.drain();
await response.drain<void>();

// Wait for expected events.
await events;
Expand Down
8 changes: 4 additions & 4 deletions dwds/test/execution_context_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class TestDebuggerConnection {
/// Return the initial context ID from the DevToolsRequest.
Future<TestContextId> defaultContextId() async {
// Give the previous events time to propagate.
await Future.delayed(Duration(milliseconds: 100));
await Future<void>.delayed(const Duration(milliseconds: 100));
return TestContextId.from(await extensionDebugger.executionContext!.id);
}

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

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

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

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

// Respond to the evaluate request.
_sendEvaluationResponse({
Expand Down Expand Up @@ -297,7 +297,7 @@ class TestDebuggerConnection {

Future<ExecutionContext?> _waitForExecutionContext() async {
while (extensionDebugger.executionContext == null) {
await Future.delayed(Duration(milliseconds: 20));
await Future<void>.delayed(const Duration(milliseconds: 20));
}
return extensionDebugger.executionContext;
}
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/expression_evaluator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void main() async {
pausedController.sink.add(
DebuggerPausedEvent({
'method': '',
'params': {'reason': 'other', 'callFrames': []},
'params': {'reason': 'other', 'callFrames': <Object>[]},
}),
);

Expand Down
2 changes: 1 addition & 1 deletion dwds/test/extension_debugger_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void main() async {
..id = 0
..success = true,
);
final resultCompleter = Completer();
final resultCompleter = Completer<dynamic>();
unawaited(
extensionDebugger
.sendCommand('Runtime.evaluate', params: {'expression': '\$pi'})
Expand Down