OLD | NEW |
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 'package:unittest/unittest.dart'; |
7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import 'package:unittest/html_individual_config.dart'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import "dart:convert"; | 9 import "dart:convert"; |
10 | 10 |
11 /** | 11 /** |
12 * Examine the value of "crossOriginPort" as passed in from the url from | 12 * Examine the value of "crossOriginPort" as passed in from the url from |
13 * [window.location] to determine what the cross-origin port is for | 13 * [window.location] to determine what the cross-origin port is for |
14 * this test. | 14 * this test. |
15 */ | 15 */ |
16 // TODO(efortuna): If we need to use this function frequently, make a | 16 // TODO(efortuna): If we need to use this function frequently, make a |
17 // url_analyzer library that is part of test.dart that these tests can import. | 17 // url_analyzer library that is part of test.dart that these tests can import. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt'; | 101 var url = '$host/root_dart/tests/html/xhr_cross_origin_data.txt'; |
102 return HttpRequest.request(url, withCredentials: true).then((xhr) { | 102 return HttpRequest.request(url, withCredentials: true).then((xhr) { |
103 var data = JSON.decode(xhr.response); | 103 var data = JSON.decode(xhr.response); |
104 expect(data, contains('feed')); | 104 expect(data, contains('feed')); |
105 expect(data['feed'], contains('entry')); | 105 expect(data['feed'], contains('entry')); |
106 expect(data, isMap); | 106 expect(data, isMap); |
107 }); | 107 }); |
108 }); | 108 }); |
109 }); | 109 }); |
110 } | 110 } |
OLD | NEW |