Skip to content

Commit

Permalink
replaced wildcard with timer
Browse files Browse the repository at this point in the history
  • Loading branch information
jyameo committed Jan 16, 2025
1 parent aa38d3a commit d4ec13f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
32 changes: 14 additions & 18 deletions dwds/test/common/chrome_proxy_service_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1542,24 +1542,20 @@ void runTests({
expect(first.code!.name, 'printCount');
});

test(
'stack has a variable',
() async {
final stack = await breakAt('callPrintCount');
expect(stack, isNotNull);
expect(stack.frames, hasLength(1));
final first = stack.frames!.first;
expect(first.kind, 'Regular');
expect(first.code!.kind, 'Dart');
expect(first.code!.name, '<closure>');
// TODO: Make this more precise once this case doesn't
// also include all the libraries.
expect(first.vars, hasLength(greaterThanOrEqualTo(1)));
final underscore = first.vars!.firstWhere((v) => v.name == '_');
expect(underscore, isNotNull);
},
skip: 'https://github.com/dart-lang/webdev/issues/2570',
);
test('stack has a variable', () async {
final stack = await breakAt('callPrintCount');
expect(stack, isNotNull);
expect(stack.frames, hasLength(1));
final first = stack.frames!.first;
expect(first.kind, 'Regular');
expect(first.code!.kind, 'Dart');
expect(first.code!.name, '<closure>');
// TODO: Make this more precise once this case doesn't
// also include all the libraries.
expect(first.vars, hasLength(greaterThanOrEqualTo(1)));
final underscore = first.vars!.firstWhere((v) => v.name == 'timer');
expect(underscore, isNotNull);
});

test('collects async frames', () async {
final stack = await breakAt('asyncCall');
Expand Down
2 changes: 1 addition & 1 deletion fixtures/_testSound/example/hello_world/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void main() async {
scheduleMicrotask(() => throw Exception('UncaughtException'));
};

Timer.periodic(const Duration(seconds: 1), (_) {
Timer.periodic(const Duration(seconds: 1), (timer) {
printCount(); // Breakpoint: callPrintCount
});

Expand Down

0 comments on commit d4ec13f

Please sign in to comment.