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

Unified Diff: tests/html/xhr_test.dart

Issue 12041082: Adding supported checks for HttpRequestProgressEvent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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') | tools/dom/scripts/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/xhr_test.dart
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart
index 64a1828ec967f54c83963354baef5cdb3fdfd86a..c5d16a3287f550218061305821566093f914565a 100644
--- a/tests/html/xhr_test.dart
+++ b/tests/html/xhr_test.dart
@@ -4,12 +4,12 @@
library XHRTest;
import '../../pkg/unittest/lib/unittest.dart';
-import '../../pkg/unittest/lib/html_config.dart';
+import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
import 'dart:json' as json;
main() {
- useHtmlConfiguration();
+ useHtmlIndividualConfiguration();
var url = "/tests/html/xhr_cross_origin_data.txt";
void validate200Response(xhr) {
@@ -25,53 +25,70 @@ main() {
expect(xhr.responseText, equals(''));
}
- test('XHR No file', () {
- HttpRequest xhr = new HttpRequest();
- xhr.open("GET", "NonExistingFile", true);
- xhr.on.readyStateChange.add(expectAsyncUntil1((event) {
- if (xhr.readyState == HttpRequest.DONE) {
- validate404(xhr);
- }
- }, () => xhr.readyState == HttpRequest.DONE));
- xhr.send();
+ group('supported_HttpRequestProgressEvent', () {
+ test('supported', () {
+ expect(HttpRequestProgressEvent.supported, isTrue);
+ });
});
- test('XHR file', () {
- var xhr = new HttpRequest();
- xhr.open('GET', url, true);
- xhr.on.readyStateChange.add(expectAsyncUntil1((e) {
- if (xhr.readyState == HttpRequest.DONE) {
- validate200Response(xhr);
- }
- }, () => xhr.readyState == HttpRequest.DONE));
- xhr.send();
- });
+ group('xhr', () {
+ test('XHR No file', () {
+ HttpRequest xhr = new HttpRequest();
+ xhr.open("GET", "NonExistingFile", true);
+ xhr.on.readyStateChange.add(expectAsyncUntil1((event) {
+ if (xhr.readyState == HttpRequest.DONE) {
+ validate404(xhr);
+ }
+ }, () => xhr.readyState == HttpRequest.DONE));
+ xhr.send();
+ });
- test('XHR.get No file', () {
- new HttpRequest.get("NonExistingFile", expectAsync1((xhr) {
- expect(xhr.readyState, equals(HttpRequest.DONE));
- validate404(xhr);
- }));
- });
+ test('XHR file', () {
+ var xhr = new HttpRequest();
+ xhr.open('GET', url, true);
+ xhr.on.readyStateChange.add(expectAsyncUntil1((e) {
+ if (xhr.readyState == HttpRequest.DONE) {
+ validate200Response(xhr);
+ }
+ }, () => xhr.readyState == HttpRequest.DONE));
+ xhr.send();
+ });
- test('XHR.get file', () {
- var xhr = new HttpRequest.get(url, expectAsync1((event) {
- expect(event.readyState, equals(HttpRequest.DONE));
- validate200Response(event);
- }));
- });
+ test('XHR.get No file', () {
+ new HttpRequest.get("NonExistingFile", expectAsync1((xhr) {
+ expect(xhr.readyState, equals(HttpRequest.DONE));
+ validate404(xhr);
+ }));
+ });
- test('XHR.getWithCredentials No file', () {
- new HttpRequest.getWithCredentials("NonExistingFile", expectAsync1((xhr) {
- expect(xhr.readyState, equals(HttpRequest.DONE));
- validate404(xhr);
- }));
- });
+ test('XHR.get file', () {
+ var xhr = new HttpRequest.get(url, expectAsync1((event) {
+ expect(event.readyState, equals(HttpRequest.DONE));
+ validate200Response(event);
+ }));
+ });
+
+ test('XHR.getWithCredentials No file', () {
+ new HttpRequest.getWithCredentials("NonExistingFile", expectAsync1((xhr) {
+ expect(xhr.readyState, equals(HttpRequest.DONE));
+ validate404(xhr);
+ }));
+ });
+
+ test('XHR.getWithCredentials file', () {
+ new HttpRequest.getWithCredentials(url, expectAsync1((xhr) {
+ expect(xhr.readyState, equals(HttpRequest.DONE));
+ validate200Response(xhr);
+ }));
+ });
- test('XHR.getWithCredentials file', () {
- new HttpRequest.getWithCredentials(url, expectAsync1((xhr) {
- expect(xhr.readyState, equals(HttpRequest.DONE));
- validate200Response(xhr);
- }));
+ test('HttpRequestProgressEvent', () {
+ var expectation = HttpRequestProgressEvent.supported ?
+ returnsNormally : throws;
+ expect(() {
+ var event = new Event.eventType('XMLHttpRequestProgressEvent', '');
+ expect(event is HttpRequestProgressEvent, isTrue);
+ }, expectation);
+ });
});
}
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698