OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--short_socket_read |
| 5 // VMOptions=--short_socket_write |
| 6 // VMOptions=--short_socket_read --short_socket_write |
| 7 // |
| 8 // Test: |
| 9 // *) Connect to VM Service and obtain list of running isolates. |
| 10 |
| 11 library isolate_list_test; |
| 12 |
| 13 import 'test_helper.dart'; |
| 14 import 'package:expect/expect.dart'; |
| 15 |
| 16 |
| 17 class IsolateListTest extends VmServiceRequestHelper { |
| 18 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
| 19 |
| 20 onRequestCompleted(Map reply) { |
| 21 // The reply is an IsolateList. |
| 22 Expect.equals('IsolateList', reply['type']); |
| 23 // There is 1 running isolate. |
| 24 Expect.equals(1, reply['members'].length); |
| 25 // It's id is 7116. |
| 26 Expect.equals(7116, reply['members'][0]['id']); |
| 27 // It's this isolate. |
| 28 Expect.isTrue( |
| 29 reply['members'][0]['name'].startsWith('isolate_list_script.dart')); |
| 30 } |
| 31 } |
| 32 |
| 33 |
| 34 main() { |
| 35 var process = new TestLauncher('isolate_list_script.dart'); |
| 36 process.launch().then((port) { |
| 37 var test = new IsolateListTest(port); |
| 38 test.makeRequest().then((_) { |
| 39 process.requestExit(); |
| 40 }); |
| 41 }); |
| 42 } |
OLD | NEW |