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

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

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

Powered by Google App Engine
This is Rietveld 408576698