[ Service ] Fix various tests for package:dart_runtime_service_vm

- Fixes issue where `streamListen(streamId: 'foo')` didn't result in an
  error when DDS was not present.
- Adds stub for the deprecated `streamCpuSamplesWithUserTag`

Change-Id: Ic18c2b24a103347eee60ee803a873f747dbfee7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
This commit is contained in:
Ben Konyi
2026-04-10 12:04:28 -07:00
committed by Commit Queue
parent d2d28414ef
commit a00e7d39dc
2 changed files with 23 additions and 1 deletions
@@ -25,14 +25,17 @@ final class DartRuntimeServiceVmRpcs {
static const _kGetSupportedProtocols = 'getSupportedProtocols';
static const _kCreateIdZone = 'createIdZone';
static const _kDeleteIdZone = 'deleteIdZone';
static const _kStreamCpuSamplesWithUserTag = 'streamCpuSamplesWithUserTag';
static const _kIsolateId = 'isolateId';
static const _kIdZoneId = 'idZoneId';
static const _kUserTags = 'userTags';
late final rpcs = UnmodifiableListView<ServiceRpcHandler>([
(_kGetSupportedProtocols, getSupportedProtocols),
(_kCreateIdZone, createIdZone),
(_kDeleteIdZone, deleteIdZone),
(_kStreamCpuSamplesWithUserTag, streamCpuSamplesWithUserTag),
]);
/// Returns the list of protocols implemented by the service.
@@ -94,4 +97,15 @@ final class DartRuntimeServiceVmRpcs {
);
return result;
}
/// The `streamCpuSamplesWithUserTag` RPC is deprecated and calling it will
/// cause no effect.
// TODO(https://github.com/dart-lang/sdk/issues/63094): remove for protocol
// version 5.0.
Future<RpcResponse> streamCpuSamplesWithUserTag(
json_rpc_2.Parameters parameters,
) async {
parameters[_kUserTags].asList;
return Success().toJson();
}
}