| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 // We're already dealing with it. | 712 // We're already dealing with it. |
| 713 return; | 713 return; |
| 714 } | 714 } |
| 715 _receivedBadDataFromServer = true; | 715 _receivedBadDataFromServer = true; |
| 716 debugStdio(); | 716 debugStdio(); |
| 717 // Give the server 1 second to continue outputting bad data before we kill | 717 // Give the server 1 second to continue outputting bad data before we kill |
| 718 // the test. This is helpful if the server has had an unhandled exception | 718 // the test. This is helpful if the server has had an unhandled exception |
| 719 // and is outputting a stacktrace, because it ensures that we see the | 719 // and is outputting a stacktrace, because it ensures that we see the |
| 720 // entire stacktrace. Use expectAsync() to prevent the test from | 720 // entire stacktrace. Use expectAsync() to prevent the test from |
| 721 // ending during this 1 second. | 721 // ending during this 1 second. |
| 722 new Future.delayed(new Duration(seconds: 1), expectAsync(() { | 722 new Future.delayed(new Duration(seconds: 1), expectAsync0(() { |
| 723 fail('Bad data received from server: $details'); | 723 fail('Bad data received from server: $details'); |
| 724 })); | 724 })); |
| 725 } | 725 } |
| 726 | 726 |
| 727 /** | 727 /** |
| 728 * Record a message that was exchanged with the server, and print it out if | 728 * Record a message that was exchanged with the server, and print it out if |
| 729 * [debugStdio] has been called. | 729 * [debugStdio] has been called. |
| 730 */ | 730 */ |
| 731 void _recordStdio(String line) { | 731 void _recordStdio(String line) { |
| 732 double elapsedTime = currentElapseTime; | 732 double elapsedTime = currentElapseTime; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 void populateMismatches(item, List<MismatchDescriber> mismatches); | 950 void populateMismatches(item, List<MismatchDescriber> mismatches); |
| 951 | 951 |
| 952 /** | 952 /** |
| 953 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 953 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
| 954 */ | 954 */ |
| 955 MismatchDescriber simpleDescription(String description) => | 955 MismatchDescriber simpleDescription(String description) => |
| 956 (Description mismatchDescription) { | 956 (Description mismatchDescription) { |
| 957 mismatchDescription.add(description); | 957 mismatchDescription.add(description); |
| 958 }; | 958 }; |
| 959 } | 959 } |
| OLD | NEW |