| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 XHRTest; | 5 library XHRTest; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
| 10 import 'package:unittest/html_individual_config.dart'; | 10 import 'package:unittest/html_individual_config.dart'; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 method: 'POST', | 239 method: 'POST', |
| 240 sendData: JSON.encode(data), | 240 sendData: JSON.encode(data), |
| 241 responseType: 'json').then( | 241 responseType: 'json').then( |
| 242 expectAsync1((xhr) { | 242 expectAsync1((xhr) { |
| 243 expect(xhr.status, equals(200)); | 243 expect(xhr.status, equals(200)); |
| 244 var json = xhr.response; | 244 var json = xhr.response; |
| 245 expect(json, equals(data)); | 245 expect(json, equals(data)); |
| 246 })); | 246 })); |
| 247 }); | 247 }); |
| 248 }); | 248 }); |
| 249 |
| 250 group('headers', () { |
| 251 test('xhr responseHeaders', () { |
| 252 return HttpRequest.request(url, mimeType: 'application/binary').then( |
| 253 (xhr) { |
| 254 expect(xhr.responseHeaders['content-type'], 'application/binary'); |
| 255 }); |
| 256 }); |
| 257 }); |
| 249 } | 258 } |
| OLD | NEW |