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

Unified Diff: tests/html/xhr_cross_origin_test.dart

Issue 11641005: Add cross-origin test with credentials. (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
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 d39af2c85e388bcfdb6e6e60f0f352ff50b9f429..e01b285cfa14c7af836760bbba57935161f175c1 100644
--- a/tests/html/xhr_cross_origin_test.dart
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -11,8 +11,10 @@ import 'dart:json';
main() {
useHtmlConfiguration();
+ var port = getCrossOriginPortNumber();
+
test('XHR Cross-domain', () {
- var url = "http://localhost:9876/tests/html/xhr_cross_origin_data.txt";
+ var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt";
var xhr = new HttpRequest();
xhr.open('GET', url, true);
var validate = expectAsync1((data) {
@@ -31,7 +33,7 @@ main() {
});
test('XHR.get Cross-domain', () {
- var url = "http://localhost:9876/tests/html/xhr_cross_origin_data.txt";
+ var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt";
new HttpRequest.get(url, expectAsync1((xhr) {
var data = JSON.parse(xhr.response);
expect(data, contains('feed'));
@@ -39,4 +41,14 @@ main() {
expect(data, isMap);
}));
});
+
+ test('XHR.getWithCredentials Cross-domain', () {
+ var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt";
+ new HttpRequest.getWithCredentials(url, expectAsync1((xhr) {
+ var data = JSON.parse(xhr.response);
+ expect(data, contains('feed'));
+ expect(data['feed'], contains('entry'));
+ expect(data, isMap);
+ }));
+ });
}

Powered by Google App Engine
This is Rietveld 408576698