Commit Graph

36 Commits

Author SHA1 Message Date
Jonas Termansen 3433d8cfc3 [nnbd] Migrate standalone/io to NNBD.
The tests are also now dartfmt.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I8dece8097b37b70d47a5374dae2f3fadb0fc4b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134338
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-07 14:41:36 +00:00
Siva Annamalai bc4860b0cb Most VM specific tests in standalone have been moved to standalone_2 and are being run in the regular bot tests. These tests are for VM functionality like io, process API etc. and have no strong mode implications. Currently we are running these tests twice once from standalone and once from standalone_2.
This CL removes these redundant tests from the standalone directory.

Bug:
Change-Id: Ib0adfa67fffa4de486e847698e18353fb4dd8a46
Reviewed-on: https://dart-review.googlesource.com/18429
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-07 23:00:00 +00:00
William Hesse 7bf2788bcc Restore all deleted tests to tests/standalone from migration to standalone_2
We are no longer deleting tests from the Dart 1 test directories when we
add them to the _2 directories. This reverts the part of change
https://dart-review.googlesource.com/c/sdk/+/12240 that modifies
the tests/standlone directory.
Bug:
Change-Id: Ie26b185234d0d18736a2fa13b77c5fd42cbb7e92
Reviewed-on: https://dart-review.googlesource.com/12287
Reviewed-by: Morten Krogh-jespersen <mkroghj@google.com>
2017-10-09 10:46:55 +00:00
Siva Annamalai bd2a8e1d60 Reland migrate most of the tests in standalone to be strong mode clean and move them to standalone_2 directory.
Bug:
Change-Id: I4ca50f315361422db1d4356055862463bfe1d6f3
Reviewed-on: https://dart-review.googlesource.com/12240
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-10-07 01:29:36 +00:00
Siva Annamalai ff32187145 Revert "Migrate most of the tests in standalone to be strong mode clean and move"
This reverts commit c85563f582.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Migrate most of the tests in standalone to be strong mode clean and move
> them to standalone_2 directory.
> 
> Change-Id: I9887b8d6d4d86001e4660b400224b881205e6273
> Reviewed-on: https://dart-review.googlesource.com/6080
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,asiva@google.com

Change-Id: I3c7b6081f17fca45e7828603538f50d06417e2be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/12020
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-10-06 17:24:20 +00:00
Siva Annamalai c85563f582 Migrate most of the tests in standalone to be strong mode clean and move
them to standalone_2 directory.

Change-Id: I9887b8d6d4d86001e4660b400224b881205e6273
Reviewed-on: https://dart-review.googlesource.com/6080
Reviewed-by: Ben Konyi <bkonyi@google.com>
2017-10-06 17:07:34 +00:00
Jacob Richman 2dcd56ef43 Format all tests.
There are far too many files here to review everyone carefully.
Spot checking most of the diffs look good as test code is generally written
with less care than application code so lots of ugly formatting get through.
If people notice files where the automated formatting bothers them feel free
to comment indicating file names and I'll move spaces within comments to make
the formatting cleaner and use comments to force block formatting as I have
done for other case where formatting looked bad.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2771453003 .
2017-04-17 14:53:02 -07:00
Lasse Reichstein Holst Nielsen c41ae15713 Specify FutureOr.
R=eernst@google.com, floitsch@google.com

Review-Url: https://codereview.chromium.org/2664263002 .
2017-02-03 08:02:09 +01:00
keertip 1d6bd5255d Revert "Make HTTP headers use a growing buffer, not a fixed-size 8K one."
This reverts commit 5119795422.

BUG=
R=dgrove@google.com

Review-Url: https://codereview.chromium.org/2650583005 .
2017-01-23 14:57:27 -08:00
Lasse R.H. Nielsen 5119795422 Make HTTP headers use a growing buffer, not a fixed-size 8K one.
Issue #28251

BUG= http://dartbug.com/28251
R=sgjesse@google.com

Review-Url: https://codereview.chromium.org/2618523005 .
2017-01-13 10:12:19 +01:00
Ryan Macnak 1627c70035 Fix http_server_response_test.dart not to use snapshots as its data.
Fixes #27633

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2441073002 .
2016-10-21 13:56:52 -07:00
sgjesse@google.com ac911ff0bf Make the default HTTP server configuration more secure
Add a mechanism for setting default headers to add to all responses.

By default each the HTTP response now will contain the following headers:

  Content-Type: text/plain; charset=utf-8
  X-Frame-Options: SAMEORIGIN
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block

New cookies created are now 'httpOnly' by default.

BUG=http://dartbug.com/19676
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//443373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39118 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 07:12:03 +00:00
ajohnsen@google.com f7de93ae28 Fix HttpResponse::writeCharCode.
We now always ensure the encoding when writing to the IOSink.

BUG=https://code.google.com/p/dart/issues/detail?id=15905
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//120163006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31531 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-07 07:42:28 +00:00
ajohnsen@google.com 491442573f Use a re-usable buffer for writing HTTP headers. This includes a new header limit of 8192 bytes.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//65043019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30335 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-18 10:27:50 +00:00
sgjesse@google.com c38de04d0c Change dart:io Platform.script to return a Uri.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//46063010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29651 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 07:29:01 +00:00
whesse@google.com 4f08151090 Revert "Change dart:io Platform.script to return a Uri."
This reverts r29619 and r29624.  The changes look fine on the buildbot,
but need review before adding to the repository.

BUG=

TBR=sgjesse@google.com

Review URL: https://codereview.chromium.org//52723007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29627 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 02:17:37 +00:00
whesse@google.com cb0110350a Change dart:io Platform.script to return a URI. Change all uses of Platform.script to work with the new value.
R=floitsch@google.com

