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

Unified Diff: tests/html/xhr_cross_origin_test.dart

Issue 10831314: Don't auto-send credentials on XHR.get (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test status for dart2js Created 8 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
« no previous file with comments | « tests/html/html.status ('k') | tests/html/xhr_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..8cc478989c7b1d5739ec56b601ca552a1be6a8e9
--- /dev/null
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#library('XHRCrossOriginTest');
+#import('../../lib/unittest/unittest.dart');
+#import('../../lib/unittest/html_config.dart');
+#import('dart:html');
+#import('dart:json');
+
+main() {
+ useHtmlConfiguration();
+
+ test('XHR Cross-domain', () {
+ var xhr = new XMLHttpRequest();
+ var url = "https://code.google.com/feeds/issues/p/dart/issues/full?alt=json";
+ xhr.open('GET', url, true);
+ var validate = expectAsync1((data) {
+ expect(data, contains('feed'));
+ expect(data['feed'], contains('entry'));
+ expect(data is Map, isTrue);
+ });
+ xhr.on.readyStateChange.add((e) {
+ guardAsync(() {
+ if (xhr.readyState == XMLHttpRequest.DONE) {
+ validate(JSON.parse(xhr.response));
+ }
+ });
+ });
+ xhr.send();
+ });
+
+ test('XHR.get Cross-domain', () {
+ var url = "https://code.google.com/feeds/issues/p/dart/issues/full?alt=json";
+ new XMLHttpRequest.get(url, expectAsync1((xhr) {
+ var data = JSON.parse(xhr.response);
+ expect(data, contains('feed'));
+ expect(data['feed'], contains('entry'));
+ expect(data is Map, isTrue);
+ }));
+ });
sra1 2012/08/14 21:44:18 Add a comment saying why there is not getWithCrede
+}
« no previous file with comments | « tests/html/html.status ('k') | tests/html/xhr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698