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

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

Issue 823403004: Begin migrating the vm service from a rest-style interface to a json-rpc style interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove old-style standalone tests. Created 5 years, 10 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 | « tests/standalone/vmservice/isolate_stacktrace_command_test.dart ('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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library unknown_command_test;
6
7 import 'test_helper.dart';
8 import 'package:expect/expect.dart';
9
10 class ClientsRequestTest extends ServiceWebSocketRequestHelper {
11 ClientsRequestTest(port) : super('ws://127.0.0.1:$port/ws');
12 int _count = 0;
13
14 onResponse(var seq, Map response) {
15 if (seq == null) {
16 // Ignore push events.
17 return;
18 }
19 if (seq == 'cli') {
20 // Verify response is correct for 'cli' sequence id.
21 Expect.equals('ClientList', response['type']);
22 Expect.equals(1, response['members'].length);
23 _count++;
24 } else if (seq == 'vm') {
25 // Verify response is correct for 'vm' sequence id.
26 Expect.equals('VM', response['type']);
27 _count++;
28 } else {
29 Expect.fail('Unexpected response from $seq: $response');
30 }
31 if (_count == 2) {
32 // After receiving both responses, the test is complete.
33 complete();
34 }
35 }
36
37 runTest() {
38 // Send a request for clients with 'cli' sequence id.
39 sendMessage('cli', 'clients');
40 // Send a request for vm info with 'vm' sequence id.
41 sendMessage('vm', 'vm');
42 }
43 }
44
45 main() {
46 var process = new TestLauncher('unknown_command_script.dart');
47 process.launch().then((port) {
48 new ClientsRequestTest(port).connect().then((test) {
49 test.completed.then((_) {
50 process.requestExit();
51 });
52 test.runTest();
53 });
54 });
55 }
OLDNEW
« no previous file with comments | « tests/standalone/vmservice/isolate_stacktrace_command_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698