| 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.server.domain; | 5 library test.integration.server.domain; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_testing/reflective_tests.dart'; | 9 import 'package:analysis_testing/reflective_tests.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 var y; | 64 var y; |
| 65 }'''); | 65 }'''); |
| 66 // Analysis should eventually complete, and we should be notified | 66 // Analysis should eventually complete, and we should be notified |
| 67 // about it. | 67 // about it. |
| 68 return analysisFinished; | 68 return analysisFinished; |
| 69 }); | 69 }); |
| 70 }); | 70 }); |
| 71 }); | 71 }); |
| 72 } | 72 } |
| 73 | 73 |
| 74 test_setSubscriptions_invalidService() { |
| 75 // TODO(paulberry): verify that if an invalid service is specified, the |
| 76 // current subscriptions are unchanged. |
| 77 return server_setSubscriptions(['bogus']).then((_) { |
| 78 fail('setSubscriptions should have produced an error'); |
| 79 }, onError: (error) { |
| 80 // The expected error occurred. |
| 81 }); |
| 82 } |
| 83 |
| 74 test_connected() { | 84 test_connected() { |
| 75 Completer receivedConnected = new Completer(); | 85 Completer receivedConnected = new Completer(); |
| 76 server.onNotification('server.connected').listen((params) { | 86 server.onNotification('server.connected').listen((params) { |
| 77 expect(receivedConnected.isCompleted, isFalse); | 87 expect(receivedConnected.isCompleted, isFalse); |
| 78 receivedConnected.complete(); | 88 receivedConnected.complete(); |
| 79 expect(params, isNull); | 89 expect(params, isNull); |
| 80 }); | 90 }); |
| 81 return receivedConnected.future; | 91 return receivedConnected.future; |
| 82 } | 92 } |
| 83 | 93 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return analysisBegun.future.then((_) { | 127 return analysisBegun.future.then((_) { |
| 118 expect(analysisFinished.isCompleted, isFalse); | 128 expect(analysisFinished.isCompleted, isFalse); |
| 119 return analysisFinished.future; | 129 return analysisFinished.future; |
| 120 }); | 130 }); |
| 121 } | 131 } |
| 122 } | 132 } |
| 123 | 133 |
| 124 main() { | 134 main() { |
| 125 runReflectiveTests(ServerDomainIntegrationTest); | 135 runReflectiveTests(ServerDomainIntegrationTest); |
| 126 } | 136 } |
| OLD | NEW |