Commit Graph

2501 Commits

Author SHA1 Message Date
ager@google.com 9273d5c23b Fix HttpClientTest to use onData for reading out the data from the response stream.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9622009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5100 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 16:08:46 +00:00
sgjesse@google.com 67d055d29c Fix hostname lookup on Windows
The previous implementation was broken and did not use the result retreived from
gethostbyname. Changed the implementation to use getaddrinfo as gethostbyname has
been deprecated in the Winsock2 library.

Added a test to test that something can be read from www.google.com.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/io/HttpClientTest.dart

Review URL: https://chromiumcodereview.appspot.com//9624005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5097 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 15:18:50 +00:00
ngeoffray@google.com d77308a444 Skip non-client tests on legium.
Review URL: https://chromiumcodereview.appspot.com//9623001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5089 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 13:50:11 +00:00
sgjesse@google.com f0f34bf277 Add the ability to get the current directory
Added constructor current to directory. Use like this:

var cwd = Directory.current()

R=ager@google.com

BUG=dart:1793
TEST=tests/standalone/src/io/DirectoryTest.dart

Review URL: https://chromiumcodereview.appspot.com//9622001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5087 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 13:23:08 +00:00
sgjesse@google.com ac12107c2f Add method available to StringInputStream
The StringInputStream did not have any way for checking the number of
available characters. Added method available like on a binary
InputStream.

R=ager@google.com

BUG=dart:1945
TEST=tests/standalone/src/io/StringStreamTest.dart

Review URL: https://chromiumcodereview.appspot.com//9546003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5021 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 12:42:30 +00:00
sgjesse@google.com 144e6d044c Add handling of HTTP header "Expires"
The value of the "Expires" header is now available as a property on
the HttpResponse and the HttpClientResponse.

Added formatting of dates as HTTP dates in RFC 1123 format and parsing
of HTTP dates in all three formats mentioned in RFC 2616.

R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpDateTest.dart

Review URL: https://chromiumcodereview.appspot.com//9602011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5016 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 11:24:11 +00:00
sgjesse@google.com 93eecd778e Add handling of the HTTP header "Host"
R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpTest.dart

Review URL: https://chromiumcodereview.appspot.com//9616004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5015 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-06 10:59:28 +00:00
ager@google.com b2b123d24b Update Timer API to take the callback as the last parameter.
This makes the code easier to read when the callback actually does
work:

  new Timer(1000, (t) {
    // do
    // lots
    // of
    // stuff
  });

Also, it is more consistent with the rest of the APIs.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9597015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4945 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 12:43:41 +00:00
sgjesse@google.com b29e72fdbd Make the HttpParser and HttpUtil classes private
Move to separate files for sourcing these in the tests.

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9581011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4934 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 08:04:04 +00:00
sgjesse@google.com 768d34b7d6 Disable test tests/standalone/src/io/HttpShutdownTest on Windows
Test currently times out

TBR=ajohnsen@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9602005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4933 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 07:19:52 +00:00
sgjesse@google.com 086c1f0c3a Handle closing of HTTP client and server
For the server keep track of the state of the connection and close the
socket when it is closed by the client. The client might close the
connection both when processing a request and while the connection is
an idle keep alive connection.

For the client keep track of the active connections as well as the
idle keep alive connections. When the client is closed make sure to
close all connections.

R=ajohnsen@google.com

BUG=none
TEST=tests/standalone/src/io/HttpShutdownTest.dart

Review URL: https://chromiumcodereview.appspot.com//9589001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4932 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 07:06:37 +00:00
sgjesse@google.com bbf29e45ca Move all tests using dart:io to a separate directory
R=whesse@google.com, antonm@google.com, ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9572005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4867 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 10:56:37 +00:00
sgjesse@google.com 096badbb62 Use a pool of native ports for file operations
See description on https://chromiumcodereview.appspot.com/9568010/

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyFileOperationsTest.dart

Review URL: https://chromiumcodereview.appspot.com//9569010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4854 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-02 07:29:20 +00:00
antonm@google.com 4d8f29e9b0 Suppress another dart:io tests.
Review URL: https://chromiumcodereview.appspot.com//9570021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4815 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 18:50:58 +00:00
sgjesse@google.com b52a27889d Use a pool of native ports for directory operations
Each directory object creates a new service port which will start a
new thread. As these service ports are currently never closed this is
a huge problem causing the standalone VM to fail when running out of
threads.

This change uses a pool of native ports for directory operations. This
still ensures that the operations for each directory object are
serialized and limits the number of native ports allocated and thus
threads started.

Even when closing of native ports is possible we might want to keep
some kind of pool like this. The reason for this is that to actually
determine when the native port is not needed any more we need a
finalizer callback on the directory object.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/ManyDirectoryOperationsTest.dart

