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

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

Issue 10447126: Revert "Removed asyncTest and improved comments." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/unittest/unittest.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('fileapi'); 1 #library('fileapi');
2 #import('../../lib/unittest/unittest.dart'); 2 #import('../../lib/unittest/unittest.dart');
3 #import('../../lib/unittest/html_config.dart'); 3 #import('../../lib/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 main() { 6 main() {
7 useHtmlConfiguration(); 7 useHtmlConfiguration();
8 window.webkitRequestFileSystem(Window.TEMPORARY, 100, (fs) { 8 window.webkitRequestFileSystem(Window.TEMPORARY, 100, (fs) {
9 // FIXME: add types to callback arguments after migration to wrapperless dar t:html. 9 // FIXME: add types to callback arguments after migration to wrapperless dar t:html.
10 test('getDirectory', () { 10 asyncTest('getDirectory', 2, () {
11 Expect.throws(() => fs.root.getDirectory('directory1', {'x': true}, (e) {} )); 11 Expect.throws(() => fs.root.getDirectory('directory1', {'x': true}, (e) {} ));
12 12
13 fs.root.getDirectory( 13 fs.root.getDirectory(
14 'directory2', 14 'directory2',
15 flags: {}, 15 flags: {},
16 successCallback: 16 successCallback: (e) {
17 (e) => guardAsync(() => Expect.fail('Should not be reached')), 17 Expect.fail('Should not be reached');
18 errorCallback: 18 callbackDone();
19 expectAsync1((e) => Expect.equals(FileError.NOT_FOUND_ERR, e.code)) 19 },
20 ); 20 errorCallback: (e) {
21 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
22 callbackDone();
23 });
21 24
22 fs.root.getDirectory( 25 fs.root.getDirectory(
23 'directory3', 26 'directory3',
24 flags: {'create': true}, 27 flags: {'create': true},
25 successCallback: 28 successCallback: (e) {
26 expectAsync1((e) => Expect.equals('directory3', e.name)), 29 Expect.equals('directory3', e.name);
27 errorCallback: 30 callbackDone();
28 (e) => guardAsync(() => Expect.fail('Got file error: ${e.code}')) 31 },
29 ); 32 errorCallback: (e) {
33 Expect.fail('Got file error: ${e.code}');
34 callbackDone();
35 });
30 }); 36 });
31 37
32 test('getFile', () { 38 asyncTest('getFile', 2, () {
33 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {})); 39 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {}));
34 40
35 fs.root.getDirectory( 41 fs.root.getDirectory(
36 'file2', 42 'file2',
37 flags: {}, 43 flags: {},
38 successCallback: 44 successCallback: (e) {
39 (e) => guardAsync(() => Expect.fail('Should not be reached')), 45 Expect.fail('Should not be reached');
40 errorCallback: 46 callbackDone();
41 expectAsync1((e) => Expect.equals(FileError.NOT_FOUND_ERR, e.code)) 47 },
42 ); 48 errorCallback: (e) {
49 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
50 callbackDone();
51 });
43 52
44 fs.root.getDirectory( 53 fs.root.getDirectory(
45 'file3', 54 'file3',
46 flags: {'create': true}, 55 flags: {'create': true},
47 successCallback: 56 successCallback: (e) {
48 expectAsync1((e) => Expect.equals('file3', e.name)), 57 Expect.equals('file3', e.name);
49 errorCallback: 58 callbackDone();
50 (e) => guardAsync(() => Expect.fail('Got file error: ${e.code}')) 59 },
51 ); 60 errorCallback: (e) {
61 Expect.fail('Got file error: ${e.code}');
62 callbackDone();
63 });
52 }); 64 });
53 }); 65 });
54 } 66 }
OLDNEW
« no previous file with comments | « lib/unittest/unittest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698