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

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

Issue 11641005: Add cross-origin test with credentials. (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 unified diff | Download patch | Annotate | Revision Log
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 FormDataTest; 5 library FormDataTest;
6 6
7 import '../../pkg/unittest/lib/unittest.dart'; 7 import '../../pkg/unittest/lib/unittest.dart';
8 import '../../pkg/unittest/lib/html_config.dart'; 8 import '../../pkg/unittest/lib/html_config.dart';
9 import 'dart:html'; 9 import 'dart:html';
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 test('send', () { 53 test('send', () {
54 var form = new FormData(); 54 var form = new FormData();
55 var blobString = 'Indescribable... Indestructible! Nothing can stop it!'; 55 var blobString = 'Indescribable... Indestructible! Nothing can stop it!';
56 var blob = new Blob( 56 var blob = new Blob(
57 [blobString], 57 [blobString],
58 'text/plain'); 58 'text/plain');
59 form.append('theBlob', blob, 'theBlob.txt'); 59 form.append('theBlob', blob, 'theBlob.txt');
60 60
61 var xhr = new HttpRequest(); 61 var xhr = new HttpRequest();
62 xhr.open("POST", "http://localhost:9876/echo"); 62 xhr.open("POST", "http://localhost:${window.location.port}/echo");
63 63
64 xhr.on.load.add(expectAsync1((e) { 64 xhr.on.load.add(expectAsync1((e) {
65 expect(xhr.responseText.contains(blobString), true); 65 expect(xhr.responseText.contains(blobString), true);
66 })); 66 }));
67 xhr.on.error.add((e) { 67 xhr.on.error.add((e) {
68 fail('$e'); 68 fail('$e');
69 }); 69 });
70 xhr.send(form); 70 xhr.send(form);
71 }); 71 });
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698