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

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

Issue 10449091: Removed asyncTest and improved comments. (Closed) Base URL: http://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 asyncTest('getDirectory', 2, () { 10 test('getDirectory', () {
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: (e) { 16 successCallback:
17 Expect.fail('Should not be reached'); 17 (e) => guardAsync(() => Expect.fail('Should not be reached')),
18 callbackDone(); 18 errorCallback:
19 }, 19 expectAsync1((e) => Expect.equals(FileError.NOT_FOUND_ERR, e.code))
20 errorCallback: (e) { 20 );
21 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
22 callbackDone();
23 });
24 21
25 fs.root.getDirectory( 22 fs.root.getDirectory(
26 'directory3', 23 'directory3',
27 flags: {'create': true}, 24 flags: {'create': true},
28 successCallback: (e) { 25 successCallback:
29 Expect.equals('directory3', e.name); 26 expectAsync1((e) => Expect.equals('directory3', e.name)),
30 callbackDone(); 27 errorCallback:
31 }, 28 (e) => guardAsync(() => Expect.fail('Got file error: ${e.code}'))
32 errorCallback: (e) { 29 );
33 Expect.fail('Got file error: ${e.code}');
34 callbackDone();
35 });
36 }); 30 });
37 31
38 asyncTest('getFile', 2, () { 32 test('getFile', () {
39 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {})); 33 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {}));
40 34
41 fs.root.getDirectory( 35 fs.root.getDirectory(
42 'file2', 36 'file2',
43 flags: {}, 37 flags: {},
44 successCallback: (e) { 38 successCallback:
45 Expect.fail('Should not be reached'); 39 (e) => guardAsync(() => Expect.fail('Should not be reached')),
46 callbackDone(); 40 errorCallback:
47 }, 41 expectAsync1((e) => Expect.equals(FileError.NOT_FOUND_ERR, e.code))
48 errorCallback: (e) { 42 );
49 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
50 callbackDone();
51 });
52 43
53 fs.root.getDirectory( 44 fs.root.getDirectory(
54 'file3', 45 'file3',
55 flags: {'create': true}, 46 flags: {'create': true},
56 successCallback: (e) { 47 successCallback:
57 Expect.equals('file3', e.name); 48 expectAsync1((e) => Expect.equals('file3', e.name)),
58 callbackDone(); 49 errorCallback:
59 }, 50 (e) => guardAsync(() => Expect.fail('Got file error: ${e.code}'))
60 errorCallback: (e) { 51 );
61 Expect.fail('Got file error: ${e.code}');
62 callbackDone();
63 });
64 }); 52 });
65 }); 53 });
66 } 54 }
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