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

Issue 8965036: Add asynchronous versions of the methods on Directory. (Closed)

Created:
9 years ago by Mads Ager (google)
Modified:
9 years ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add asynchronous versions of the methods on Directory. For now, use an isolate to make the operations async from the point of view of the main Dart thread. Clean up the directory tests a bit by removing code that didn't do anything and by removing file testing that is already covered by the file tests. R=sgjesse@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2617

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -91 lines) Patch
M runtime/bin/builtin_natives.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/bin/directory.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/bin/directory.dart View 1 3 chunks +44 lines, -6 lines 0 comments Download
M runtime/bin/directory_impl.dart View 6 chunks +183 lines, -32 lines 0 comments Download
M tests/standalone/src/DirectoryTest.dart View 1 6 chunks +57 lines, -47 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
9 years ago (2011-12-20 08:29:22 UTC) #1
Søren Gjesse
lgtm http://codereview.chromium.org/8965036/diff/1/runtime/bin/directory.dart File runtime/bin/directory.dart (right): http://codereview.chromium.org/8965036/diff/1/runtime/bin/directory.dart#newcode52 runtime/bin/directory.dart:52: * Synchronously creates a temporary directory with a ...
9 years ago (2011-12-20 09:12:40 UTC) #2
Mads Ager (google)
9 years ago (2011-12-20 09:26:24 UTC) #3
http://codereview.chromium.org/8965036/diff/1/runtime/bin/directory.dart
File runtime/bin/directory.dart (right):

http://codereview.chromium.org/8965036/diff/1/runtime/bin/directory.dart#newc...
runtime/bin/directory.dart:52: * Synchronously creates a temporary directory
with a name based on the current path.
On 2011/12/20 09:12:40, Søren Gjesse wrote:
> Long line.

Done.

http://codereview.chromium.org/8965036/diff/1/tests/standalone/src/DirectoryT...
File tests/standalone/src/DirectoryTest.dart (right):

http://codereview.chromium.org/8965036/diff/1/tests/standalone/src/DirectoryT...
tests/standalone/src/DirectoryTest.dart:56: static void testExistsCreateDelete()
{
On 2011/12/20 09:12:40, Søren Gjesse wrote:
> We should avoid using /tmp, or at least check for it's existence - on Windows
> there is a high probability that it does not exist. I prepared the following
> change on my Windows machine at some point, but I forgot to get it reviewed
and
> committed.
> 
> -    Directory d = new Directory("/tmp/dart_temp_dir_");
> +    Directory d;
> +    if (new Directory("/tmp").existsSync()) {
> +      d = new Directory("/tmp/dart_temp_dir_");
> +    } else {
> +      d = new Directory("");
> +    }
> 
> If we want to try to use /tmp a check like this is needed.

We have one test that does the check. Let's just use default temp directory
creation for these. Updated to pass in the empty string.

http://codereview.chromium.org/8965036/diff/1/tests/standalone/src/DirectoryT...
tests/standalone/src/DirectoryTest.dart:90: Directory d = new
Directory("/tmp/dart_temp_dir_");
On 2011/12/20 09:12:40, Søren Gjesse wrote:
> Ditto.

Done.

http://codereview.chromium.org/8965036/diff/1/tests/standalone/src/DirectoryT...
tests/standalone/src/DirectoryTest.dart:103: Directory tempDir1 = new
Directory("/tmp/dart_temp_dir_");
On 2011/12/20 09:12:40, Søren Gjesse wrote:
> Ditto.

This one does the check further down.

http://codereview.chromium.org/8965036/diff/1/tests/standalone/src/DirectoryT...
tests/standalone/src/DirectoryTest.dart:190: try {
On 2011/12/20 09:12:40, Søren Gjesse wrote:
> Can't we use Expect.throws here?

Done.

Powered by Google App Engine
This is Rietveld 408576698