Skip to content

Commit ce57f19

Browse files
committed
Address comments
1 parent 5ed2390 commit ce57f19

File tree

5 files changed

+19
-25
lines changed

5 files changed

+19
-25
lines changed

dwds/test/instances/common/dot_shorthands_common.dart

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ void runTests({
2828
late String isolateId;
2929
late ScriptRef mainScript;
3030

31-
Future<void> onBreakPoint(breakPointId, body) => testInspector.onBreakPoint(
31+
Future<void> onBreakpoint(
32+
String breakPointId,
33+
Future<void> Function(Event) body,
34+
) => testInspector.onBreakPoint(
3235
stream,
3336
isolateId,
3437
mainScript,
@@ -39,8 +42,8 @@ void runTests({
3942
Future<InstanceRef> getInstanceRef(frame, expression) =>
4043
testInspector.getInstanceRef(isolateId, frame, expression);
4144

42-
group('$compilationMode |', () {
43-
setUpAll(() async {
45+
group('$compilationMode | dot shorthands:', () {
46+
setUp(() async {
4447
setCurrentLogWriter(debug: debug);
4548
await context.setUp(
4649
testSettings: TestSettings(
@@ -58,23 +61,20 @@ void runTests({
5861
isolateId = vm.isolates!.first.id!;
5962
final scripts = await service.getScripts(isolateId);
6063

61-
await service.streamListen('Debug');
62-
stream = service.onEvent('Debug');
64+
await service.streamListen(EventStreams.kDebug);
65+
stream = service.onDebugEvent;
6366

6467
mainScript = scripts.scripts!.firstWhere(
6568
(each) => each.uri!.contains('main.dart'),
6669
);
6770
});
6871

69-
tearDownAll(() async {
72+
tearDown(() async {
7073
await context.tearDown();
7174
});
7275

73-
setUp(() => setCurrentLogWriter(debug: debug));
74-
tearDown(() => service.resume(isolateId));
75-
76-
test('dot shorthands: expression evaluation', () async {
77-
await onBreakPoint('testDotShorthands', (event) async {
76+
test('expression evaluation and single-stepping', () async {
77+
await onBreakpoint('testDotShorthands', (event) async {
7878
final frame = event.topFrame!.index!;
7979

8080
var instanceRef = await getInstanceRef(frame, '(c = .two).value');
@@ -85,11 +85,7 @@ void runTests({
8585

8686
instanceRef = await getInstanceRef(frame, '(c = .four()).value');
8787
expect(instanceRef.valueAsString, '4');
88-
});
89-
});
9088

91-
test('dot shorthands: single-stepping', () async {
92-
await onBreakPoint('testDotShorthands', (event) async {
9389
final scriptBasename = basename(mainScript.uri!);
9490

9591
const lineA = 116;
@@ -121,7 +117,6 @@ void runTests({
121117

122118
final stops = <String>[];
123119
await testInspector.runStepIntoThroughProgramRecordingStops(
124-
stream,
125120
isolateId,
126121
stops,
127122
provider.ddcModuleFormat == ModuleFormat.ddc ? 13 : 12,

dwds/test/instances/common/test_inspector.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class TestInspector {
233233
}
234234

235235
Future<void> runStepIntoThroughProgramRecordingStops(
236-
Stream<Event> debugStream,
237236
String isolateId,
238237

239238
/// A list to which the pause location is added after each single-step.
@@ -248,7 +247,7 @@ class TestInspector {
248247
final completer = Completer<void>();
249248

250249
late StreamSubscription subscription;
251-
subscription = debugStream.listen((event) async {
250+
subscription = service.onDebugEvent.listen((event) async {
252251
if (event.kind == EventKind.kPauseInterrupted) {
253252
final isolate = await service.getIsolate(isolateId);
254253
final frame = isolate.pauseEvent!.topFrame!;

dwds/test/instances/dot_shorthands_amd_canary_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import 'common/dot_shorthands_common.dart';
1616

1717
void main() {
1818
// Enable verbose logging for debugging.
19-
final debug = false;
20-
final canaryFeatures = true;
19+
const debug = false;
20+
const canaryFeatures = true;
2121

2222
group('canary: $canaryFeatures |', () {
2323
final provider = TestSdkConfigurationProvider(

dwds/test/instances/dot_shorthands_amd_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import 'common/dot_shorthands_common.dart';
1616

1717
void main() {
1818
// Enable verbose logging for debugging.
19-
final debug = false;
20-
final canaryFeatures = false;
19+
const debug = false;
20+
const canaryFeatures = false;
2121

2222
group('canary: $canaryFeatures |', () {
2323
final provider = TestSdkConfigurationProvider(

dwds/test/instances/dot_shorthands_ddc_library_bundle_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import 'common/dot_shorthands_common.dart';
1616

1717
void main() {
1818
// Enable verbose logging for debugging.
19-
final debug = false;
20-
final canaryFeatures = true;
21-
final compilationMode = CompilationMode.frontendServer;
19+
const debug = false;
20+
const canaryFeatures = true;
21+
const compilationMode = CompilationMode.frontendServer;
2222

2323
group('canary: $canaryFeatures |', () {
2424
final provider = TestSdkConfigurationProvider(

0 commit comments

Comments
 (0)