Skip to content

Commit

Permalink
Add regression tests against #2446 (#2495)
Browse files Browse the repository at this point in the history
  • Loading branch information
derekxu16 authored Sep 26, 2024
1 parent 017ab97 commit 3ea36fd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
36 changes: 36 additions & 0 deletions dwds/test/instances/common/instance_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,26 @@ void runTests({
expect(inspector.isDisplayableObject(ref), isTrue);
});

// Regression test for https://github.com/dart-lang/webdev/issues/2446.
test(
'for a stream',
() async {
final remoteObject = await inspector.jsEvaluate(
libraryVariableExpression('stream', compilationMode),
);
final ref = await inspector.instanceRefFor(remoteObject);
expect(ref!.kind, InstanceKind.kPlainInstance);
final classRef = ref.classRef!;
expect(classRef.name, '_ControllerStream<int>');
expect(
classRef.id,
'classes|dart:async|_ControllerStream<int>',
);
expect(inspector.isDisplayableObject(ref), isTrue);
},
skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
);

test('for a Dart error', () async {
final remoteObject = await inspector.jsEvaluate(newDartError);
final ref = await inspector.instanceRefFor(remoteObject);
Expand Down Expand Up @@ -379,6 +399,22 @@ void runTests({
expect(inspector.isDisplayableObject(instance), isTrue);
});

// Regression test for https://github.com/dart-lang/webdev/issues/2446.
test(
'for a stream',
() async {
final remote = await inspector.jsEvaluate(
libraryVariableExpression('stream', compilationMode),
);
final instance = await inspector.instanceFor(remote);
expect(instance!.kind, InstanceKind.kPlainInstance);
final classRef = instance.classRef!;
expect(classRef.name, '_ControllerStream<int>');
expect(inspector.isDisplayableObject(instance), isTrue);
},
skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
);

test('for a Dart error', () async {
final remoteObject = await inspector.jsEvaluate(newDartError);
final instance = await inspector.instanceFor(remoteObject);
Expand Down
2 changes: 2 additions & 0 deletions fixtures/_testSound/example/scopes/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ var identityMap = <String, int>{};

var map = <Object, Object>{};

final stream = Stream.value(1);

void staticFunction(int formal) {
print(formal); // Breakpoint: staticFunction
}
Expand Down

0 comments on commit 3ea36fd

Please sign in to comment.