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

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

Issue 1135893003: Pass Redirect status higher than 307 through to the user (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 HttpRequest xhr = new HttpRequest(); 57 HttpRequest xhr = new HttpRequest();
58 xhr.open("GET", "NonExistingFile", async: true); 58 xhr.open("GET", "NonExistingFile", async: true);
59 xhr.onReadyStateChange.listen(expectAsyncUntil((event) { 59 xhr.onReadyStateChange.listen(expectAsyncUntil((event) {
60 if (xhr.readyState == HttpRequest.DONE) { 60 if (xhr.readyState == HttpRequest.DONE) {
61 validate404(xhr); 61 validate404(xhr);
62 } 62 }
63 }, () => xhr.readyState == HttpRequest.DONE)); 63 }, () => xhr.readyState == HttpRequest.DONE));
64 xhr.send(); 64 xhr.send();
65 }); 65 });
66 66
67 test('XHR file', () { 67 test('XHR_file', () {
68 var loadEndCalled = false; 68 var loadEndCalled = false;
69 69
70 var xhr = new HttpRequest(); 70 var xhr = new HttpRequest();
71 xhr.open('GET', url, async: true); 71 xhr.open('GET', url, async: true);
72 xhr.onReadyStateChange.listen(expectAsyncUntil((e) { 72 xhr.onReadyStateChange.listen(expectAsyncUntil((e) {
73 if (xhr.readyState == HttpRequest.DONE) { 73 if (xhr.readyState == HttpRequest.DONE) {
74 validate200Response(xhr); 74 validate200Response(xhr);
75 75
76 Timer.run(expectAsync(() { 76 Timer.run(expectAsync(() {
77 expect(loadEndCalled, HttpRequest.supportsLoadEndEvent); 77 expect(loadEndCalled, HttpRequest.supportsLoadEndEvent);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 (xhr) { 250 (xhr) {
251 var contentTypeHeader = xhr.responseHeaders['content-type']; 251 var contentTypeHeader = xhr.responseHeaders['content-type'];
252 expect(contentTypeHeader, isNotNull); 252 expect(contentTypeHeader, isNotNull);
253 // Should be like: 'text/plain; charset=utf-8' 253 // Should be like: 'text/plain; charset=utf-8'
254 expect(contentTypeHeader.contains('text/plain'), isTrue); 254 expect(contentTypeHeader.contains('text/plain'), isTrue);
255 expect(contentTypeHeader.contains('charset=utf-8'), isTrue); 255 expect(contentTypeHeader.contains('charset=utf-8'), isTrue);
256 }); 256 });
257 }); 257 });
258 }); 258 });
259 } 259 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698