| 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 |
| 9 library isolate_stacktrace_command_test; |
| 10 |
| 11 import 'test_helper.dart'; |
| 12 import 'package:expect/expect.dart'; |
| 13 |
| 14 class StacktraceTest extends VmServiceRequestHelper { |
| 15 StacktraceTest(port, id) : |
| 16 super('http://127.0.0.1:$port/isolates/$id/stacktrace'); |
| 17 |
| 18 onRequestCompleted(Map reply) { |
| 19 Expect.equals('StackTrace', reply['type'], 'Not a StackTrace message.'); |
| 20 Expect.equals(4, reply['members'].length, 'Stacktrace is wrong length.'); |
| 21 Expect.equals('a', reply['members'][0]['name']); |
| 22 Expect.equals('b', reply['members'][1]['name']); |
| 23 Expect.equals('c', reply['members'][2]['name']); |
| 24 Expect.equals('myIsolateName', reply['members'][3]['name']); |
| 25 } |
| 26 } |
| 27 |
| 28 class IsolateListTest extends VmServiceRequestHelper { |
| 29 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
| 30 |
| 31 int _isolateId; |
| 32 onRequestCompleted(Map reply) { |
| 33 IsolateListTester tester = new IsolateListTester(reply); |
| 34 tester.checkIsolateCount(2); |
| 35 _isolateId = tester.checkIsolateNameContains('myIsolateName'); |
| 36 } |
| 37 } |
| 38 |
| 39 |
| 40 main() { |
| 41 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); |
| 42 process.launch().then((port) { |
| 43 var test = new IsolateListTest(port); |
| 44 test.makeRequest().then((_) { |
| 45 var stacktraceTest = new StacktraceTest(port, test._isolateId); |
| 46 stacktraceTest.makeRequest().then((_) { |
| 47 process.requestExit(); |
| 48 }); |
| 49 }); |
| 50 }); |
| 51 } |
| OLD | NEW |