| 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 | 4 |
| 5 library isolate_echo_test; | 5 library isolate_echo_test; |
| 6 | 6 |
| 7 import 'test_helper.dart'; | 7 import 'test_helper.dart'; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 class EchoRequestTest extends VmServiceRequestHelper { | 10 class EchoRequestTest extends VmServiceRequestHelper { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 Expect.equals('b', reply['message']['option_values'][0]); | 29 Expect.equals('b', reply['message']['option_values'][0]); |
| 30 Expect.equals('', reply['message']['option_values'][1]); | 30 Expect.equals('', reply['message']['option_values'][1]); |
| 31 Expect.equals('e', reply['message']['option_values'][2]); | 31 Expect.equals('e', reply['message']['option_values'][2]); |
| 32 Expect.equals('w', reply['message']['option_values'][3]); | 32 Expect.equals('w', reply['message']['option_values'][3]); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 class IsolateListTest extends VmServiceRequestHelper { | 36 class IsolateListTest extends VmServiceRequestHelper { |
| 37 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 37 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
| 38 | 38 |
| 39 int _isolateId; | 39 String _isolateId; |
| 40 onRequestCompleted(Map reply) { | 40 onRequestCompleted(Map reply) { |
| 41 IsolateListTester tester = new IsolateListTester(reply); | 41 IsolateListTester tester = new IsolateListTester(reply); |
| 42 tester.checkIsolateCount(1); | 42 tester.checkIsolateCount(1); |
| 43 tester.checkIsolateNameContains('isolate_echo_script.dart'); | 43 tester.checkIsolateNameContains('isolate_echo_script.dart'); |
| 44 _isolateId = reply['members'][0]['id']; | 44 _isolateId = reply['members'][0]['id']; |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 main() { | 49 main() { |
| 50 var process = new TestLauncher('isolate_echo_script.dart'); | 50 var process = new TestLauncher('isolate_echo_script.dart'); |
| 51 process.launch().then((port) { | 51 process.launch().then((port) { |
| 52 var test = new IsolateListTest(port); | 52 var test = new IsolateListTest(port); |
| 53 test.makeRequest().then((_) { | 53 test.makeRequest().then((_) { |
| 54 var echoRequestTest = new EchoRequestTest(port, test._isolateId); | 54 var echoRequestTest = new EchoRequestTest(port, test._isolateId); |
| 55 echoRequestTest.makeRequest().then((_) { | 55 echoRequestTest.makeRequest().then((_) { |
| 56 process.requestExit(); | 56 process.requestExit(); |
| 57 }); | 57 }); |
| 58 }); | 58 }); |
| 59 }); | 59 }); |
| 60 } | 60 } |
| OLD | NEW |