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_stacktrace_command_test; | 5 library isolate_stacktrace_command_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 StacktraceTest extends VmServiceRequestHelper { | 10 class StacktraceTest extends VmServiceRequestHelper { |
11 StacktraceTest(port, id) : | 11 StacktraceTest(port, id) : |
12 super('http://127.0.0.1:$port/isolates/$id/stacktrace'); | 12 super('http://127.0.0.1:$port/isolates/$id/stacktrace'); |
13 | 13 |
14 onRequestCompleted(Map reply) { | 14 onRequestCompleted(Map reply) { |
15 Expect.equals('StackTrace', reply['type'], 'Not a StackTrace message.'); | 15 Expect.equals('StackTrace', reply['type'], 'Not a StackTrace message.'); |
16 Expect.equals(4, reply['members'].length, 'Stacktrace is wrong length.'); | 16 Expect.isTrue(4 <= reply['members'].length, 'Stacktrace is wrong length.'); |
hausner
2013/11/13 23:05:27
What else did you see in the trace? Is it a functi
| |
17 // The number of frames involved in isolate start-up is an implementation | |
rmacnak
2013/11/13 23:14:34
So actually this should be "message dispatch" not
| |
18 // detail. Only check that we got all the frames for user code. | |
17 Expect.equals('a', reply['members'][0]['name']); | 19 Expect.equals('a', reply['members'][0]['name']); |
18 Expect.equals('b', reply['members'][1]['name']); | 20 Expect.equals('b', reply['members'][1]['name']); |
19 Expect.equals('c', reply['members'][2]['name']); | 21 Expect.equals('c', reply['members'][2]['name']); |
20 Expect.equals('myIsolateName', reply['members'][3]['name']); | 22 Expect.equals('myIsolateName', reply['members'][3]['name']); |
21 } | 23 } |
22 } | 24 } |
23 | 25 |
24 class IsolateListTest extends VmServiceRequestHelper { | 26 class IsolateListTest extends VmServiceRequestHelper { |
25 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); | 27 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); |
26 | 28 |
(...skipping 11 matching lines...) Expand all Loading... | |
38 process.launch().then((port) { | 40 process.launch().then((port) { |
39 var test = new IsolateListTest(port); | 41 var test = new IsolateListTest(port); |
40 test.makeRequest().then((_) { | 42 test.makeRequest().then((_) { |
41 var stacktraceTest = new StacktraceTest(port, test._isolateId); | 43 var stacktraceTest = new StacktraceTest(port, test._isolateId); |
42 stacktraceTest.makeRequest().then((_) { | 44 stacktraceTest.makeRequest().then((_) { |
43 process.requestExit(); | 45 process.requestExit(); |
44 }); | 46 }); |
45 }); | 47 }); |
46 }); | 48 }); |
47 } | 49 } |
OLD | NEW |