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

Unified Diff: tests/html/xhr_cross_origin_test.dart

Issue 23640003: Adding support for cross-origin requests on IE9. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
Index: tests/html/xhr_cross_origin_test.dart
diff --git a/tests/html/xhr_cross_origin_test.dart b/tests/html/xhr_cross_origin_test.dart
index cb56240317d654bb84b42d85b718bc9a035c473f..a9eda406fb9e35f3cdfd1a010308d8a1a420d587 100644
--- a/tests/html/xhr_cross_origin_test.dart
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -56,6 +56,25 @@ main() {
});
});
+ test('XHR.requestCrossOrigin', () {
+ var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
+ return HttpRequest.requestCrossOrigin(url).then((response) {
+ expect(response, contains('feed'));
+ });
+ });
+
+ test('XHR.requestCrossOrigin errors', () {
+ var gotError = false;
+ return HttpRequest.requestCrossOrigin('does_not_exist').then((response) {
+ expect(true, isFalse, reason: '404s should fail request.');
+ }).catchError((error) {}, test: (error) {
+ gotError = true;
+ return true;
+ }).whenComplete(() {
+ expect(gotError, isTrue);
+ });
+ });
+
// Skip the rest if not supported.
if (!HttpRequest.supportsCrossOrigin) {
return;
« 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