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

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

Issue 22238002: Expose arguments and options to handlers through JSONStream (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_echo_script.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_echo_test.dart
diff --git a/tests/standalone/vmservice/isolate_echo_test.dart b/tests/standalone/vmservice/isolate_echo_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f5ed76184525a83a289924df80a39310d04cd7de
--- /dev/null
+++ b/tests/standalone/vmservice/isolate_echo_test.dart
@@ -0,0 +1,60 @@
+// 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_echo_test;
+
+import 'test_helper.dart';
+import 'package:expect/expect.dart';
+
+class EchoRequestTest extends VmServiceRequestHelper {
+ EchoRequestTest(port, id) :
+ super('http://127.0.0.1:$port/isolates/$id/_echo/foo/bar?a=b&k=&d=e&z=w');
+
+ onRequestCompleted(Map reply) {
+ Expect.equals('message', reply['type']);
+
+ Expect.equals(3, reply['message']['arguments'].length);
+ Expect.equals('_echo', reply['message']['arguments'][0]);
+ Expect.equals('foo', reply['message']['arguments'][1]);
+ Expect.equals('bar', reply['message']['arguments'][2]);
+
+ Expect.equals(4, reply['message']['option_keys'].length);
+ Expect.equals('a', reply['message']['option_keys'][0]);
+ Expect.equals('k', reply['message']['option_keys'][1]);
+ Expect.equals('d', reply['message']['option_keys'][2]);
+ Expect.equals('z', reply['message']['option_keys'][3]);
+
+ Expect.equals(4, reply['message']['option_values'].length);
+ Expect.equals('b', reply['message']['option_values'][0]);
+ Expect.equals('', reply['message']['option_values'][1]);
+ Expect.equals('e', reply['message']['option_values'][2]);
+ Expect.equals('w', reply['message']['option_values'][3]);
+ }
+}
+
+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(1);
+ tester.checkIsolateNameContains('isolate_echo_script.dart');
+ _isolateId = reply['members'][0]['id'];
+ }
+}
+
+
+main() {
+ var process = new TestLauncher('isolate_echo_script.dart');
+ process.launch().then((port) {
+ var test = new IsolateListTest(port);
+ test.makeRequest().then((_) {
+ var echoRequestTest = new EchoRequestTest(port, test._isolateId);
+ echoRequestTest.makeRequest().then((_) {
+ process.requestExit();
+ });
+ });
+ });
+}
« no previous file with comments | « tests/standalone/vmservice/isolate_echo_script.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698