Commit Graph

2501 Commits

Author SHA1 Message Date
rnystrom@google.com eea5e1a621 Fix "package:" stuff on Windows and skip tests on dart2js since it doesn't support it yet.
Review URL: https://chromiumcodereview.appspot.com//10052021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6431 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 20:14:08 +00:00
rnystrom@google.com 93e45629c9 Add support for importing using "package:" to the standalone VM.
Review URL: https://chromiumcodereview.appspot.com//10034001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6428 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 19:40:51 +00:00
ajohnsen@google.com d480a1eeef Add member localHostname() to the Dart IO Platform class.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6409 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 12:27:55 +00:00
ager@google.com c6a91ef4b6 Remove check whether async has been used from File objects.
It makes it hard to use libraries and doesn't really help.

R=sgjesse@google.com
BUG=dartbug.com/2426
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6400 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 09:27:53 +00:00
sgjesse@google.com 52eb1e2139 Fix bug in HTTP header parsing
R=ajohnsen@google.com

BUG=dart:2370
TEST=tests/standalone/src/io/HttpParserTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6397 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 07:09:45 +00:00
sigmund@google.com cca364ce76 change status files to make it possible to run test.py -c frog,dart2js -r none.
Except for standalone, this mostly skips all other tests. The configurations
frog_none and dart2js_none these have been ignored for now by the bots, enabling
those tests should be done as needed.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6382 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-10 20:56:37 +00:00
sgjesse@google.com e727d8c8b3 Refactor the close and error handling of HTTP connections
* Unify the handling of connection close and connection error.
* The HttpConnection and HttpClientConnection now have separate
  close/error handling
* The HTTP parser gets the connection close indication as it might
  signal end of body for responses with no other length indication

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6355 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-10 12:54:54 +00:00
ajohnsen@google.com 4ecf48b601 Add remoteHost to Socket.
This is merging the native calls into one, GetRemotePeer, thus
eliminating a potentiel extra call to getpeername.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6353 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-10 12:18:12 +00:00
whesse@google.com f11eeb90ba Remove temporary directories created by standalone/FileErrorTest.
BUG=dart:2396
TEST=standalone/FileErrorTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6171 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-04 16:11:45 +00:00
ajohnsen@google.com 1dd508bd44 Add remotePort getter to Socket.
Review URL: https://chromiumcodereview.appspot.com//9963053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6090 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 13:54:03 +00:00
ajohnsen@google.com a61f8d4875 Rename Http test to be more specific.
We can consider mergeing the two Early-Close tests in the future. They don't share any logic, but they test the same class.
Review URL: https://chromiumcodereview.appspot.com//9958063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6088 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 13:14:24 +00:00
ajohnsen@google.com 9d9ba11e69 Add test for testing Socket close/error while sending response to HttpClient from HttpServer.
Review URL: https://chromiumcodereview.appspot.com//9963048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6087 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 10:40:40 +00:00
ajohnsen@google.com 083635e5ca Make sure to don't close the HTTP Server until all the headers have been flushed.
Review URL: https://chromiumcodereview.appspot.com//9958060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6084 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 09:12:03 +00:00
ajohnsen@google.com 96fd717d47 Expose a bug in the Http Header Parser.
Review URL: https://chromiumcodereview.appspot.com//9956058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6083 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 08:25:51 +00:00
ajohnsen@google.com 809fca8714 Add a new attachTo method to HttpServer, for using an existing ServerSocket.
Review URL: https://chromiumcodereview.appspot.com//9965053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6082 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-02 08:24:37 +00:00
ajohnsen@google.com 8c159686a2 Add HttpServerEarlyClientCloseTest to standalone-leg.status.
Review URL: https://chromiumcodereview.appspot.com//9959008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6030 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 10:55:59 +00:00
ajohnsen@google.com 5bec2cceec Updated the early close test, to use a Socket that we can close at any time.
Review URL: https://chromiumcodereview.appspot.com//9965008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6029 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-30 10:14:30 +00:00
srdjan@google.com 009a3fc28c Disable crashing OutOfMemoryTest (issue filed).
Review URL: https://chromiumcodereview.appspot.com//9903024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5988 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 17:34:13 +00:00
ager@google.com 65e9e8436c Fix typo that has crept into string input stream.
Add regression test.

