| 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; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 * multiple times in one test; each time it is used it will wait afresh for | 112 * multiple times in one test; each time it is used it will wait afresh for |
| 113 * analysis to finish. | 113 * analysis to finish. |
| 114 */ | 114 */ |
| 115 Future get analysisFinished { | 115 Future get analysisFinished { |
| 116 Completer completer = new Completer(); | 116 Completer completer = new Completer(); |
| 117 StreamSubscription subscription; | 117 StreamSubscription subscription; |
| 118 // This will only work if the caller has already subscribed to | 118 // This will only work if the caller has already subscribed to |
| 119 // SERVER_STATUS (e.g. using sendServerSetSubscriptions(['STATUS'])) | 119 // SERVER_STATUS (e.g. using sendServerSetSubscriptions(['STATUS'])) |
| 120 expect(_subscribedToServerStatus, isTrue); | 120 expect(_subscribedToServerStatus, isTrue); |
| 121 subscription = onServerStatus.listen((ServerStatusParams params) { | 121 subscription = onServerStatus.listen((ServerStatusParams params) { |
| 122 if (!params.analysis.isAnalyzing) { | 122 if (params.analysis != null && !params.analysis.isAnalyzing) { |
| 123 completer.complete(params); | 123 completer.complete(params); |
| 124 subscription.cancel(); | 124 subscription.cancel(); |
| 125 } | 125 } |
| 126 }); | 126 }); |
| 127 return completer.future; | 127 return completer.future; |
| 128 } | 128 } |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * Print out any messages exchanged with the server. If some messages have | 131 * Print out any messages exchanged with the server. If some messages have |
| 132 * already been exchanged with the server, they are printed out immediately. | 132 * already been exchanged with the server, they are printed out immediately. |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 void populateMismatches(item, List<MismatchDescriber> mismatches); | 866 void populateMismatches(item, List<MismatchDescriber> mismatches); |
| 867 | 867 |
| 868 /** | 868 /** |
| 869 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 869 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
| 870 */ | 870 */ |
| 871 MismatchDescriber simpleDescription(String description) => | 871 MismatchDescriber simpleDescription(String description) => |
| 872 (Description mismatchDescription) { | 872 (Description mismatchDescription) { |
| 873 mismatchDescription.add(description); | 873 mismatchDescription.add(description); |
| 874 }; | 874 }; |
| 875 } | 875 } |
| OLD | NEW |