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

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('directory2', {}, (e) {
Anton Muhin 2012/05/15 18:32:23 this is very hard to read, but luckily starting fr
podivilov 2012/05/16 13:49:25 Done.
14 Expect.fail('Should not be reached');
15 callbackDone();
16 }, (e) {
17 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
18 callbackDone();
19 });
20
21 fs.root.getDirectory('directory3', {'create': true}, (e) {
22 Expect.equals('directory3', e.name);
23 callbackDone();
24 }, (e) {
25 Expect.fail('Got file error: ${e.code}');
26 callbackDone();
27 });
28 });
29
30 asyncTest('getFile', 2, () {
31 Expect.throws(() => fs.root.getFile('file1', {'x': true}, (e) {}));
32
33 fs.root.getDirectory('file2', {}, (e) {
34 Expect.fail('Should not be reached');
35 callbackDone();
36 }, (e) {
37 Expect.equals(FileError.NOT_FOUND_ERR, e.code);
38 callbackDone();
39 });
40
41 fs.root.getDirectory('file3', {'create': true}, (e) {
42 Expect.equals('file3', e.name);
43 callbackDone();
44 }, (e) {
45 Expect.fail('Got file error: ${e.code}');
46 callbackDone();
47 });
48 });
49 });
50 }
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