diff --git a/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart b/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart index dc8721bb163..31405115394 100644 --- a/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart +++ b/packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart @@ -40,8 +40,8 @@ void main() { // Once the "topLevelFunction" output arrives, we can terminate the app. unawaited( - dap.client.outputEvents - .firstWhere((OutputEventBody output) => output.output.startsWith('topLevelFunction')) + dap.client.output + .firstWhere((String output) => output.startsWith('topLevelFunction')) .whenComplete(() => dap.client.terminate()), ); @@ -70,8 +70,8 @@ void main() { // Once the "topLevelFunction" output arrives, we can terminate the app. unawaited( - dap.client.outputEvents - .firstWhere((OutputEventBody output) => output.output.startsWith('topLevelFunction')) + dap.client.stdoutOutput + .firstWhere((String output) => output.startsWith('topLevelFunction')) .whenComplete(() => dap.client.terminate()), ); @@ -118,7 +118,7 @@ void main() { // Launch the app and wait for it to print "topLevelFunction". await Future.wait(>[ - dap.client.outputEvents.firstWhere((OutputEventBody output) => output.output.startsWith('topLevelFunction')), + dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')), dap.client.start( launch: () => dap.client.launch( cwd: project.dir.path, @@ -130,7 +130,7 @@ void main() { // Capture the next two output events that we expect to be the Reload // notification and then topLevelFunction being printed again. - final Future> outputEventsFuture = dap.client.output + final Future> outputEventsFuture = dap.client.stdoutOutput // But skip any topLevelFunctions that come before the reload. .skipWhile((String output) => output.startsWith('topLevelFunction')) .take(2) @@ -155,7 +155,7 @@ void main() { // Launch the app and wait for it to print "topLevelFunction". await Future.wait(>[ - dap.client.outputEvents.firstWhere((OutputEventBody output) => output.output.startsWith('topLevelFunction')), + dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')), dap.client.start( launch: () => dap.client.launch( cwd: project.dir.path, @@ -167,7 +167,7 @@ void main() { // Capture the next two output events that we expect to be the Restart // notification and then topLevelFunction being printed again. - final Future> outputEventsFuture = dap.client.output + final Future> outputEventsFuture = dap.client.stdoutOutput // But skip any topLevelFunctions that come before the restart. .skipWhile((String output) => output.startsWith('topLevelFunction')) .take(2) @@ -233,8 +233,7 @@ void main() { // Launch the app and wait for it to print "topLevelFunction" so we know // it's up and running. await Future.wait(>[ - dap.client.outputEvents.firstWhere((OutputEventBody output) => - output.output.startsWith('topLevelFunction')), + dap.client.stdoutOutput.firstWhere((String output) => output.startsWith('topLevelFunction')), dap.client.start( launch: () => dap.client.launch( cwd: project.dir.path, diff --git a/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart b/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart index e0513176fcc..9c89c04eee2 100644 --- a/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart +++ b/packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart @@ -63,6 +63,11 @@ class DapTestClient { /// Returns a stream of the string output from [OutputEventBody] events. Stream get output => outputEvents.map((OutputEventBody output) => output.output); + /// Returns a stream of the string output from [OutputEventBody] events with the category 'stdout'. + Stream get stdoutOutput => outputEvents + .where((OutputEventBody output) => output.category == 'stdout') + .map((OutputEventBody output) => output.output); + /// Sends a custom request to the server and waits for a response. Future custom(String name, [Object? args]) async { return sendRequest(args, overrideCommand: name);