| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 String id = message['id']; | 563 String id = message['id']; |
| 564 Completer completer = _pendingCommands[id]; | 564 Completer completer = _pendingCommands[id]; |
| 565 if (completer == null) { | 565 if (completer == null) { |
| 566 fail('Unexpected response from server: id=$id'); | 566 fail('Unexpected response from server: id=$id'); |
| 567 } else { | 567 } else { |
| 568 _pendingCommands.remove(id); | 568 _pendingCommands.remove(id); |
| 569 } | 569 } |
| 570 if (messageAsMap.containsKey('error')) { | 570 if (messageAsMap.containsKey('error')) { |
| 571 // TODO(paulberry): propagate the error info to the completer. | 571 // TODO(paulberry): propagate the error info to the completer. |
| 572 completer.completeError(new UnimplementedError( | 572 completer.completeError(new UnimplementedError( |
| 573 'Server responded with an error')); | 573 'Server responded with an error: ${JSON.encode(message)}')); |
| 574 } else { | 574 } else { |
| 575 completer.complete(messageAsMap['result']); | 575 completer.complete(messageAsMap['result']); |
| 576 } | 576 } |
| 577 // Check that the message is well-formed. We do this after calling | 577 // Check that the message is well-formed. We do this after calling |
| 578 // completer.complete() or completer.completeError() so that we don't | 578 // completer.complete() or completer.completeError() so that we don't |
| 579 // stall the test in the event of an error. | 579 // stall the test in the event of an error. |
| 580 expect(message, isResponse); | 580 expect(message, isResponse); |
| 581 } else { | 581 } else { |
| 582 // Message is a notification. It should have an event and possibly | 582 // Message is a notification. It should have an event and possibly |
| 583 // params. | 583 // params. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 */ | 690 */ |
| 691 void _recordStdio(String line) { | 691 void _recordStdio(String line) { |
| 692 double elapsedTime = _time.elapsedTicks / _time.frequency; | 692 double elapsedTime = _time.elapsedTicks / _time.frequency; |
| 693 line = "$elapsedTime: $line"; | 693 line = "$elapsedTime: $line"; |
| 694 if (_debuggingStdio) { | 694 if (_debuggingStdio) { |
| 695 print(line); | 695 print(line); |
| 696 } | 696 } |
| 697 _recordedStdio.add(line); | 697 _recordedStdio.add(line); |
| 698 } | 698 } |
| 699 } | 699 } |
| OLD | NEW |