Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: runtime/observatory/tests/service/get_object_rpc_test.dart

Issue 1150103005: Provide a logical view of VM-internal maps in Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/get_object_rpc_test.dart
diff --git a/runtime/observatory/tests/service/get_object_rpc_test.dart b/runtime/observatory/tests/service/get_object_rpc_test.dart
index d95346e36d201a36374f489fc6b99187deadd927..5cff0389832eb467c198c8dba9f8252f4fc22b3f 100644
--- a/runtime/observatory/tests/service/get_object_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_object_rpc_test.dart
@@ -106,6 +106,38 @@ var tests = [
expect(result['elements'][0]['value']['valueAsString'], equals('3'));
},
+ // A built-in Map.
+ (Isolate isolate) async {
+ // Call eval to get a Dart map.
+ var evalResult = await eval(isolate, '{"x": 3, "y": 4}');
+ var params = {
+ 'objectId': evalResult['id'],
+ };
+ var result = await isolate.invokeRpcNoUpgrade('getObject', params);
+ expect(result['type'], equals('Instance'));
+ expect(result['kind'], equals('Map'));
+ expect(result['_vmType'], equals('LinkedHashMap'));
+ expect(result['id'], startsWith('objects/'));
+ expect(result['valueAsString'], isNull);
+ expect(result['class']['type'], equals('@Class'));
+ expect(result['class']['name'], equals('_InternalLinkedHashMap'));
+ expect(result['size'], isPositive);
+ expect(result['fields'], isEmpty);
+ expect(result['associations'].length, equals(2));
+ expect(result['associations'][0]['key']['type'], equals('@Instance'));
+ expect(result['associations'][0]['key']['kind'], equals('String'));
+ expect(result['associations'][0]['key']['valueAsString'], equals('x'));
+ expect(result['associations'][0]['value']['type'], equals('@Instance'));
+ expect(result['associations'][0]['value']['kind'], equals('Int'));
+ expect(result['associations'][0]['value']['valueAsString'], equals('3'));
+ expect(result['associations'][1]['key']['type'], equals('@Instance'));
+ expect(result['associations'][1]['key']['kind'], equals('String'));
+ expect(result['associations'][1]['key']['valueAsString'], equals('y'));
+ expect(result['associations'][1]['value']['type'], equals('@Instance'));
+ expect(result['associations'][1]['value']['kind'], equals('Int'));
+ expect(result['associations'][1]['value']['valueAsString'], equals('4'));
+ },
+
// An expired object.
(Isolate isolate) async {
var params = {
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698