| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--short_socket_read | 4 // VMOptions=--short_socket_read |
| 5 // VMOptions=--short_socket_write | 5 // VMOptions=--short_socket_write |
| 6 // VMOptions=--short_socket_read --short_socket_write | 6 // VMOptions=--short_socket_read --short_socket_write |
| 7 // | 7 // |
| 8 // Test: | 8 // Test: |
| 9 // *) Connect to VM Service and obtain list of running isolates. | 9 // *) Connect to VM Service and obtain list of running isolates. |
| 10 | 10 |
| 11 library multiple_isolate_list_test; | 11 library multiple_isolate_list_test; |
| 12 | 12 |
| 13 import 'test_helper.dart'; | 13 import 'test_helper.dart'; |
| 14 import 'package:expect/expect.dart'; | 14 import 'package:expect/expect.dart'; |
| 15 | 15 |
| 16 class MultipleIsolateListTest extends VmServiceRequestHelper { | 16 class MultipleIsolateListTest extends VmServiceRequestHelper { |
| 17 MultipleIsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 17 MultipleIsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
| 18 | 18 |
| 19 onRequestCompleted(Map reply) { | 19 onRequestCompleted(Map reply) { |
| 20 IsolateListTester tester = new IsolateListTester(reply); | 20 IsolateListTester tester = new IsolateListTester(reply); |
| 21 tester.checkIsolateCount(2); | 21 tester.checkIsolateCount(2); |
| 22 tester.checkIsolateIdExists(7116); | 22 tester.checkIsolateNameContains('multiple_isolate_list_script.dart'); |
| 23 tester.checkIsolateNamePrefix(7116, 'multiple_isolate_list_script.dart'); | |
| 24 tester.checkIsolateNameContains('myIsolateName'); | 23 tester.checkIsolateNameContains('myIsolateName'); |
| 25 } | 24 } |
| 26 } | 25 } |
| 27 | 26 |
| 28 main() { | 27 main() { |
| 29 var process = new TestLauncher('multiple_isolate_list_script.dart'); | 28 var process = new TestLauncher('multiple_isolate_list_script.dart'); |
| 30 process.launch().then((port) { | 29 process.launch().then((port) { |
| 31 var test = new MultipleIsolateListTest(port); | 30 var test = new MultipleIsolateListTest(port); |
| 32 test.makeRequest().then((_) { | 31 test.makeRequest().then((_) { |
| 33 process.requestExit(); | 32 process.requestExit(); |
| 34 }); | 33 }); |
| 35 }); | 34 }); |
| 36 } | 35 } |
| OLD | NEW |