Index: tests/html/xhr_test.dart |
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart |
index 4988b1bd625e5ddf37c7cf6e5703ff14e485f591..b5ea6c1cb0a1dfb6947581edf24f5e42d9311888 100644 |
--- a/tests/html/xhr_test.dart |
+++ b/tests/html/xhr_test.dart |
@@ -10,68 +10,24 @@ import 'dart:json'; |
main() { |
useHtmlConfiguration(); |
- var url = "../../../../tests/html/xhr_cross_origin_data.txt"; |
test('XHR No file', () { |
HttpRequest xhr = new HttpRequest(); |
xhr.open("GET", "NonExistingFile", true); |
- xhr.on.readyStateChange.add(expectAsyncUntil1((event) { |
+ xhr.on.readyStateChange.add(expectAsync1((event) { |
if (xhr.readyState == HttpRequest.DONE) { |
- expect(xhr.status, equals(404)); |
+ expect(xhr.status, equals(0)); |
expect(xhr.responseText, equals('')); |
} |
- }, () => xhr.readyState == HttpRequest.DONE)); |
- xhr.send(); |
- }); |
- |
- test('XHR file', () { |
- var xhr = new HttpRequest(); |
- xhr.open('GET', url, true); |
- xhr.on.readyStateChange.add(expectAsyncUntil1((e) { |
- if (xhr.readyState == HttpRequest.DONE) { |
- expect(xhr.status, equals(200)); |
- var data = JSON.parse(xhr.response); |
- expect(data, contains('feed')); |
- expect(data['feed'], contains('entry')); |
- expect(data, isMap); |
- } |
- }, () => xhr.readyState == HttpRequest.DONE)); |
+ })); |
xhr.send(); |
}); |
test('XHR.get No file', () { |
new HttpRequest.get("NonExistingFile", expectAsync1((xhr) { |
expect(xhr.readyState, equals(HttpRequest.DONE)); |
- expect(xhr.status, equals(404)); |
- expect(xhr.responseText, equals('')); |
- })); |
- }); |
- |
- test('XHR.get file', () { |
- var xhr = new HttpRequest.get(url, expectAsync1((event) { |
- expect(event.readyState, equals(HttpRequest.DONE)); |
- expect(event.status, equals(200)); |
- var data = JSON.parse(event.response); |
- expect(data, contains('feed')); |
- expect(data['feed'], contains('entry')); |
- expect(data, isMap); |
- })); |
- }); |
- |
- test('XHR.getWithCredentials No file', () { |
- new HttpRequest.getWithCredentials("NonExistingFile", expectAsync1((xhr) { |
- expect(xhr.status, equals(404)); |
+ expect(xhr.status, equals(0)); |
expect(xhr.responseText, equals('')); |
})); |
}); |
- |
- test('XHR.getWithCredentials file', () { |
- new HttpRequest.getWithCredentials(url, expectAsync1((xhr) { |
- expect(xhr.status, equals(200)); |
- var data = JSON.parse(xhr.response); |
- expect(data, contains('feed')); |
- expect(data['feed'], contains('entry')); |
- expect(data, isMap); |
- })); |
- }); |
} |