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

Unified Diff: tests/html/xhr_cross_origin_test.dart

Issue 12625006: Fixing IE10 CORS test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 d4dbecdc13a83f8a0165343f08a1bb31f32a238d..baa4282cd9a7bea1d70d11fbb8627bac403e6dfe 100644
--- a/tests/html/xhr_cross_origin_test.dart
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -28,12 +28,13 @@ main() {
useHtmlConfiguration();
var port = crossOriginPort;
+ var host = '${window.location.protocol}//${window.location.hostname}:$port';
test('XHR Cross-domain', () {
- var url = "http://localhost:$port/"
- "root_dart/tests/html/xhr_cross_origin_data.txt";
+ var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
var xhr = new HttpRequest();
xhr.open('GET', url, async: true);
+ xhr.withCredentials = true;
var validate = expectAsync1((data) {
expect(data, contains('feed'));
expect(data['feed'], contains('entry'));
@@ -50,8 +51,7 @@ main() {
});
test('XHR.get Cross-domain', () {
- var url = "http://localhost:$port/"
- "root_dart/tests/html/xhr_cross_origin_data.txt";
+ var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
HttpRequest.request(url).then(expectAsync1((xhr) {
var data = json.parse(xhr.response);
expect(data, contains('feed'));
@@ -61,8 +61,7 @@ main() {
});
test('XHR.getWithCredentials Cross-domain', () {
- var url = "http://localhost:$port/"
- "root_dart/tests/html/xhr_cross_origin_data.txt";
+ var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt';
HttpRequest.request(url, withCredentials: true).then(expectAsync1((xhr) {
var data = json.parse(xhr.response);
expect(data, contains('feed'));

Powered by Google App Engine
This is Rietveld 408576698