| OLD | NEW |
| 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 unknown_command_test; | 5 library unknown_command_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 ClientsRequestTest extends ServiceWebSocketRequestHelper { | 10 class ClientsRequestTest extends ServiceWebSocketRequestHelper { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 _count++; | 23 _count++; |
| 24 } | 24 } |
| 25 if (_count == 2) { | 25 if (_count == 2) { |
| 26 // After receiving both responses, the test is complete. | 26 // After receiving both responses, the test is complete. |
| 27 complete(); | 27 complete(); |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 | 30 |
| 31 runTest() { | 31 runTest() { |
| 32 // Send a request for clients with 'cli' sequence id. | 32 // Send a request for clients with 'cli' sequence id. |
| 33 sendMessage('cli', ['clients']); | 33 sendMessage('cli', 'clients'); |
| 34 // Send a request for vm info with 'vm' sequence id. | 34 // Send a request for vm info with 'vm' sequence id. |
| 35 sendMessage('vm', ['vm']); | 35 sendMessage('vm', 'vm'); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 main() { | 39 main() { |
| 40 var process = new TestLauncher('unknown_command_script.dart'); | 40 var process = new TestLauncher('unknown_command_script.dart'); |
| 41 process.launch().then((port) { | 41 process.launch().then((port) { |
| 42 new ClientsRequestTest(port).connect().then((test) { | 42 new ClientsRequestTest(port).connect().then((test) { |
| 43 test.completed.then((_) { | 43 test.completed.then((_) { |
| 44 process.requestExit(); | 44 process.requestExit(); |
| 45 }); | 45 }); |
| 46 test.runTest(); | 46 test.runTest(); |
| 47 }); | 47 }); |
| 48 }); | 48 }); |
| 49 } | 49 } |
| OLD | NEW |