[ 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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user