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

Unified Diff: tests/standalone/vmservice/isolate_code_test.dart

Issue 22297008: Expose classes, codes, functions, and libraries collections. (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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/vmservice/isolate_code_test.dart
diff --git a/tests/standalone/vmservice/isolate_code_test.dart b/tests/standalone/vmservice/isolate_code_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8ce58ddb074b79561d9b8253ceee9d4a503322a3
--- /dev/null
+++ b/tests/standalone/vmservice/isolate_code_test.dart
@@ -0,0 +1,81 @@
+// 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.
+
+library isolate_class_test;
+
+import 'dart:async';
+import 'test_helper.dart';
+import 'package:expect/expect.dart';
+
+class CodeATest extends VmServiceRequestHelper {
+ CodeATest(port, id, codeId) :
+ super('http://127.0.0.1:$port/isolates/$id/codes/$codeId');
+
+ onRequestCompleted(Map reply) {
+ Expect.equals('Code', reply['type']);
+ Expect.equals('a', reply['function']['name']);
+ Expect.isTrue(reply['disassembly'].length > 0);
+ }
+}
+
+class CodeCTest extends VmServiceRequestHelper {
+ CodeCTest(port, id, codeId) :
+ super('http://127.0.0.1:$port/isolates/$id/codes/$codeId');
+
+ onRequestCompleted(Map reply) {
+ Expect.equals('Code', reply['type']);
+ Expect.equals('C.c', reply['function']['name']);
+ Expect.isTrue(reply['disassembly'].length > 0);
+ }
+}
+
+class StackTraceTest extends VmServiceRequestHelper {
+ StackTraceTest(port, id) :
+ super('http://127.0.0.1:$port/isolates/$id/stacktrace');
+
+ int _aId;
+ int _cId;
+ onRequestCompleted(Map reply) {
+ Expect.equals('StackTrace', reply['type']);
+ List members = reply['members'];
+ Expect.equals('a', members[0]['name']);
+ _aId = members[0]['code']['id'];
+ Expect.equals('c', members[2]['name']);
+ _cId = members[2]['code']['id'];
+ }
+}
+
+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);
+ tester.checkIsolateNameContains('isolate_stacktrace_command_script.dart');
+ _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((_) {
+ var codeATest = new CodeATest(port, test._isolateId,
+ stackTraceTest._aId);
+ var codeCTest = new CodeCTest(port, test._isolateId,
+ stackTraceTest._cId);
+ var requests = Future.wait([codeATest.makeRequest(),
+ codeCTest.makeRequest()]);
+ requests.then((_) {
+ process.requestExit();
+ });
+ });
+ });
+ });
+}
« no previous file with comments | « tests/standalone/vmservice/isolate_class_test.dart ('k') | tests/standalone/vmservice/isolate_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698