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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/vmservice/isolate_stacktrace_command_test.dart
diff --git a/tests/standalone/vmservice/isolate_stacktrace_command_test.dart b/tests/standalone/vmservice/isolate_stacktrace_command_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d13de602d95c33ed5e172cd605779acb53223052
--- /dev/null
+++ b/tests/standalone/vmservice/isolate_stacktrace_command_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+//
+
+library isolate_stacktrace_command_test;
+
+import 'test_helper.dart';
+import 'package:expect/expect.dart';
+
+class StacktraceTest extends VmServiceRequestHelper {
+ StacktraceTest(port, id) :
+ super('http://127.0.0.1:$port/isolates/$id/stacktrace');
+
+ onRequestCompleted(Map reply) {
+ Expect.equals('StackTrace', reply['type'], 'Not a StackTrace message.');
+ Expect.equals(4, reply['members'].length, 'Stacktrace is wrong length.');
+ Expect.equals('a', reply['members'][0]['name']);
+ Expect.equals('b', reply['members'][1]['name']);
+ Expect.equals('c', reply['members'][2]['name']);
+ Expect.equals('myIsolateName', reply['members'][3]['name']);
+ }
+}
+
+class IsolateListTest extends VmServiceRequestHelper {
+ IsolateListTest(port) : super('http://127.0.0.1:$port/isolates');
+
+ int _isolateId;
+ onRequestCompleted(Map reply) {
+ IsolateListTester tester = new IsolateListTester(reply);
+ tester.checkIsolateCount(2);
+ _isolateId = tester.checkIsolateNameContains('myIsolateName');
+ }
+}
+
+
+main() {
+ var process = new TestLauncher('isolate_stacktrace_command_script.dart');
+ process.launch().then((port) {
+ var test = new IsolateListTest(port);
+ test.makeRequest().then((_) {
+ var stacktraceTest = new StacktraceTest(port, test._isolateId);
+ stacktraceTest.makeRequest().then((_) {
+ process.requestExit();
+ });
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698