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

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

Issue 195613002: Fix service test breakage (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/service_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library isolate_echo_test; 5 library isolate_echo_test;
6 6
7 import 'test_helper.dart'; 7 import 'test_helper.dart';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 class EchoRequestTest extends VmServiceRequestHelper { 10 class EchoRequestTest extends VmServiceRequestHelper {
11 EchoRequestTest(port, id) : 11 EchoRequestTest(port, id) :
12 super('http://127.0.0.1:$port/$id/_echo/foo/bar?a=b&k=&d=e&z=w'); 12 super('http://127.0.0.1:$port/$id/_echo/foo/bar?a=b&k=&d=e&z=w');
13 13
14 onRequestCompleted(Map reply) { 14 onRequestCompleted(Map reply) {
15 Expect.equals('message', reply['type']); 15 Expect.equals('message', reply['type']);
16 16
17 Expect.equals(3, reply['message']['arguments'].length); 17 Expect.equals(3, reply['request']['arguments'].length);
18 Expect.equals('_echo', reply['message']['arguments'][0]); 18 Expect.equals('_echo', reply['request']['arguments'][0]);
19 Expect.equals('foo', reply['message']['arguments'][1]); 19 Expect.equals('foo', reply['request']['arguments'][1]);
20 Expect.equals('bar', reply['message']['arguments'][2]); 20 Expect.equals('bar', reply['request']['arguments'][2]);
21 21
22 Expect.equals(4, reply['message']['option_keys'].length); 22 Expect.equals(4, reply['request']['option_keys'].length);
23 Expect.equals('a', reply['message']['option_keys'][0]); 23 Expect.equals('a', reply['request']['option_keys'][0]);
24 Expect.equals('k', reply['message']['option_keys'][1]); 24 Expect.equals('k', reply['request']['option_keys'][1]);
25 Expect.equals('d', reply['message']['option_keys'][2]); 25 Expect.equals('d', reply['request']['option_keys'][2]);
26 Expect.equals('z', reply['message']['option_keys'][3]); 26 Expect.equals('z', reply['request']['option_keys'][3]);
27 27
28 Expect.equals(4, reply['message']['option_values'].length); 28 Expect.equals(4, reply['request']['option_values'].length);
29 Expect.equals('b', reply['message']['option_values'][0]); 29 Expect.equals('b', reply['request']['option_values'][0]);
30 Expect.equals('', reply['message']['option_values'][1]); 30 Expect.equals('', reply['request']['option_values'][1]);
31 Expect.equals('e', reply['message']['option_values'][2]); 31 Expect.equals('e', reply['request']['option_values'][2]);
32 Expect.equals('w', reply['message']['option_values'][3]); 32 Expect.equals('w', reply['request']['option_values'][3]);
33 } 33 }
34 } 34 }
35 35
36 class IsolateListTest extends VmServiceRequestHelper { 36 class IsolateListTest extends VmServiceRequestHelper {
37 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); 37 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates');
38 38
39 String _isolateId; 39 String _isolateId;
40 onRequestCompleted(Map reply) { 40 onRequestCompleted(Map reply) {
41 IsolateListTester tester = new IsolateListTester(reply); 41 IsolateListTester tester = new IsolateListTester(reply);
42 tester.checkIsolateCount(1); 42 tester.checkIsolateCount(1);
43 _isolateId = tester.getIsolateId(0); 43 _isolateId = tester.getIsolateId(0);
44 } 44 }
45 } 45 }
46 46
47 47
48 main() { 48 main() {
49 var process = new TestLauncher('isolate_echo_script.dart'); 49 var process = new TestLauncher('isolate_echo_script.dart');
50 process.launch().then((port) { 50 process.launch().then((port) {
51 var test = new IsolateListTest(port); 51 var test = new IsolateListTest(port);
52 test.makeRequest().then((_) { 52 test.makeRequest().then((_) {
53 var echoRequestTest = new EchoRequestTest(port, test._isolateId); 53 var echoRequestTest = new EchoRequestTest(port, test._isolateId);
54 echoRequestTest.makeRequest().then((_) { 54 echoRequestTest.makeRequest().then((_) {
55 process.requestExit(); 55 process.requestExit();
56 }); 56 });
57 }); 57 });
58 }); 58 });
59 } 59 }
OLDNEW
« no previous file with comments | « runtime/vm/service_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698