dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.26k stars 1.58k forks source link

FileSystem API not supported #3022

Closed DartBot closed 9 years ago

DartBot commented 12 years ago

This issue was originally filed by imj...@gmail.com


Using this code:

import('dart:html');

void main() {   window.webkitRequestFileSystem(Window.TEMPORARY, 5 1024 1024, (DOMFileSystem fs) {     window.console.log('Got Filesystem');     fs.root.getDirectory('path', successCallback: (Entry e) {       window.console.log('Got directory $e.name');     }, errorCallback: (FileError e) {       window.console.error(e);     });   }); }

In Dartium, I get the "Got Filesystem" message, but getting a directory (or file) results in an UnsupportedOperationException:

Stack Trace: 0. Function: 'DirectoryEntryImplementation.getDirectory' url: '/b/build/slave/dartium-mac-full/build/src/xcodebuild/DerivedSources/Release/webkit/bindings/dart/dart/DirectoryEntryImplementation.dart' line:20 col:3  1. Function: '::function' url: 'http://127.0.0.1:3030/Users/jasonhall/dart/filesystem/filesystem.dart' line:7 col:25

When running the generated JS (generated with dart2js), I get an UncaughtReferenceError stating that the errorCallback is not defined:

Uncaught ReferenceError: errorCallback is not defined filesystem.dart.js:2879 $.dynamicFunction.DOMWindow nullCheckMethod $.dynamicBind bind $.main (anonymous function)

I suppose this is probably a known issue, but I figured I'd file this to track its progress. This might be considered a duplicate of Issue #1241 as well.

DartBot commented 12 years ago

This comment was originally written by antonm@google.com


Pavel, may you have a look, please?


Set owner to podivilov@google.com. Added Area-Dartium, Accepted labels.

DartBot commented 12 years ago

This comment was originally written by podivilov@google.com


Added Started label.

DartBot commented 12 years ago

This comment was originally written by podivilov@google.com


Fixed in Dartium. Still doesn't work in frog though. Stephen, could you please take a look?

DartBot commented 12 years ago

This comment was originally written by podivilov@google.com


Set owner to @rakudrama. Added Triaged label.

efortuna commented 12 years ago

There is also some issue with dart2js as well (note: This error showed up when podilvilov's change went in, but because there were multiple commits I am marking the test as skip rather than reverting the commit):

CONSOLE MESSAGE: line 7935: Uncaught ReferenceError: errorCallback is not defined Content-Type: text/plain Running /mnt/data/b/build/slave/web-chrome-linux/build/dart/tests/html/fileapi_test.dart

EOF

FAILED: dart2js-drt release_ia32 html/fileapi_test Expected: pass Actual: fail

DartBot commented 12 years ago

This comment was originally written by antonm@google.com


Added this to the M1 milestone. Removed Area-Dartium label. Added Area-DOM, Accepted labels.

rakudrama commented 12 years ago

Marked this as being blocked by #3536.

iposva-google commented 12 years ago

Removed Area-DOM label. Added Area-HTML label.

vsmenon commented 12 years ago

Removed the owner. Added Triaged label.

sethladd commented 12 years ago

Marked this as being blocked by #3536. Unmarked this as being blocked by #3536.

DartBot commented 12 years ago

This comment was originally written by jjinux...@google.com


This may be the same as issue #4549. I.e. we might be passing a Dart has instead of a normal JavaScript object to getDirectory.

vsmenon commented 12 years ago

This test is being skipped. We should try it again. The test may have bugs in the use of expectAsync.

blois commented 12 years ago

Set owner to @blois. Added Accepted label.

blois commented 12 years ago

This appears to be working properly on the latest bits, I am updating the tests to run correctly.

FYI- the syntax for the latest bits is: window.webkitRequestFileSystem(Window.TEMPORARY, 5 1024 1024, (DOMFileSystem fs) {     window.console.log('Got Filesystem');     fs.root.getDirectory('path',       options: {'create': true },       successCallback: (Entry e) {         window.console.log('Got directory $e.name');       },       errorCallback: (FileError e) {         window.console.error(e);       });   });

blois commented 12 years ago

Tests have been updated and are enabled.


Added Fixed label.