Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: tests/html/xhr_test.dart

Issue 26893008: Adding HttpRequest.responseHeaders (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tightening up some error edge cases Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698