| 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 | |
| 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 | 4 |
| 11 library isolate_list_test; | 5 library isolate_list_test; |
| 12 | 6 |
| 13 import 'test_helper.dart'; | 7 import 'test_helper.dart'; |
| 14 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 15 | 9 |
| 16 | 10 |
| 17 class IsolateListTest extends VmServiceRequestHelper { | 11 class IsolateListTest extends VmServiceRequestHelper { |
| 18 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 12 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
| 19 | 13 |
| 20 onRequestCompleted(Map reply) { | 14 onRequestCompleted(Map reply) { |
| 21 IsolateListTester tester = new IsolateListTester(reply); | 15 IsolateListTester tester = new IsolateListTester(reply); |
| 22 tester.checkIsolateCount(1); | 16 tester.checkIsolateCount(1); |
| 23 tester.checkIsolateNameContains('isolate_list_script.dart'); | 17 tester.checkIsolateNameContains('isolate_list_script.dart'); |
| 24 } | 18 } |
| 25 } | 19 } |
| 26 | 20 |
| 27 | 21 |
| 28 main() { | 22 main() { |
| 29 var process = new TestLauncher('isolate_list_script.dart'); | 23 var process = new TestLauncher('isolate_list_script.dart'); |
| 30 process.launch().then((port) { | 24 process.launch().then((port) { |
| 31 var test = new IsolateListTest(port); | 25 var test = new IsolateListTest(port); |
| 32 test.makeRequest().then((_) { | 26 test.makeRequest().then((_) { |
| 33 process.requestExit(); | 27 process.requestExit(); |
| 34 }); | 28 }); |
| 35 }); | 29 }); |
| 36 } | 30 } |
| OLD | NEW |