| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.integration.analysis.error; | 5 library test.integration.analysis.error; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 lastMessageResult = server.send('server.getVersion', null); | 44 lastMessageResult = server.send('server.getVersion', null); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Flush the server's standard input stream to verify that it has really | 47 // Flush the server's standard input stream to verify that it has really |
| 48 // received them all. If the server is blocked waiting for us to read | 48 // received them all. If the server is blocked waiting for us to read |
| 49 // its responses, the flush will never complete. | 49 // its responses, the flush will never complete. |
| 50 return server.flushCommands().then((_) { | 50 return server.flushCommands().then((_) { |
| 51 | 51 |
| 52 // Begin processing responses from the server. | 52 // Begin processing responses from the server. |
| 53 server.listenToOutput((String event, params) { | 53 server.listenToOutput((String event, params) { |
| 54 // No notifications are expected. | 54 // The only expected notification is server.connected. |
| 55 fail('Unexpected notification: $event'); | 55 if (event != 'server.connected') { |
| 56 fail('Unexpected notification: $event'); |
| 57 } |
| 56 }); | 58 }); |
| 57 | 59 |
| 58 // Terminate the test when the response to the last message is received. | 60 // Terminate the test when the response to the last message is received. |
| 59 lastMessageResult.then((_) { | 61 return lastMessageResult.then((_) { |
| 60 server.send("server.shutdown", null).then((_) { | 62 server.send("server.shutdown", null).then((_) { |
| 61 return server.exitCode; | 63 return server.exitCode; |
| 62 }); | 64 }); |
| 63 }); | 65 }); |
| 64 }); | 66 }); |
| 65 } | 67 } |
| 66 } | 68 } |
| 67 | 69 |
| 68 main() { | 70 main() { |
| 69 runReflectiveTests(AsynchronyIntegrationTest); | 71 runReflectiveTests(AsynchronyIntegrationTest); |
| 70 } | 72 } |
| OLD | NEW |