| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 * If [skipShutdown] is not set, shut down the server. | 208 * If [skipShutdown] is not set, shut down the server. |
| 209 */ | 209 */ |
| 210 Future shutdownIfNeeded() { | 210 Future shutdownIfNeeded() { |
| 211 if (skipShutdown) { | 211 if (skipShutdown) { |
| 212 return new Future.value(); | 212 return new Future.value(); |
| 213 } | 213 } |
| 214 // Give the server a short time to comply with the shutdown request; if it | 214 // Give the server a short time to comply with the shutdown request; if it |
| 215 // doesn't exit, then forcibly terminate it. | 215 // doesn't exit, then forcibly terminate it. |
| 216 sendServerShutdown(); | 216 sendServerShutdown(); |
| 217 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { | 217 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { |
| 218 return server.kill('server failed to exit'); | 218 // The integer value of the exit code isn't used, but we have to return |
| 219 // an integer to keep the typing correct. |
| 220 return server.kill('server failed to exit').then((_) => -1); |
| 219 }); | 221 }); |
| 220 } | 222 } |
| 221 | 223 |
| 222 /** | 224 /** |
| 223 * Convert the given [relativePath] to an absolute path, by interpreting it | 225 * Convert the given [relativePath] to an absolute path, by interpreting it |
| 224 * relative to [sourceDirectory]. On Windows any forward slashes in | 226 * relative to [sourceDirectory]. On Windows any forward slashes in |
| 225 * [relativePath] are converted to backslashes. | 227 * [relativePath] are converted to backslashes. |
| 226 */ | 228 */ |
| 227 String sourcePath(String relativePath) { | 229 String sourcePath(String relativePath) { |
| 228 return join(sourceDirectory.path, relativePath.replaceAll('/', separator)); | 230 return join(sourceDirectory.path, relativePath.replaceAll('/', separator)); |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 void populateMismatches(item, List<MismatchDescriber> mismatches); | 982 void populateMismatches(item, List<MismatchDescriber> mismatches); |
| 981 | 983 |
| 982 /** | 984 /** |
| 983 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 985 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
| 984 */ | 986 */ |
| 985 MismatchDescriber simpleDescription(String description) => | 987 MismatchDescriber simpleDescription(String description) => |
| 986 (Description mismatchDescription) { | 988 (Description mismatchDescription) { |
| 987 mismatchDescription.add(description); | 989 mismatchDescription.add(description); |
| 988 }; | 990 }; |
| 989 } | 991 } |
| OLD | NEW |