Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: tests/standalone/vmservice/isolate_stacktrace_command_test.dart

Issue 19870006: Support stacktrace and objecthistogram service commands (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
5 library isolate_stacktrace_command_test;
6
7 import 'test_helper.dart';
8 import 'package:expect/expect.dart';
9
10 class StacktraceTest extends VmServiceRequestHelper {
11 StacktraceTest(port, id) :
12 super('http://127.0.0.1:$port/isolates/$id/stacktrace');
13
14 onRequestCompleted(Map reply) {
15 Expect.equals('StackTrace', reply['type'], 'Not a StackTrace message.');
16 Expect.equals(4, reply['members'].length, 'Stacktrace is wrong length.');
17 Expect.equals('a', reply['members'][0]['name']);
18 Expect.equals('b', reply['members'][1]['name']);
19 Expect.equals('c', reply['members'][2]['name']);
20 Expect.equals('myIsolateName', reply['members'][3]['name']);
21 }
22 }
23
24 class IsolateListTest extends VmServiceRequestHelper {
25 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates');
26
27 int _isolateId;
28 onRequestCompleted(Map reply) {
29 IsolateListTester tester = new IsolateListTester(reply);
30 tester.checkIsolateCount(2);
31 _isolateId = tester.checkIsolateNameContains('myIsolateName');
32 }
33 }
34
35
36 main() {
37 var process = new TestLauncher('isolate_stacktrace_command_script.dart');
38 process.launch().then((port) {
39 var test = new IsolateListTest(port);
40 test.makeRequest().then((_) {
41 var stacktraceTest = new StacktraceTest(port, test._isolateId);
42 stacktraceTest.makeRequest().then((_) {
43 process.requestExit();
44 });
45 });
46 });
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698