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

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

Issue 2574643003: Added ability to request zone memory information for all isolates through the VM service and added … (Closed)
Patch Set: Created dart objects for thread and zone and added threads field to isolate. Created 4 years 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
Index: runtime/observatory/tests/service/get_zone_memory_info_rpc_test.dart
diff --git a/runtime/observatory/tests/service/get_zone_memory_info_rpc_test.dart b/runtime/observatory/tests/service/get_zone_memory_info_rpc_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4e9faed8929e4af5f8b214b316e865dd273643b1
--- /dev/null
+++ b/runtime/observatory/tests/service/get_zone_memory_info_rpc_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2016, 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.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = [
+ (VM vm) async {
+ isInstanceOf<int> isInt = new isInstanceOf<int>();
+ // Just iterate over all the isolates to confirm they have
+ // the correct fields needed to examine zone memory usage.
+ for (Isolate isolate in vm.isolates) {
+ await isolate.reload();
+ var params = {
Cutch 2016/12/16 22:55:44 why is this here? It's not being used.
bkonyi 2016/12/16 22:59:58 Forgot to remove this... whoops.
+ "isolateId" : isolate.id
+ };
+ expect(isolate.threads, isNotNull);
+ print(isolate);
+ var threads = isolate.threads;
Cutch 2016/12/16 22:55:44 use strong mode types here and elsewhere
bkonyi 2016/12/16 22:59:58 Acknowledged.
+
+ for (var thread in threads) {
Cutch 2016/12/16 22:55:44 use strong mode types here and elsewhere.
bkonyi 2016/12/16 22:59:58 Acknowledged.
+ expect(thread.type, equals('_Thread'));
+ expect(thread.id, isNotNull);
+ expect(thread.kind, isNotNull);
+ expect(thread.zones, isNotNull);
+ var zones = thread.zones;
+
+ for (var zone in zones) {
+ expect(zone.capacity, isInt);
+ expect(zone.used, isInt);
+ }
+ }
+ }
+ },
+];
+
+main(args) async => runVMTests(args, tests);

Powered by Google App Engine
This is Rietveld 408576698