Commit Graph

273 Commits

Author SHA1 Message Date
efortuna@google.com 70f02af5ce Set flaky test to skip because it actually times out instead of pass/fail.
Review URL: https://chromiumcodereview.appspot.com//10121008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6749 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 16:28:02 +00:00
whesse@google.com 9dbb88f2bb Fix flaky standalone/io/TestRunnerTest, a unit test of the testing framework.
BUG=dart:1947
TEST=standalone/io/TestRunnerTest

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6734 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 10:39:36 +00:00
sgjesse@google.com 41cc58affa Fix a number of editor errors and warnings in io tests
R=ager@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6731 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 09:17:14 +00:00
efortuna@google.com 12570483ec Skip flaky HttpServerEarlyClientCloseTest on Windows until source of flakiness
has been fixed.
Review URL: https://chromiumcodereview.appspot.com//10113002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6720 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 01:15:50 +00:00
sgjesse@google.com 83ce0024ef Skip flaky test on Mac OS until resolved
TBR=ngeoffray@google.com

BUG=dart:2637
TEST=tests/standalone/src/io/HttpServerHandlerTest.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6692 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 15:03:57 +00:00
sgjesse@google.com a18d4a2f87 Add HTTP handler registration to the HTTP server
NOTE: This is a breaking change.

The onRequest callback on the HTTP server have been removed in favor
of the ability to register handlers. A handler can be either a
function or an instance of a class which implements a specific
interface. Each handler registration has a regular expression which is
matched against the request path.

There is also a default handler which can be set to handle all
requests which is not matched by any of the registered patterns. If
there is no default handler explicitly set there is a builtin one
which will just return 404 status.

Currently the method is not considered in the matching.

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

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6683 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 13:03:43 +00:00
ager@google.com 37b82247ac Remove need to instantiate Platform and make methods static.
This will require an update of the stable test binary. I will upload
a new build when done with the review process.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6682 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 11:39:16 +00:00
sgjesse@google.com 9e82bc4246 Add test of the HTTP headers object
Fixed a number of bugs revealed by actually testing.

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6669 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 06:44:58 +00:00
ager@google.com 758943e32a Add read-only environment variable access.
Map<String, String> env = new Platform().environment();

Unfortunately, this is a bit hard to test at this point. I
will move on to implement support for providing an environment
to processes that are started. At that point we can test it
properly.

Another follow-up change will be to remove the instantiation
for Platform. I would like this to be just

Map<String, String> env = Platform.environment();

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6646 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-17 16:20:28 +00:00
rnystrom@google.com 6d53afbeb5 Enable "package:" test on dart2js.
Review URL: https://chromiumcodereview.appspot.com//10069034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6595 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 17:47:42 +00:00
sgjesse@google.com c9a325f704 Start refactoring of the HTTP header handling
This change moves the headers into a separate object.

There will be follow-up changes for handling whether the headers are
read-only or mutable. Also additional tests will be added later.

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6567 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 12:18:45 +00:00
ager@google.com f366f9d913 Make it an error to call close twice on a file using the async API.
This is to make it consistent with the sync API.

Additionally, fix situations where a non-exception was passed to
error handlers on File objects.

R=sgjesse@google.com
BUG=dartbug.com/2451
TEST=standalone/io/File*

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6564 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-16 11:32:03 +00:00
sgjesse@google.com e7f5afdbb8 Add HTTP/1.0 support and simplify persistent connections handling
The HTTP parser now recognized both HTTP/1.1 and HTTP/1.0 in
request and response headers. The only difference between the
handling of HTTP 1.1 and HTTP 1.0 is in the decection of
persistent connections. For HTTP 1.1 persistent connections are
the default and for HTTP 1.0 persistent connections are speficified
throught the "Connection: Keep-Alive" header.

Removed the getters and setters for keepAlive from all the
interfaces. They are not of much use and persistent connection
handling should be transparent. The HTTP client currently always
sends requests using HTTP 1.1 and in the reare cases where one wants the
connection to be closed after the request adding the
header "Connection: close" should work.

With this change using wget to get resources from the chat server.

R=ajohnsen@google.com

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6509 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 10:58:58 +00:00
ajohnsen@google.com 06874b262c Update test to hopefully help detect flanky results on Windows.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6508 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 10:55:59 +00:00
ager@google.com 16f5b14b7d Update dart2js mock of process implementation.
R=floitsch@google.com
BUG=dartbug.com/2557
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6506 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 09:43:22 +00:00
ager@google.com 4e1f754730 Fix Process test, fix Process factory, diable tests on dart2js.
Florian and I will investigate the dart2js failures.

R=sgjesse@google.com,floitsch@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6502 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 09:21:54 +00:00
ager@google.com 52c2259fd7 Rename Process test so it has the suffix 'Test' required for it to be
run by the scripts.

R=sgjesse@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6500 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 08:59:42 +00:00
ager@google.com 84b0410d5a This is a request for comments.
First attempt at implementing a higher-level API for processes.
Add a startNonInteractive constructor that takes a callback which
is called with the exit code and the complete stdout and stderr
when the process terminates.

Let me know what you think. This obviously needs at least tests.
Not entirely sure what I think about the interface in the first
place.

R=sgjesse@google.com
BUG=1689
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6499 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 08:53:35 +00:00
sgjesse@google.com 49859f8d08 Add basic handling to connection upgrade to the HTTP parser
See description in runtime/bin/http_parser.dart on how the upgrade works.

R=ajohnsen@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6464 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-12 14:31:47 +00:00
ager@google.com aba2e48950 Support length operation without opening file.
Use fstat instead of multiple seek calls to get length of
opened files.

R=sgjesse@google.com
BUG=dartbug.com/1592
TEST=standalone/io/File*Test

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6459 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-12 11:47:32 +00:00
rnystrom@google.com c47bd07592 Fix merge bug.
Review URL: https://chromiumcodereview.appspot.com//10020049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6435 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 20:27:57 +00:00
antonm@google.com e7e55a6535 Skip tests for packages.
TBR=rnystrom@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6434 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-11 20:22:40 +00:00
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