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

Unified Diff: tests/html/xhr_test.dart

Issue 11800002: "Reverting 16675-16676, 71-73" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/xhr_cross_origin_test.dart ('k') | tools/dom/src/_HttpRequestUtils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
- }));
- });
}
« no previous file with comments | « tests/html/xhr_cross_origin_test.dart ('k') | tools/dom/src/_HttpRequestUtils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698