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

Issue 14642012: dart:io | Add asynchronous versions of the methods of FileSystemEntity and Link. (Closed)

Created:
7 years, 7 months ago by Bill Hesse
Modified:
7 years, 7 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

dart:io | Add asynchronous versions of the methods of FileSystemEntity and Link. BUG= R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=22354

Patch Set 1 #

Patch Set 2 : Add new async test file. #

Total comments: 2

Patch Set 3 : Restore platform guard on Windows-specific test #

Patch Set 4 : Update status file and fix checked mode #

Total comments: 15

Patch Set 5 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+645 lines, -17 lines) Patch
M runtime/bin/file.h View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/bin/file.cc View 3 chunks +21 lines, -2 lines 0 comments Download
M sdk/lib/io/file_impl.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/io/file_system_entity.dart View 1 2 2 chunks +30 lines, -0 lines 0 comments Download
M sdk/lib/io/link.dart View 1 chunk +11 lines, -2 lines 0 comments Download
M tests/standalone/io/file_read_special_device_test.dart View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
A tests/standalone/io/file_system_async_links_test.dart View 1 2 3 4 1 chunk +237 lines, -0 lines 0 comments Download
M tests/standalone/io/file_system_links_test.dart View 1 2 3 4 1 chunk +10 lines, -7 lines 0 comments Download
A tests/standalone/io/link_async_test.dart View 1 2 3 4 1 chunk +223 lines, -0 lines 0 comments Download
A tests/standalone/io/windows_file_system_async_links_test.dart View 1 2 3 4 1 chunk +105 lines, -0 lines 0 comments Download
M tests/standalone/io/windows_file_system_links_test.dart View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M tests/standalone/standalone.status View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Bill Hesse
https://codereview.chromium.org/14642012/diff/2001/sdk/lib/io/file_system_entity.dart File sdk/lib/io/file_system_entity.dart (right): https://codereview.chromium.org/14642012/diff/2001/sdk/lib/io/file_system_entity.dart#newcode61 sdk/lib/io/file_system_entity.dart:61: _throwIfError(result, 'Error in FileSystemEntity.identical'); Error should be on the ...
7 years, 7 months ago (2013-05-02 14:02:42 UTC) #1
Søren Gjesse
LGTM I really like the comprehensive testing! https://codereview.chromium.org/14642012/diff/8001/sdk/lib/io/file_system_entity.dart File sdk/lib/io/file_system_entity.dart (right): https://codereview.chromium.org/14642012/diff/8001/sdk/lib/io/file_system_entity.dart#newcode47 sdk/lib/io/file_system_entity.dart:47: new Future(() ...
7 years, 7 months ago (2013-05-03 07:13:36 UTC) #2
Bill Hesse
Committed patchset #5 manually as r22354 (presubmit successful).
7 years, 7 months ago (2013-05-03 08:39:31 UTC) #3
Bill Hesse
7 years, 7 months ago (2013-05-03 08:44:06 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/14642012/diff/8001/sdk/lib/io/file_system_ent...
File sdk/lib/io/file_system_entity.dart (right):

https://codereview.chromium.org/14642012/diff/8001/sdk/lib/io/file_system_ent...
sdk/lib/io/file_system_entity.dart:47: new Future(() => _getTypeSync(path,
followLinks));
On 2013/05/03 07:13:36, Søren Gjesse wrote:
> This still needs to be calling a service finction on the native thread to be
> truly async.

This is done in a follow-up CL, already written.  I can merge them, but I prefer
not to.

https://codereview.chromium.org/14642012/diff/8001/sdk/lib/io/file_system_ent...
sdk/lib/io/file_system_entity.dart:80: => new Future<FileSystemEntityType>(
On 2013/05/02 14:02:42, Bill Hesse wrote:
> This function could be changed to its final, correct form using _getTypeAsync
> already, as the ones below are.

Done in the second CL.

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/io/file_s...
File tests/standalone/io/file_system_async_links_test.dart (right):

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/io/file_s...
tests/standalone/io/file_system_async_links_test.dart:28: Future
testFileExistsCreate() =>
On 2013/05/03 07:13:36, Søren Gjesse wrote:
> Add a receive port to keep the test alive until the lsat async operation
> completes.
> 
> For the other tests as well.

This is done in the main method, which calls this.
The tests can be run serially, or in parallel, since they all return Futures. 
Right now they are run serially, but perhaps we should shift to parallel.

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/io/file_s...
tests/standalone/io/file_system_async_links_test.dart:28: Future
testFileExistsCreate() =>
On 2013/05/03 07:13:36, Søren Gjesse wrote:
> Normally we don't use the => syntax for long methods.

In this case, it was possible for all of them, since they all are a single
expression.  But I will change them.

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/io/file_s...
tests/standalone/io/file_system_async_links_test.dart:49: .then((_) => new
File(y).create())
On 2013/05/03 07:13:36, Søren Gjesse wrote:
> Shouldn't this be creating the file x - or am I missing something here? Up til
> this point the only file system object which exists is the link y -> x.

This is testing that file creation through a link succeeds - that a broken link
with a nonexistent target creates its target if create is called with the link
path.  That is the semantics (on posix), and is what is tested here.

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/standalon...
File tests/standalone/standalone.status (right):

https://codereview.chromium.org/14642012/diff/8001/tests/standalone/standalon...
tests/standalone/standalone.status:51: # Links on Windows are tested by
windows_file_system_[async_]links_test instead.
On 2013/05/03 07:13:36, Søren Gjesse wrote:
> How about moving this comment into the files and just return from main on
> Windows? This keeps the status file cleaner.

Done.  Also added to file_read_special_device_test, so the entire section is
removed.  Comment added to both posix and windows tests, mentioning the other.

Powered by Google App Engine
This is Rietveld 408576698