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.set.subscriptions; | 5 library test.integration.server.set.subscriptions; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
11 | 11 |
12 import '../../reflective_tests.dart'; | 12 import '../../reflective_tests.dart'; |
13 import '../integration_tests.dart'; | 13 import '../integration_tests.dart'; |
14 | 14 |
15 main() { | 15 main() { |
16 runReflectiveTests(Test); | 16 runReflectiveTests(Test); |
17 } | 17 } |
18 | 18 |
19 @ReflectiveTestCase() | 19 @reflectiveTest |
20 class Test extends AbstractAnalysisServerIntegrationTest { | 20 class Test extends AbstractAnalysisServerIntegrationTest { |
21 test_setSubscriptions() { | 21 test_setSubscriptions() { |
22 bool statusReceived = false; | 22 bool statusReceived = false; |
23 Completer analysisBegun = new Completer(); | 23 Completer analysisBegun = new Completer(); |
24 onServerStatus.listen((_) { | 24 onServerStatus.listen((_) { |
25 statusReceived = true; | 25 statusReceived = true; |
26 }); | 26 }); |
27 onAnalysisErrors.listen((_) { | 27 onAnalysisErrors.listen((_) { |
28 if (!analysisBegun.isCompleted) { | 28 if (!analysisBegun.isCompleted) { |
29 analysisBegun.complete(); | 29 analysisBegun.complete(); |
(...skipping 17 matching lines...) Expand all Loading... |
47 var y; | 47 var y; |
48 }'''); | 48 }'''); |
49 // Analysis should eventually complete, and we should be notified | 49 // Analysis should eventually complete, and we should be notified |
50 // about it. | 50 // about it. |
51 return analysisFinished; | 51 return analysisFinished; |
52 }); | 52 }); |
53 }); | 53 }); |
54 }); | 54 }); |
55 } | 55 } |
56 } | 56 } |
OLD | NEW |