Review URL: https://codereview.chromium.org//53313007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29619 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 01:08:11 +00:00
sgjesse@google.com 887c8e7596 Move getters from Options to Platform
The getters for executable, script and version are now statics on
Platform. I kept them on Options for now, but updated most tests to
use Platform.

R=ajohnsen@google.com, floitsch@google.com, iposva@google.com
BUG=

Review URL: https://codereview.chromium.org//17406010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24401 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 12:56:23 +00:00
ajohnsen@google.com 5ce3b9ddea Clean up dart:io exceptions.
- Introduce IOException.
- Remove HttpParserException.
- Merge RedirectLimitExceededException and RedirectLoopException into
RedirectException.
- Remove 'IO' from FileIOException, DirectoryIOException, LinkIOException
and SocketIOException.

BUG=https://code.google.com/p/dart/issues/detail?id=9955
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//16123036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23848 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 13:15:46 +00:00
lrn@google.com faa7227cec Make new StreamController be async by default.
Change all instances, except some tests, to be sync still.
Rename Multiplex to Broadcast everywhere.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//16125005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23453 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 06:07:39 +00:00
ajohnsen@google.com 310e5b54b4 Support auto-drain of HttpRequest data.
When headers of the HttpResponse are about to be sent, and the HttpRequest have not had any subscriber yet, drain the request body and then write the headers.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15842004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23228 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 15:43:34 +00:00
ajohnsen@google.com 3e7327dae2 Don't report unuseful SocketIOExceptions on HttpServer.
1) Don't report error if HttpResponse was closed while we were sending
data. Instead, just drain/close the data sources. This matches how
people expect the HttpResponse to act. This will _not_ happen for
HttpClientRequest.

2) Don't report incomplete headers on HttpServer.listen. The information
are not useful, as the user don't even have a chance to act on the bad
headers/socket. We not just silently close the socket.

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//15814004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23069 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 13:55:11 +00:00
sgjesse@google.com 2fdb878ebe Change the signature for all network bind calls.
All the bind calls on RawServerSocket, ServerSocket,
RawSecureServerSocket, SecureServerSocket and HttpServer (and
bindSecure on HttpServer) now have mandatory address and port
parameters. All the rest of the parameters are named optional
(including backlog).

The address parameter can be an InternetAddress or a String for all
these calls.

R=ajohnsen@google.com, whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//14640008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22227 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 09:14:04 +00:00
ager@google.com 431954b584 Rename dart:typeddata to dart:typed_data.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

Review URL: https://codereview.chromium.org//14426006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
floitsch@google.com 5431a5af54 Remove AsyncError with Expando.
Review URL: https://codereview.chromium.org//14251006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21498 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:58:32 +00:00
ajohnsen@google.com 88a44982d0 Add tests for IOSink.done call effect on HttpClientRequest/HttpResponse (should be none).
BUG=https://code.google.com/p/dart/issues/detail?id=9141

Review URL: https://codereview.chromium.org//14113008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21433 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 11:25:24 +00:00
ajohnsen@google.com 67650cb16e Remove .writeStream, .consume and rewrite IOSink to correctly implement a (sane) well-defined behaviour of the .done future.
BUG=

Review URL: https://codereview.chromium.org//14028017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21416 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 07:35:45 +00:00
ajohnsen@google.com dcaf52732e Remove StreamSink(replaced by EventSink) and make IOSink extend EventSink.
With this change 'writeBytes' was renamed to 'add'.

BUG=

Review URL: https://codereview.chromium.org//14150002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21275 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 12:54:19 +00:00
floitsch@google.com 8fd6d0aafd Remove Expect from core library.
Committed: https://code.google.com/p/dart/source/detail?r=19755
Reverted: http://code.google.com/p/dart/source/detail?r=19756

Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20996 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 19:43:16 +00:00
asiva@google.com b368804b23 - Use dart:typeddata in the tests instead of dart:scalarlist
- delete byte_array_test.dart as a dart:typeddata version of this test
  is present in typed_data_test.dart
Review URL: https://codereview.chromium.org//12507012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20600 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-28 00:35:37 +00:00
ajohnsen@google.com 959193b500 Buffer the entire http header to one packet, and buffer other data in chunks of 4-16 kb.
BUG=https://code.google.com/p/dart/issues/detail?id=8871

Review URL: https://codereview.chromium.org//12655003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19857 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 12:13:36 +00:00
floitsch@google.com 5dc8107c53 Revert "Remove Expect from core library."
This reverts commit 19755.

Review URL: https://codereview.chromium.org//12743005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19756 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 03:19:07 +00:00
floitsch@google.com 12dbd2fd70 Remove Expect from core library.
Review URL: https://codereview.chromium.org//12212016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19755 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-09 02:40:37 +00:00
sgjesse@google.com b6096848b1 Make IOSink implement StringSink
Besides adding the StringSink methods I also added writeBytes and
deprecated both add and addString.

To handle the encoding of strings the IOSike has an encoding
property. This property is mutable in situation when it makes sense to
change encoding of what is written. The exception here is for HTTP
where the encoding is determined from the header and the encoding
cannot be changed.

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

BUG=

Review URL: https://codereview.chromium.org//12504006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19676 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 10:06:28 +00:00
ajohnsen@google.com 4ce60f302e Implement addStream for HttpClientRequest/HttpResponse and propegate all write-errors from the socket.
BUG=https://code.google.com/p/dart/issues/detail?id=8821

Review URL: https://codereview.chromium.org//12317147

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19213 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 11:55:03 +00:00
sgjesse@google.com a7f2f94695 Add missing files from previous commit
TBR=ager@google.com

BUG=

Review URL: https://codereview.chromium.org//12328037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18821 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 12:08:34 +00:00