-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ VM / Service ] Add isolateFlags property to Isolate JSON response
Flags that can be set in `Dart_IsolateFlags` are now surfaced via the Isolate JSON object returned from the service protocol. Currently only returns boolean flags. Related: #43588 Change-Id: I54a30155778de8612105eb4a5f60f8a222a086b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165403 Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
- Loading branch information
Showing
14 changed files
with
214 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=3.39 | ||
version=3.40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) 2020, 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'; | ||
|
||
var tests = <VMTest>[ | ||
(VmService service) async { | ||
final vm = await service.getVM(); | ||
final result = await service.getIsolate(vm.isolates.first.id); | ||
expect(result.id, startsWith('isolates/')); | ||
expect(result.number, isNotNull); | ||
expect(result.isolateFlags, isNotNull); | ||
expect(result.isolateFlags.length, isPositive); | ||
expect(result.isSystemIsolate, isFalse); | ||
expect(result.json['_originNumber'], result.number); | ||
expect(result.startTime, isPositive); | ||
expect(result.livePorts, isPositive); | ||
expect(result.pauseOnExit, isFalse); | ||
expect(result.pauseEvent.type, 'Event'); | ||
expect(result.error, isNull); | ||
expect(result.json['_numZoneHandles'], isPositive); | ||
expect(result.json['_numScopedHandles'], isPositive); | ||
expect(result.rootLib, isNotNull); | ||
expect(result.libraries.length, isPositive); | ||
expect(result.libraries[0], isNotNull); | ||
expect(result.breakpoints.length, isZero); | ||
expect(result.json['_heaps']['new']['type'], 'HeapSpace'); | ||
expect(result.json['_heaps']['old']['type'], 'HeapSpace'); | ||
}, | ||
|
||
(VmService service) async { | ||
bool caughtException; | ||
try { | ||
await service.getIsolate('badid'); | ||
expect(false, isTrue, reason: 'Unreachable'); | ||
} on RPCError catch (e) { | ||
caughtException = true; | ||
expect(e.code, equals(RPCError.kInvalidParams)); | ||
expect(e.details, "getIsolate: invalid 'isolateId' parameter: badid"); | ||
} | ||
expect(caughtException, isTrue); | ||
}, | ||
|
||
// Plausible isolate id, not found. | ||
(VmService service) async { | ||
try { | ||
await service.getIsolate('isolates/9999999999'); | ||
fail('successfully got isolate with bad ID'); | ||
} on SentinelException catch (e) { | ||
expect(e.sentinel.kind, 'Collected'); | ||
expect(e.sentinel.valueAsString, '<collected>'); | ||
} | ||
}, | ||
]; | ||
|
||
main(args) async => runVMTests(args, tests); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.