| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:convert'; | 6 import 'dart:convert'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:bazel_worker/bazel_worker.dart'; | 9 import 'package:bazel_worker/bazel_worker.dart'; |
| 10 // TODO(jakemac): Remove once this is a part of the testing library. | 10 // TODO(jakemac): Remove once this is a part of the testing library. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 dartSdkSummary.path, | 234 dartSdkSummary.path, |
| 235 '--summary-extension=api.ds', | 235 '--summary-extension=api.ds', |
| 236 '-s', | 236 '-s', |
| 237 greetingSummary.path, | 237 greetingSummary.path, |
| 238 '-s', | 238 '-s', |
| 239 greeting2Summary.path, | 239 greeting2Summary.path, |
| 240 '-o', | 240 '-o', |
| 241 helloJS.path, | 241 helloJS.path, |
| 242 helloDart.path, | 242 helloDart.path, |
| 243 ]); | 243 ]); |
| 244 expect(result.exitCode, 65); | 244 // TODO(vsm): Re-enable when we turn this check back on. |
| 245 expect(result.stdout, contains("conflict")); | 245 expect(result.exitCode, 0); |
| 246 expect(result.stdout, contains('${toUri(greetingDart.path)}')); | 246 // expect(result.exitCode, 65); |
| 247 expect(helloJS.existsSync(), isFalse); | 247 // expect(result.stdout, contains("conflict")); |
| 248 // expect(result.stdout, contains('${toUri(greetingDart.path)}')); |
| 249 // expect(helloJS.existsSync(), isFalse); |
| 248 }); | 250 }); |
| 249 }); | 251 }); |
| 250 | 252 |
| 251 group('Error handling', () { | 253 group('Error handling', () { |
| 252 final dartSdkSummary = file('lib/sdk/ddc_sdk.sum'); | 254 final dartSdkSummary = file('lib/sdk/ddc_sdk.sum'); |
| 253 final badFileDart = file('test/worker/bad.dart'); | 255 final badFileDart = file('test/worker/bad.dart'); |
| 254 final badFileJs = file('test/worker/bad.js'); | 256 final badFileJs = file('test/worker/bad.js'); |
| 255 | 257 |
| 256 tearDown(() { | 258 tearDown(() { |
| 257 if (badFileDart.existsSync()) badFileDart.deleteSync(); | 259 if (badFileDart.existsSync()) badFileDart.deleteSync(); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 Future<WorkResponse> _readResponse(MessageGrouper messageGrouper) async { | 367 Future<WorkResponse> _readResponse(MessageGrouper messageGrouper) async { |
| 366 var buffer = (await messageGrouper.next) as List<int>; | 368 var buffer = (await messageGrouper.next) as List<int>; |
| 367 try { | 369 try { |
| 368 return new WorkResponse.fromBuffer(buffer); | 370 return new WorkResponse.fromBuffer(buffer); |
| 369 } catch (_) { | 371 } catch (_) { |
| 370 var bufferAsString = | 372 var bufferAsString = |
| 371 buffer == null ? '' : 'String: ${UTF8.decode(buffer)}\n'; | 373 buffer == null ? '' : 'String: ${UTF8.decode(buffer)}\n'; |
| 372 throw 'Failed to parse response:\nbytes: $buffer\n$bufferAsString'; | 374 throw 'Failed to parse response:\nbytes: $buffer\n$bufferAsString'; |
| 373 } | 375 } |
| 374 } | 376 } |
| OLD | NEW |