Skip to content

Commit 3ea36fd

Browse files
authored
Add regression tests against #2446 (#2495)
1 parent 017ab97 commit 3ea36fd

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

dwds/test/instances/common/instance_common.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,26 @@ void runTests({
238238
expect(inspector.isDisplayableObject(ref), isTrue);
239239
});
240240

241+
// Regression test for https://github.com/dart-lang/webdev/issues/2446.
242+
test(
243+
'for a stream',
244+
() async {
245+
final remoteObject = await inspector.jsEvaluate(
246+
libraryVariableExpression('stream', compilationMode),
247+
);
248+
final ref = await inspector.instanceRefFor(remoteObject);
249+
expect(ref!.kind, InstanceKind.kPlainInstance);
250+
final classRef = ref.classRef!;
251+
expect(classRef.name, '_ControllerStream<int>');
252+
expect(
253+
classRef.id,
254+
'classes|dart:async|_ControllerStream<int>',
255+
);
256+
expect(inspector.isDisplayableObject(ref), isTrue);
257+
},
258+
skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
259+
);
260+
241261
test('for a Dart error', () async {
242262
final remoteObject = await inspector.jsEvaluate(newDartError);
243263
final ref = await inspector.instanceRefFor(remoteObject);
@@ -379,6 +399,22 @@ void runTests({
379399
expect(inspector.isDisplayableObject(instance), isTrue);
380400
});
381401

402+
// Regression test for https://github.com/dart-lang/webdev/issues/2446.
403+
test(
404+
'for a stream',
405+
() async {
406+
final remote = await inspector.jsEvaluate(
407+
libraryVariableExpression('stream', compilationMode),
408+
);
409+
final instance = await inspector.instanceFor(remote);
410+
expect(instance!.kind, InstanceKind.kPlainInstance);
411+
final classRef = instance.classRef!;
412+
expect(classRef.name, '_ControllerStream<int>');
413+
expect(inspector.isDisplayableObject(instance), isTrue);
414+
},
415+
skip: !dartSdkIsAtLeast('3.6.0-148.0.dev'),
416+
);
417+
382418
test('for a Dart error', () async {
383419
final remoteObject = await inspector.jsEvaluate(newDartError);
384420
final instance = await inspector.instanceFor(remoteObject);

fixtures/_testSound/example/scopes/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ var identityMap = <String, int>{};
2121

2222
var map = <Object, Object>{};
2323

24+
final stream = Stream.value(1);
25+
2426
void staticFunction(int formal) {
2527
print(formal); // Breakpoint: staticFunction
2628
}

0 commit comments

Comments
 (0)