OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 #library('FormDataTest'); | |
6 | |
7 #import('../../pkg/unittest/unittest.dart'); | |
8 #import('../../pkg/unittest/html_config.dart'); | |
9 #import('dart:html'); | |
10 | |
11 void main() { | |
12 // TODO(efortuna): This is a bad test. Revisit when we have tests that can run | |
13 // both a server and fire up a browser. | |
14 useHtmlConfiguration(); | |
15 | |
16 test('constructorTest1', () { | |
17 var form = new FormData(); | |
18 expect(form, isNotNull); | |
19 expect(form is FormData); | |
20 }); | |
21 | |
22 test('constructorTest2', () { | |
23 var form = new FormData(new FormElement()); | |
24 expect(form, isNotNull); | |
25 expect(form is FormData); | |
26 }); | |
27 | |
28 test('appendTest', () { | |
29 var form = new FormData(); | |
30 form.append('test', '1', 'foo'); | |
31 form.append('username', 'Elmo', 'foo'); | |
32 form.append('address', '1 Sesame Street', 'foo'); | |
33 form.append('password', '123456', 'foo'); | |
34 expect(form, isNotNull); | |
35 }); | |
36 } | |
OLD | NEW |