Review URL: https://chromiumcodereview.appspot.com//9568010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4795 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 14:29:12 +00:00
sgjesse@google.com 9091eeff05 Missing handling of default arguments in socket stream readInto
Also made it a bit easier to write a socket connection test.

R=ager@google.com

BUG=dart:1925
TEST=tests/standalone/src/Regress-1925.dart

Review URL: https://chromiumcodereview.appspot.com//9568006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4793 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 12:32:52 +00:00
ager@google.com 242bba108b Reapply dart:io API changes.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9568004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4790 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 10:07:35 +00:00
ager@google.com fd31551ca4 Revert "Rename blahHandler to onBlah throughout dart:io."
D'oh! I need to update the test binaries as well. Reverting, building
and putting back in again.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9570004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4785 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:43:15 +00:00
ager@google.com 40e0bceab5 Rename blahHandler to onBlah throughout dart:io.
Additionally, change all single-shot methods to take their callback as an argument instead of registering it on the object.

I have attempted to find all uses in the repo but there might
be some firefighting to do when this lands.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9500002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4784 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 09:36:04 +00:00
sgjesse@google.com 1ae77db2aa Add statusCode and reasonPhrase getters and setters to the HttpResponse interface
These where missing in the interface.

R=ager@google.com

BUG=dart:1919
TEST=tests/standalone/src/HttpTest.dart

Review URL: https://chromiumcodereview.appspot.com//9500014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4750 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 12:59:44 +00:00
ager@google.com fe50406304 Another attempt to fix flaky test.
Wait for both output and input stream on the same file to close.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9535004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4736 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 06:45:20 +00:00
srdjan@google.com ab3736b98d Fix issue 1845: Mint BIT_AND Smi was incorrect for negative Smi-s. Jump to slow case on negative Smi since the result will be Mint anyway.
Review URL: https://chromiumcodereview.appspot.com//9526001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4730 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-29 01:08:19 +00:00
sigmund@google.com 7c8d8e6bcb test.dart: fix TestRunnerTest actual tests
Review URL: https://chromiumcodereview.appspot.com//9510002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4711 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 17:56:36 +00:00
ager@google.com 4693a4c569 Do not compare the output before we know it has all been written.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9505002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4705 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 17:30:16 +00:00
sgjesse@google.com 45c283e649 Update FileTest.dart to aboid potential Windows failure
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9490010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4693 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 15:38:45 +00:00
sgjesse@google.com 17abda51e5 Include HTTP library in the standalone VM
HTTP support is part of library dart:io.

The current interface is defined in runtime/bin/http.dart

R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9488008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4692 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 15:11:34 +00:00
sgjesse@google.com ebfaee7d90 Update checked in binaries to r4683
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9487009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4688 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 14:25:18 +00:00
ager@google.com 4d94b5c4d9 Move back to having File.open{Input,Output}Stream return the stream directly.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9487005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4677 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 12:28:42 +00:00
ager@google.com f3fffe70ad Fix FileTest that could delete file before a stream on it was closed.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9488004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4668 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 09:33:22 +00:00
ager@google.com 06fda2b967 Wait for output file to close before deleting the file in pipe test.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9494003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4667 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 09:26:07 +00:00
ager@google.com 99df1354c8 Fix async test that uses temp directories.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9488003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4665 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 09:08:20 +00:00
ager@google.com 103804d7f2 Make FileInputStream and FileOutputStream actually asynchronous.
Use the async API of the underlying file.

This also means that openInputStream and openOutputStream can
directly return the stream without performing IO. I'll do that
change as a follow-up.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9474004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4662 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 08:38:25 +00:00
sigmund@google.com ee6a907611 isolates refactor: this change introduces 'dart:isolate' as a library. This is a
big global change, so let me explain in more detail. This refactoring CL does
the following:
- moves all the dart code for isolates in a common library (lib/isolate)

- changes frog to understand 'dart:isolate' imoprts by loading the code from the
  location above.

- changes the vm to undernstand 'dart:isolate' imports by creating a separate
  library that is part of the bootstrap. This follows the same code-structure
  that Todd suggested in his CL introducing the mirror library

- changes dartc to use the shared isolate library as the source of truth for
  type checking. I left around some of the internal js code in dartc so that the
  backend continues to work for apps that don't use isolates.

- changes all tests that use isolates to import the library explicitly (this is a large bulk of the files in this CL)

- changes test status for tests we can't fix in this repo (e.g. co19)

- splits the isolate library code to make it possible to preserve some tests
  without exposing internal types (e.g. tests about
  serialization/deserialization)

- changes the create_sdk script to copy the isolate library to the sdk

- includes the isolate library in dartdoc

I'll wait for at least one lgtm from each area (dartc, vm, frog, sdk)

There is one important pending thing this CL doesn't do:
- update test_runner.dart: This should be updated next time we upload the new
  binaries to tool/testing/bin
- dartium specific changes: Vijay, is there anything I need to do for dartium?

