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

Unified Diff: tests/standalone/vmservice/isolate_library_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
« no previous file with comments | « tests/standalone/vmservice/isolate_function_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/vmservice/isolate_library_test.dart
diff --git a/tests/standalone/vmservice/isolate_library_test.dart b/tests/standalone/vmservice/isolate_library_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..31d269b1884726814f92854e7f3fe17825474fd3
--- /dev/null
+++ b/tests/standalone/vmservice/isolate_library_test.dart
@@ -0,0 +1,61 @@
+// 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_library_test;
+
+import 'dart:async';
+import 'test_helper.dart';
+import 'package:expect/expect.dart';
+
+class LibraryTest extends VmServiceRequestHelper {
+ LibraryTest(port, id, libId) :
+ super('http://127.0.0.1:$port/isolates/$id/libraries/$libId');
+
+ onRequestCompleted(Map reply) {
+ Expect.equals('Library', reply['type']);
+ Expect.equals('isolate_stacktrace_command_script', reply['name']);
+ }
+}
+
+class RootLibraryTest extends VmServiceRequestHelper {
+ RootLibraryTest(port, id) :
+ super('http://127.0.0.1:$port/isolates/$id/libraries');
+
+ int _libId;
+ onRequestCompleted(Map reply) {
+ Expect.equals('@Library', reply['type']);
+ Expect.equals('isolate_stacktrace_command_script', reply['name']);
+ _libId = reply['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 rootLibraryTest =
+ new RootLibraryTest(port, test._isolateId);
+ rootLibraryTest.makeRequest().then((_) {
+ var libraryTest = new LibraryTest(port, test._isolateId,
+ rootLibraryTest._libId);
+ libraryTest.makeRequest().then((_) {
+ process.requestExit();
+ });
+ });
+ });
+ });
+}
« no previous file with comments | « tests/standalone/vmservice/isolate_function_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698