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

Side by Side Diff: tests/html/xhr_cross_origin_test.dart

Issue 12087119: Fixing htm/xhr_cross_origin test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library XHRCrossOriginTest; 5 library XHRCrossOriginTest;
6 import '../../pkg/unittest/lib/unittest.dart'; 6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_config.dart'; 7 import '../../pkg/unittest/lib/html_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:json' as json; 9 import 'dart:json' as json;
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 if (xhr.readyState == HttpRequest.DONE) { 43 if (xhr.readyState == HttpRequest.DONE) {
44 validate(json.parse(xhr.response)); 44 validate(json.parse(xhr.response));
45 } 45 }
46 }); 46 });
47 }); 47 });
48 xhr.send(); 48 xhr.send();
49 }); 49 });
50 50
51 test('XHR.get Cross-domain', () { 51 test('XHR.get Cross-domain', () {
52 var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt"; 52 var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt";
53 new HttpRequest.get(url, expectAsync1((xhr) { 53 HttpRequest.request(url).then(expectAsync1((xhr) {
54 var data = json.parse(xhr.response); 54 var data = json.parse(xhr.response);
55 expect(data, contains('feed')); 55 expect(data, contains('feed'));
56 expect(data['feed'], contains('entry')); 56 expect(data['feed'], contains('entry'));
57 expect(data, isMap); 57 expect(data, isMap);
58 })); 58 }));
59 }); 59 });
60 60
61 test('XHR.getWithCredentials Cross-domain', () { 61 test('XHR.getWithCredentials Cross-domain', () {
62 var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt"; 62 var url = "http://localhost:$port/tests/html/xhr_cross_origin_data.txt";
63 new HttpRequest.getWithCredentials(url, expectAsync1((xhr) { 63 HttpRequest.request(url, withCredentials: true).then(expectAsync1((xhr) {
64 var data = json.parse(xhr.response); 64 var data = json.parse(xhr.response);
65 expect(data, contains('feed')); 65 expect(data, contains('feed'));
66 expect(data['feed'], contains('entry')); 66 expect(data['feed'], contains('entry'));
67 expect(data, isMap); 67 expect(data, isMap);
68 })); 68 }));
69 }); 69 });
70 } 70 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698