Chromium Code Reviews| 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..cae6bd4165b98d3851bedf74d50daecabb8562b7 |
| --- /dev/null |
| +++ b/runtime/observatory/tests/service/get_zone_memory_info_rpc_test.dart |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
|
zra
2016/12/13 23:37:02
2016
|
| +// 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 --vm-name=Walter |
| + |
| +import 'package:observatory/service_io.dart'; |
| +import 'package:unittest/unittest.dart'; |
|
zra
2016/12/13 23:37:02
Should we be using the test rather than unittest p
bkonyi
2016/12/13 23:48:45
I'm not sure myself. I had copied this test origin
|
| + |
| +import 'test_helper.dart'; |
| + |
| +var tests = [ |
| + (VM vm) async { |
| + var isInt = new isInstanceOf<int>(); |
| + var result = await vm.invokeRpcNoUpgrade('_getZoneMemoryInfo', {}); |
| + expect(result['type'], equals('_ZoneMemoryInfo')); |
| + expect(result.containsKey('isolates'), isTrue); |
| + var isolates = result['isolates']; |
| + |
| + for (var isolate in isolates) { |
| + expect(isolate['type'], equals('Isolate')); |
| + expect(isolate.containsKey('threads'), isTrue); |
| + var threads = isolate['threads']; |
| + |
| + for (var thread in threads) { |
| + expect(thread['type'], equals('_Thread')); |
| + expect(thread['id'], isNotNull); |
| + expect(thread['kind'], isNotNull); |
| + expect(thread.containsKey('zones'), isTrue); |
| + var zones = thread['zones']; |
| + |
| + for (var zone in zones) { |
| + expect(zone['type'], equals('_Zone')); |
| + expect(zone['capacity'], isInt); |
| + expect(zone['used'], isInt); |
| + } |
| + } |
| + } |
| + }, |
| +]; |
| + |
| +main(args) async => runVMTests(args, tests); |