dart-sdk/pkg/vm_service/test/get_implementation_fields_rpc_test.dart
Derek Xu d81b48c6b1 [VM/Service] Add private _getImplementationFields procedure
TEST=CI

Change-Id: I4e4871ac4df74cb4daca7ef42a66489b2afbdc64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270260
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-01-23 21:07:23 +00:00

28 lines
1 KiB
Dart

// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
import 'common/test_helper.dart';
Future<Response> getImplementationFields(
VmService service, String isolateId, String objectId) async {
return await service.callMethod("_getImplementationFields",
isolateId: isolateId, args: {"objectId": objectId});
}
var tests = <IsolateTest>[
// A null object.
(VmService service, IsolateRef isolateRef) async {
final isolateId = isolateRef.id!;
final objectId = 'objects/null';
final result = await getImplementationFields(service, isolateId, objectId);
expect(result.json!["type"]!, "ImplementationFields");
expect(result.json!["fields"]!, isEmpty);
},
];
main([args = const <String>[]]) async =>
runIsolateTests(args, tests, 'get_implementation_fields_rpc_test.dart');