| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "dart:async"; | 6 import "dart:async"; |
| 7 import "dart:io"; | 7 import "dart:io"; |
| 8 | 8 |
| 9 void testCookies() { | 9 void testCookies() { |
| 10 var cookies = [{'abc': 'def'}, | 10 var cookies = [{'abc': 'def'}, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 Expect.mapEquals(cookies[i], cookiesMap); | 44 Expect.mapEquals(cookies[i], cookiesMap); |
| 45 response.listen( | 45 response.listen( |
| 46 (d) {}, | 46 (d) {}, |
| 47 onDone: () { | 47 onDone: () { |
| 48 if (++count == cookies.length) { | 48 if (++count == cookies.length) { |
| 49 client.close(); | 49 client.close(); |
| 50 server.close(); | 50 server.close(); |
| 51 } | 51 } |
| 52 }); | 52 }); |
| 53 }) | 53 }) |
| 54 .catchError((e) { | 54 .catchError((e, trace) { |
| 55 String msg = "Unexpected error $e"; | 55 String msg = "Unexpected error $e"; |
| 56 var trace = getAttachedStackTrace(e); | |
| 57 if (trace != null) msg += "\nStackTrace: $trace"; | 56 if (trace != null) msg += "\nStackTrace: $trace"; |
| 58 Expect.fail(msg); | 57 Expect.fail(msg); |
| 59 }); | 58 }); |
| 60 } | 59 } |
| 61 }); | 60 }); |
| 62 } | 61 } |
| 63 | 62 |
| 64 void main() { | 63 void main() { |
| 65 testCookies(); | 64 testCookies(); |
| 66 } | 65 } |
| OLD | NEW |