R=sgjesse@google.com
BUG=dartbug.com/2322
TEST=standalone/io/StringStreamTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5904 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 20:28:19 +00:00
efortuna@google.com c8e35dbeb1 Rename test.dart component to specify compiler + runtime.
Review URL: https://chromiumcodereview.appspot.com//9838068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5893 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 18:40:41 +00:00
ajohnsen@google.com e896c90f3b Don't propagate http client error, when no response object is available.
Review URL: https://chromiumcodereview.appspot.com//9863031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5869 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 10:56:43 +00:00
sgjesse@google.com 471f1c772c Add error handling to directory
The directory object now has error handling like the rest of the
dart:io. The added tests to some extend overlaps with some of the
tests in DirectpryTest.dart, but I found it better to have error tests
in a single place.

I removed a few type checks sitting in the C++ code for the native
functions as for file we currently don't have them. I have opened
issue 2305 regarding where to do type checks for dart:io native
functions.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5866 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-27 08:50:35 +00:00
ager@google.com b2d9765a5a Print the actual error message on failure in the ProcessStartException test.
R=iposva@google.com,sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5842 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 16:54:08 +00:00
sgjesse@google.com 34687263ba Fix broken directory test using undefined class
R=ahe@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5817 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 07:24:21 +00:00
sgjesse@google.com ab607fede6 Make test standalone/src/io/ManyEchoServerTest compile
R=ahe@google.com

BUG=dart:2266
TEST=tests/standalone/src/io/ManyEchoServerTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5815 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 06:46:09 +00:00
sgjesse@google.com 017c67946f Fix file error tests on Windows
* Always close files before deleting the temporary test directory
* Truncate on read only fils only fails if the file is not empty

TBR=ager@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5814 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 06:34:06 +00:00
sgjesse@google.com cdc29b23f0 Add error handling to random access file
Now all both sync and async methods on File and RandomAccessFile
should have correct error handling.

Changed readByte and readByteSync to return -1 instead of
reporting an error when end of file is reached. It seems to make
the most sense.

The amount of boiler-plate code in both the native functions and
native port functions in file.cc is growing. Maybe we should
consider some refactoring, e.g. with a table of the expected
argument types for each native port functions together with known
position of the FILE* argument.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5812 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 05:54:49 +00:00
ager@google.com 0b76ed8bac Add test case that ensures that the VM can compile all of the code
in the dart:io library.

Matthias has a changelist out that will make compile_all complaint
instead of silently ignoring compilation errors. Once that lands
(Monday MTV time) this test will become useful.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5809 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-26 02:33:59 +00:00
ahe@google.com 3a3162da27 "Implement" #resource tag and various restrictions on library definitions.
Review URL: https://chromiumcodereview.appspot.com//9838038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5804 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-24 08:51:37 +00:00
sgjesse@google.com 167bce6fba Add error handling to the HTTP library
The socket errors and HTTP parser errors are now handled by the
HTTP library and propagated to the related onError callback.

For HttpClient there is no onError on the HttpClient object
itself. Errors on active connections (including connection
errors) are reported on the HttpClientConnection. Errors on
connections sitting in the keep alive pool are handled by just
closing the connection and removing it from the pool. Errors on
the HttpClientConnection are also reported through the onError
callbacks on any active streams.

I am not particulair happy of the way errors are propagated to
the active streams but that can be refactored later.

Added more checks and tests to the HTTP parser.

R=ager@google.com, ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5768 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-23 08:00:27 +00:00
ahe@google.com 87a64a1be8 Add "mock" compilation feature to dart2js and use it to improve test coverage.
Review URL: https://chromiumcodereview.appspot.com//9813012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5743 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-22 10:34:03 +00:00
ager@google.com 2aba281fa6 Remove backwards compatibility 'win32' name from test status files.
Using win32 instead of windows was temporary to be compatible with
the old python script. That is now gone.

R=antonm@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5736 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 22:06:52 +00:00
sgjesse@google.com 015d6fa4da Change the message body handling in the HTTP parser
The message content detection and handling should now be more
correct and according to the specification (RFC 2616 section 4.3).

* Requests with no Content-Length and no Transfer-Encoding have no message body
* Responses with status code 1xx, 204 and 304 have no message body
* Responses which are responses to HEAD requests have no message body

Also added support for detecting chunk-extensions and ignoring these.

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5722 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 15:41:39 +00:00
sgjesse@google.com 7fa9f1fe88 Add error handling to socket streams
Change the streams onError callbacks to get an Exception argument on
all streams.

Added actual error handling to the socket streams.

As it is difficult to determine where an error should be reported I
decided to call all the registered onError callbacks, that is on the
socket itself and on both input and output stream.

Did some additional cleanup of the naming of OnError argument in some tests.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5717 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 14:40:15 +00:00
sgjesse@google.com 0b3f4a1190 Extend dart:io error handling to all socket functions
There are currently no tests of the error handling, as it is hard to
create consistent tests. I have done some manual tests locally:

