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

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

Issue 11236008: Start a whitelist of methods those optionals should be treated as named formals in dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('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('../../pkg/unittest/unittest.dart'); 2 #import('../../pkg/unittest/unittest.dart');
3 #import('../../pkg/unittest/html_config.dart'); 3 #import('../../pkg/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 void fail(message) { 6 void fail(message) {
7 guardAsync(() { 7 guardAsync(() {
8 Expect.fail(message); 8 Expect.fail(message);
9 }); 9 });
10 } 10 }
11 11
12 DOMFileSystem fs; 12 DOMFileSystem fs;
13 13
14 main() { 14 main() {
15 useHtmlConfiguration(); 15 useHtmlConfiguration();
16 test('getFileSystem', () { 16 test('getFileSystem', () {
17 window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 100, expectAsync1( 17 window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 100, expectAsync1(
18 (DOMFileSystem fileSystem) { 18 (DOMFileSystem fileSystem) {
19 fs = fileSystem; 19 fs = fileSystem;
20 }), 20 }),
21 (e) { 21 (e) {
22 fail('Got file error: ${e.code}'); 22 fail('Got file error: ${e.code}');
23 }); 23 });
24 }); 24 });
25 group('getDirectory', () { 25 group('getDirectory', () {
26 26
27 test('directoryDoesntExist', () { 27 test('directoryDoesntExist', () {
28 /* OPTIONALS
29 fs.root.getDirectory( 28 fs.root.getDirectory(
30 'directory2', 29 'directory2',
31 options: {}, 30 options: {},
32 successCallback: (e) { 31 successCallback: (e) {
33 fail('Should not be reached'); 32 fail('Should not be reached');
34 }, 33 },
35 errorCallback: expectAsync1((FileError e) { 34 errorCallback: expectAsync1((FileError e) {
36 expect(e.code, equals(FileError.NOT_FOUND_ERR)); 35 expect(e.code, equals(FileError.NOT_FOUND_ERR));
37 })); 36 }));
38 */
39 fs.root.getDirectory(
40 'directory2',
41 {},
42 (e) {
43 fail('Should not be reached');
44 },
45 expectAsync1((FileError e) {
46 expect(e.code, equals(FileError.NOT_FOUND_ERR));
47 }));
48 }); 37 });
49 38
50 test('directoryCreate', () { 39 test('directoryCreate', () {
51 /* OPTIONALS
52 fs.root.getDirectory( 40 fs.root.getDirectory(
53 'directory3', 41 'directory3',
54 options: {'create': true}, 42 options: {'create': true},
55 successCallback: expectAsync1((DirectoryEntry e) { 43 successCallback: expectAsync1((DirectoryEntry e) {
56 expect(e.name, equals('directory3')); 44 expect(e.name, equals('directory3'));
57 }), 45 }),
58 errorCallback: (e) { 46 errorCallback: (e) {
59 fail('Got file error: ${e.code}'); 47 fail('Got file error: ${e.code}');
60 }); 48 });
61 */
62 fs.root.getDirectory(
63 'directory3',
64 {'create': true},
65 expectAsync1((DirectoryEntry e) {
66 expect(e.name, equals('directory3'));
67 }),
68 (e) {
69 fail('Got file error: ${e.code}');
70 });
71 }); 49 });
72 }); 50 });
73 51
74 group('getFile', () { 52 group('getFile', () {
75 53
76 test('fileDoesntExist', () { 54 test('fileDoesntExist', () {
77 /* OPTIONALS
78 fs.root.getFile( 55 fs.root.getFile(
79 'file2', 56 'file2',
80 options: {}, 57 options: {},
81 successCallback: (e) { 58 successCallback: (e) {
82 fail('Should not be reached'); 59 fail('Should not be reached');
83 }, 60 },
84 errorCallback: expectAsync1((FileError e) { 61 errorCallback: expectAsync1((FileError e) {
85 expect(e.code, equals(FileError.NOT_FOUND_ERR)); 62 expect(e.code, equals(FileError.NOT_FOUND_ERR));
86 })); 63 }));
87 */
88 fs.root.getFile(
89 'file2',
90 {},
91 (e) {
92 fail('Should not be reached');
93 },
94 expectAsync1((FileError e) {
95 expect(e.code, equals(FileError.NOT_FOUND_ERR));
96 }));
97 }); 64 });
98 65
99 test('fileCreate', () { 66 test('fileCreate', () {
100 /* OPTIONALS
101 fs.root.getFile( 67 fs.root.getFile(
102 'file4', 68 'file4',
103 options: {'create': true}, 69 options: {'create': true},
104 successCallback: expectAsync1((FileEntry e) { 70 successCallback: expectAsync1((FileEntry e) {
105 expect(e.name, equals('file4')); 71 expect(e.name, equals('file4'));
106 expect(e.isFile, equals(true)); 72 expect(e.isFile, equals(true));
107 }), 73 }),
108 errorCallback: (e) { 74 errorCallback: (e) {
109 fail('Got file error: ${e.code}'); 75 fail('Got file error: ${e.code}');
110 }); 76 });
111 }); 77 });
112 */
113 fs.root.getFile(
114 'file4',
115 {'create': true},
116 expectAsync1((FileEntry e) {
117 expect(e.name, equals('file4'));
118 expect(e.isFile, equals(true));
119 }),
120 (e) {
121 fail('Got file error: ${e.code}');
122 });
123 });
124 }); 78 });
125 } 79 }
OLDNEW
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698