Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 == 'cli') { | |
| 16 Expect.equals('ClientList', response['type']); | |
| 17 Expect.equals(1, response['members'].length); | |
| 18 _count++; | |
| 19 } else if (seq == 'iso') { | |
| 20 Expect.equals('IsolateList', response['type']); | |
| 21 _count++; | |
| 22 } | |
| 23 if (_count == 2) { | |
| 24 complete(); | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 runTest() { | |
|
turnidge
2013/12/11 17:56:07
Could use a high-level comment somewhere in the te
Cutch
2013/12/12 22:37:42
Done.
| |
| 29 sendMessage('cli', ['clients']); | |
| 30 sendMessage('iso', ['isolates']); | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 main() { | |
| 35 var process = new TestLauncher('unknown_command_script.dart'); | |
| 36 process.launch().then((port) { | |
| 37 new ClientsRequestTest(port).connect().then((test) { | |
| 38 test.completed.then((_) { | |
| 39 process.requestExit(); | |
| 40 }); | |
| 41 test.runTest(); | |
| 42 }); | |
| 43 }); | |
| 44 } | |
| OLD | NEW |