* Lowering the number of file descriptors available (ulimit -n) and hitting that limit
* Running two dart programs communicating and terminating one (using Ctrl-C)
* Running two dart programs communicating on two machines and pulling out the network cable.

If there is an error we always call the onError callback and never the onClosed callback.

On Windows there is the issue that both closing the connection correctly and terminating one end gives the same error (ERROR_NETNAME_DELETED) so both are reported as connection close. Pulling out the network cable gives a different (real) error on Windows though.

On Mac OS it turned out the for kqueue EV_EOF is also used to indicate errors with the error code set in the fflags field. EV_ERROR is only reported if there is an internal error in  kevent processing (see http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/kqueue.2.html).

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5709 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-21 09:39:47 +00:00
sgjesse@google.com 9e5ea88b84 Disable tests which seems to fail on buildbot
TBR=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5642 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 12:14:11 +00:00
sgjesse@google.com 5e4ae23e44 Support parsing HTTP responses where the body length is not known
The HTTP parser ends the body when the connection is closed.

This only implements this in the HTTP parser - it is not yet used in
the dart:io HTTP library.

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5641 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 11:36:32 +00:00
sgjesse@google.com 168ae8c785 Start better error reporting for sockets
Changed the onError callback for sockets to take an exception argument.

First area to report errors for is name resolution.

Changed the IP address resolution from being synchronous with the
creation of the socket to being asynchronous thsough a lookup
service running on a native port. Currently this lookup service
is static on the socket class as we need to call it from a
factory method. We should probably add a separate name lookup
service at some point.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5640 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 11:26:41 +00:00
ahe@google.com dd96f32250 Rename leg -> dart2js.
Review URL: https://chromiumcodereview.appspot.com//9717033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5636 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-19 08:36:39 +00:00
floitsch@google.com a4b6cb96d1 Handle compile-time constants to interfaces.
Review URL: https://chromiumcodereview.appspot.com//9717035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5629 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-18 21:50:43 +00:00
ager@google.com 357588d0c9 Change quoting in Process implementation on Windows.
Only quote command and arguments if they contain a space or a tab.
This seems consistent with the way it is handled in other systems.

R=antonm@google.com,sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5522 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-15 15:33:06 +00:00
ajohnsen@google.com 94490e2e2a Close connections on server.close(), and call onError on early connection close.
Review URL: https://chromiumcodereview.appspot.com//9700012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5452 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 11:24:50 +00:00
sgjesse@google.com 076c4c048b Update leg status for standalone tests
R=ahe@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5409 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 14:54:50 +00:00
sgjesse@google.com 84836f8c56 Error reporting on File in dart:io
This implements consistent error reporting on all methods on File in dart:io. The async onError method is called with an exception argument which is the same exception as would have been thrown from the corresponding sync method.

The one method on Directory which already did this has been updated as well.

R=ager@google.com

BUG=none
TEST=tests/standalone/src/io/FileTest.dart, tests/standalone/src/io/FileInvalidArgumentsTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5396 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 13:00:47 +00:00
ahe@google.com a551056569 Run standalone tests on Leg.
Review URL: https://chromiumcodereview.appspot.com//9663052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5383 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 07:30:56 +00:00
sigmund@google.com 2b5952ac6c SendPort + ReceivePort changes:
- document what are valid messages in SendPort.send
- change SendPort.call to return a future of the reply
- remove ReceivePort.singleShot

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5368 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-12 22:52:36 +00:00
whesse@google.com 3c6d3843fc Add native extensions for the Dart shell to the Windows platform and the Mac OS X platform.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5235 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 14:34:57 +00:00
sgjesse@google.com 4491ea144d Add writeString method to OutputStream
All output streams now supports writeString which takes the encoding
to be used when transforming the string into a sequence of bytes.

This change also introduces an Encoding interface and Encodings class
as a repository for the supported encodings. Currently this is only
UTF-8, ISO-8859-1 and ASCII. All methods in dart:io which previously
used a String to represent the encoding now uses objects implementing
Encoding.

In this change dart:io is still using the internal UTF-8 encoder used
by the HTTP implementation. I will look into using the one in dart:utf
in a separate change.

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5231 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-09 13:49:20 +00:00
sgjesse@google.com 300f3fe802 Add support for using an URL for establishing HTTP connections
As the URI library is now part of the standalone VM it makes sense to
have the option of using a URL for opening a HTTP connection

R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5153 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 08:44:59 +00:00
mattsh@google.com d8af601ce4 removed unused 'prefix' line from status files
Review URL: https://chromiumcodereview.appspot.com//9621003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5101 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-07 16:10:57 +00:00