Review URL: https://chromiumcodereview.appspot.com//9422019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4647 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:50:44 +00:00
ager@google.com 898f41bd2a Fix file tests.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9465007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4571 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-24 13:41:45 +00:00
ager@google.com e286176171 Implement File.{readAsBytes, readAsText, readAsLines}.
Convenience methods to use if all you care about is getting the
entire contents of a file.

R=sgjesse@google.com
BUG=1579
TEST=standalone/FileTest

Review URL: https://chromiumcodereview.appspot.com//9452014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4568 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-24 13:31:38 +00:00
whesse@google.com 0e40002890 Add native extensions to the Dart shell, on the linux platform.
BUG=
TEST=standalone/TestExtensionTest

Review URL: https://chromiumcodereview.appspot.com//9430051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4529 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 13:25:11 +00:00
sgjesse@google.com e07a1f818e Fix bug in Directory after porting to using native ports
The full path was no longer provided to the directory handler

R=ager@google.com

TEST=tests/standalone/src/DirectoryTest.dart

BUG=

Review URL: https://chromiumcodereview.appspot.com//9452009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4521 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 11:13:35 +00:00
ager@google.com a1edbae18b Fix another problem with the new file test. Don't use the same file
name for two tests and make sure to notify correctly in async tests
that use temporary directories.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9431034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4477 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 17:51:43 +00:00
antonm@google.com 5d31dd7a49 Suppress another dart:io test.
Review URL: https://chromiumcodereview.appspot.com//9372109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4473 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 17:39:24 +00:00
ager@google.com 197cc1843e Fix file test that was too specific.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9429054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4465 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 16:29:51 +00:00
ager@google.com 7e4a36278f Implement File.directory() and File.directorySync() to get
containing directory for a file.

BUG=dart:1618
TEST=standalone/FileTest

Review URL: https://chromiumcodereview.appspot.com//9416096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4464 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 16:18:39 +00:00
sgjesse@google.com 46e44ecba1 Add both sync and async methods for getting streams for a File
The File class used to have two synchronous methods
openInputStream and openOutputStream for getting streams for a
file. These have now been changed to work asynchronously by the
associated callback inputStreamHandler or outputStreamHandler
when the stream is opened and available.

To support the synchronous API two new methods
openInputStreamSync and openOutputStreamSync which returns the
stream directly as before have been added.

The actual implemnetation of the file streams still uses the
synchronous file API internally. However this change
adds "simulated" handling of noPendingWriteHandler and
closeHandler for file output stream.

R=ager@google.com

BUG=dart:1784

TEST=

Review URL: https://chromiumcodereview.appspot.com//9432023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4452 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 14:11:04 +00:00
sgjesse@google.com 39ac458cdf Add more file tests
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9428003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4425 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 07:30:17 +00:00
ager@google.com e2c233c750 Disallow opening of directories as files.
R=sgjesse@google.com
BUG=1614
TEST=tests/standalone/src/FileTest.dart

Review URL: https://chromiumcodereview.appspot.com//9427014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4387 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-21 07:22:20 +00:00
cshapiro@google.com 04204bf8e3 Restore the OutOfMemory test now that WeakPersistentHandles work.
Review URL: https://chromiumcodereview.appspot.com//9418031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4374 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-18 01:48:18 +00:00
sigmund@google.com 3606f4c98e vmbot: fix vm bot config
Review URL: https://chromiumcodereview.appspot.com//9414014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4329 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-16 18:27:05 +00:00
antonm@google.com a3f6238760 Fix a typo.
Review URL: https://chromiumcodereview.appspot.com//9363044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4235 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 20:19:17 +00:00
antonm@google.com fd0fbc470b Suppress a test which depends on dart:io.
Review URL: https://chromiumcodereview.appspot.com//9361068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4234 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 20:10:13 +00:00
sgjesse@google.com b4d571dcdd Handle stdio redirection in standalone VM
The recent change to epoll on Linux and kqueue on Mac OS for getting
notifications from file descriptors caused the redirection of stdin,
stdout and stderr for the stand alone VM to stop working.

On Linux epoll failed when file descriptor 0, 1 or 2 redirected from
or to a file war registered. On Mac OS there was just no events
generated from kqueue.

The streams created for stdio, stdout and stderr is now of the correct
type and for file redirections no longer a socket object holding a
file descriptor for a regular file.

Added testing of stdio redirection using both pipes and files. These
tests are currently skipped on Windows.

Fixed handlin of short socket read when reading the process exit code.

Always close the socket port when not waiting for any events.

R=iposva@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9360040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4226 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-14 15:20:27 +00:00
sgjesse@google.com 31a2f9079f Ensure FileTest.dart deletes temporary directories
The FileTest.dart did not delete the created temporary directories. This
was caused by the sub-test testOutputStreamWriteAppend not working.

The close handler for a file FileOutputStream is newer called.

R=ricow@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9389002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4182 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-13 12:06:09 +00:00