| 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.status; | 5 library test.integration.server.status; |
| 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_status() { | 21 test_status() { |
| 22 // After we kick off analysis, we should get one server.status message with | 22 // After we kick off analysis, we should get one server.status message with |
| 23 // analyzing=true, and another server.status message after that with | 23 // analyzing=true, and another server.status message after that with |
| 24 // analyzing=false. | 24 // analyzing=false. |
| 25 Completer analysisBegun = new Completer(); | 25 Completer analysisBegun = new Completer(); |
| 26 Completer analysisFinished = new Completer(); | 26 Completer analysisFinished = new Completer(); |
| 27 onServerStatus.listen((ServerStatusParams params) { | 27 onServerStatus.listen((ServerStatusParams params) { |
| 28 if (params.analysis != null) { | 28 if (params.analysis != null) { |
| 29 if (params.analysis.isAnalyzing) { | 29 if (params.analysis.isAnalyzing) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 }'''); | 41 }'''); |
| 42 standardAnalysisSetup(); | 42 standardAnalysisSetup(); |
| 43 expect(analysisBegun.isCompleted, isFalse); | 43 expect(analysisBegun.isCompleted, isFalse); |
| 44 expect(analysisFinished.isCompleted, isFalse); | 44 expect(analysisFinished.isCompleted, isFalse); |
| 45 return analysisBegun.future.then((_) { | 45 return analysisBegun.future.then((_) { |
| 46 expect(analysisFinished.isCompleted, isFalse); | 46 expect(analysisFinished.isCompleted, isFalse); |
| 47 return analysisFinished.future; | 47 return analysisFinished.future; |
| 48 }); | 48 }); |
| 49 } | 49 } |
| 50 } | 50 } |
| OLD | NEW |