Index: tests/html/xhr_test.dart |
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart |
index 7c2f863519a39c3b50580b55af69785904ac89be..d47707f7497bcbce4bef1ec1c7f739a006205bc7 100644 |
--- a/tests/html/xhr_test.dart |
+++ b/tests/html/xhr_test.dart |
@@ -208,6 +208,24 @@ main() { |
}); |
}); |
} |
+ |
+ test('xhr postFormData', () { |
+ var data = { 'name': 'John', 'time': '2 pm' }; |
+ |
+ var parts = []; |
+ for (var key in data.keys) { |
+ parts.add('${Uri.encodeQueryComponent(key)}=' |
+ '${Uri.encodeQueryComponent(data[key])}'); |
+ } |
+ var encodedData = parts.join('&'); |
+ |
+ return HttpRequest.postFormData( |
+ '${window.location.protocol}//${window.location.host}/echo', data) |
+ .then((xhr) { |
+ expect(xhr.responseText, encodedData); |
+ }); |
+ }); |
+ |
}); |
group('xhr_requestBlob', () { |