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

Unified Diff: tests/html/xhr_test.dart

Issue 16376006: Fixing HttpRequest.upload.onProgress. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | « sdk/lib/html/dart2js/html_dart2js.dart ('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 484b2e7642e7860313aea67d43c62c31b1f125c3..c3e43dbac10d88d5f549481ae0334d482f38bd39 100644
--- a/tests/html/xhr_test.dart
+++ b/tests/html/xhr_test.dart
@@ -179,6 +179,31 @@ main() {
HttpRequest.request(url, mimeType: 'application/binary');
}, expectation);
});
+
+ if (Platform.supportsTypedData) {
+ test('xhr upload', () {
+ var xhr = new HttpRequest();
+ var progressCalled = false;
+ xhr.upload.onProgress.listen((e) {
+ progressCalled = true;
+ });
+
+ xhr.open('POST',
+ '${window.location.protocol}//${window.location.host}/echo');
+
+ // 10MB of payload data w/ a bit of data to make sure it
+ // doesn't get compressed to nil.
+ var data = new Uint8List(10 * 1024 * 1024);
+ for (var i = 0; i < data.length; ++i) {
+ data[i] = i & 0xFF;
+ }
+ xhr.send(data);
+
+ return xhr.onLoadEnd.first.then((_) {
+ expect(progressCalled, isTrue);
+ });
+ });
+ }
});
group('xhr_requestBlob', () {
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698