Commit Graph

283 Commits

Author SHA1 Message Date
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Ben Konyi d08e59e09c Migrated test block 171 to Dart 2.0.
R=rnystrom@google.com

Moved schedule_microtask[2,3,5]_test off of package:test to
package:async_helper and package:expect.
Review-Url: https://codereview.chromium.org/3001793002 .
2017-08-30 06:46:35 -07:00
Ben Konyi 0ea752b5bf Relanding test block 170 migration.
"Migrated test block 170 to Dart 2.0.""

This reverts commit 201df65b50201f023a1db5bb26bea7b8976c3b32.

Review-Url: https://codereview.chromium.org/3005813002 .
2017-08-29 16:22:07 -07:00
Ben Konyi e8b337f08f Revert "Migrated test block 170 to Dart 2.0."
This reverts commit 6e6b0cadea9adbb48556384fac52b17c2ac15443.
2017-08-29 15:37:15 -07:00
Ben Konyi a7b19c1b47 Migrated test block 170 to Dart 2.0.
Updated status file to account for strange failure in package:test when
running multiple_timer_test on dartdevc.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2995013002 .
2017-08-29 15:25:42 -07:00
Ben Konyi 0db8403cca Replaced helper files that were accidentally removed during migration.
TBR=rnystrom@google.com

Migrated test block 168 to Dart 2.0.

Migrated some tests off of package:test to packages async_helper and
expect.

BUG=

Review-Url: https://codereview.chromium.org/2999323002 .
2017-08-21 01:11:29 -07:00
Ben Konyi 42d354c91d Migrated test block 168 to Dart 2.0.
This block felt trickier than others, mostly due to random errors that I
wasn't able to find a cause for. Tests that I'm uncertain about are:
-first_regression_test
-future_timeout_test
-future_or_bad_type_test/implements

These all have status entries to prevent failures, but I think these
tests need another set of eyes.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2999943002 .
2017-08-21 00:59:34 -07:00
Ben Konyi 55612ef10c Migrated test block 167 to Dart 2.0.
No manual work required for this block.

BUG=
R=jcollins@google.com

Review-Url: https://codereview.chromium.org/2993213003 .
2017-08-17 12:42:36 -07:00
Florian Loitsch 978213d427 Revert "Make Zone API strong mode clean."
This reverts commit 0b35711d48.

BUG=

Review-Url: https://codereview.chromium.org/2963743002 .
2017-06-28 13:31:32 +02:00
Florian Loitsch 0b35711d48 Make Zone API strong mode clean.
Review-Url: https://codereview.chromium.org/2959163002 .
2017-06-28 13:16:39 +02:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Florian Loitsch 33f360cc38 Revert "Add groupBy to Stream."
This reverts commit 3e8bfb1adb and 3f90b06836.

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2921663002 .
2017-06-01 16:11:39 +02:00
Lasse Reichstein Holst Nielsen 25a770fc97 Fix Stream.distinct.
Due to incorrectly shared state, a broadcast distinct stream listened to
more than once would give incorrect results.
Also update docs.

Fixes #29638, #29627.
BUG= http://dartbug.com/29638, http://dartbug.com/29627
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2885993005 .
2017-05-18 16:53:23 +02:00
Lasse R.H. Nielsen 3f90b06836 Rename StreamGroup to GroupedEvents.
Avoids clash with StreamGroup from package:async.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2872263003 .
2017-05-11 10:53:21 +02:00
Lasse R.H. Nielsen 3e8bfb1adb Add groupBy to Stream.
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2850393003 .
2017-05-08 10:25:17 +02:00
Lasse R.H. Nielsen 8c742bd500 Change Future.doWhile to use a loop for non-future results instead of recursion.
Avoids stack overflow on long sequences of non-future results.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2853203002 .
2017-05-02 12:56:55 +02:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Lasse Reichstein Holst Nielsen 6156495d77 Fix bug in Future.forEach. Add tests.
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2851443002 .
2017-04-27 16:11:40 +02: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 R.H. Nielsen 91e4917735 Fix test that assumed an async function returned a Future<not-dynamic>.
Review-Url: https://codereview.chromium.org/2788103002 .
2017-03-31 13:04:42 +02:00
Lasse R.H. Nielsen d509ddb3fa Use FutureOr more and make Future.sync return the resulting Future directly.
When the computation passed to Future.sync returns a Future of the correct type,
then it's returned directly instead of wrapping it again.
(Until strong mode, we have an extra case for when it returns a Future of an
incorrect type, but that will eventually be removed).

This should improve the performance of Future.sync a bit.

Also adds missing Zone intercept for when the Future.sync computation throws.

Updates documentation for Future.doWhile.

Fixes #29202
BUG= http://dartbug.com/29202
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2790663003 .
2017-03-31 12:41:07 +02:00
Jacob Richman 14531fa62d Re-land "Format all multitests"
Only delta from the original is a bad merge of tests/corelib/list_test.dart

This reverts commit 44d8be0ed3.

BUG=

Review-Url: https://codereview.chromium.org/2774783002 .
2017-03-23 12:40:21 -07:00
Jacob Richman 44d8be0ed3 Revert "Format all multitests"
This reverts commit 312b66dd5f.

BUG=

Review-Url: https://codereview.chromium.org/2770063002 .
2017-03-23 10:49:40 -07:00
Jacob Richman 312b66dd5f Format all multitests
BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2768073002 .
2017-03-23 10:26:44 -07:00
Jacob Richman 88eb557b65 Fix warnings_checker.dart handling of multitests
Update all tests

Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com
BUG=

Review-Url: https://codereview.chromium.org/2765693002 .
Review-Url: https://codereview.chromium.org/2765893003 .
2017-03-21 17:29:56 -07:00
Jacob Richman bf2b545150 Revert "Update all tests"
This reverts commit ce76e9c30beaf9a193d3677b88c20a1ebb3fae8c.
2017-03-21 16:33:18 -07:00
Jacob Richman 3c7353d987 Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2765693002 .
2017-03-21 12:39:28 -07:00
Jacob Richman 6a7d6c385e Add comments
Add spaces to make sure dartfmt doesn't destroy bespoke indentation

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2763823002 .
2017-03-20 21:03:12 -07:00
Jennifer Messerly 0e00b3e5c8 fix #28008, fix #28009 implement FutureOr<T>
This implements FutureOr<T> in strong mode, otherwise it's ignored (treated as `dynamic`.

Also fixes strong mode's inference subtype function incorrectly treating `void` as a malformed type. This had the consequence of allowing `void` to be inferred as a type argument.

R=leafp@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2647833002 .
2017-01-25 15:32:57 -08:00
Zachary Anderson 63c4b6b1cb Revert "Remove package:unittest from some tests"
This reverts commit dde47b2aad.

Revert "Update Dartium status for passing test"

This reverts commit d71c70d56d.

Tests failing on dart2js and async_star_pause_test is
passing on Dartium. Need to think about how to update the
status files.

Review-Url: https://codereview.chromium.org/2656503004 .
2017-01-25 11:06:58 -08:00
Zachary Anderson dde47b2aad Remove package:unittest from some tests
package:unittest is deprecated in favor of package:test.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2656743002 .
2017-01-25 08:50:02 -08:00
Florian Loitsch 36c5cea288 Update status file and test.
Fixes red status for dartium/drt.
Also makes one test more precise (and less likely to fail for the wrong
reasons).

Review-Url: https://codereview.chromium.org/2571583006 .
2016-12-13 14:02:25 +01:00
Florian Loitsch 0c3deba6df Add tests for FutureOr<T>.
R=lrn@google.com

Review URL: https://codereview.chromium.org/2564563003 .
2016-12-12 14:54:57 +01:00
Lasse R.H. Nielsen 9ebef9af7c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

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

Committed: https://github.com/dart-lang/sdk/commit/8cead4090cc0b1184a2ad552003ac38cae1e2c77
2016-11-04 15:55:05 +01:00
William Hesse 3bd04426a8 Revert "Handle the case of Stream.take(0) better." This reverts commit 8cead4090c.
The test co19/LibTest/async/Stream/take_A01_t02 was failing after this
commit, on macos and windows, and perhaps everywhere.

BUG=
TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2475303002 .
2016-11-04 15:47:46 +01:00
Lasse R.H. Nielsen 8cead4090c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2444363004 .
2016-11-04 14:54:58 +01:00
Florian Loitsch 70c48b9a2e Don't propagate synchronous Future.wait errors immediately.
Fixes #27249.

R=lrn@google.com

Review URL: https://codereview.chromium.org/2311923002 .
2016-09-06 11:57:43 +02:00
Florian Loitsch 6255638cd0 Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

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

Committed: https://github.com/dart-lang/sdk/commit/395e7aaa696126b82862a9f75e7ebf742c354b56
Reverted: https://github.com/dart-lang/sdk/commit/99e5328eaca7f98641a5c6e523e80b7297792817
Committed: https://github.com/dart-lang/sdk/commit/1905ddafaa242883891e2fb2d706e2dfa059a71b
Reverted: https://github.com/dart-lang/sdk/commit/46a8579c1eb58f6a36a7d094d9b7824c92873de4
2016-09-05 17:41:22 +02:00
Florian Loitsch 33b7b45252 Deal with synchronous errors in Future.wait.
Synchronous errors are caught and piped into the returned future. This makes handling errors in Future.wait uniform.

Fixes #23656
BUG= http://dartbug.com/23656
R=lrn@google.com

Review URL: https://codereview.chromium.org/2252823004 .
2016-08-18 14:09:20 +02:00
Florian Loitsch 46a8579c1e Revert "Return futures on Stream.cancel when possible."
This reverts commit 1905ddafaa.

Review URL: https://codereview.chromium.org/2223133002 .
2016-08-08 19:31:04 +02:00
Florian Loitsch 1905ddafaa Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

Committed: https://github.com/dart-lang/sdk/commit/395e7aaa696126b82862a9f75e7ebf742c354b56

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

Reverted: https://github.com/dart-lang/sdk/commit/99e5328eaca7f98641a5c6e523e80b7297792817
2016-08-08 17:30:36 +02:00
Florian Loitsch 99e5328eac Revert "Return futures on Stream.cancel when possible."
This reverts commit 395e7aaa69.

Review URL: https://codereview.chromium.org/2213193004 .
2016-08-05 14:32:14 +02:00
Florian Loitsch 395e7aaa69 Return futures on Stream.cancel when possible.
Deprecate returning `null`.

Also, fixes cases where transformations on a stream didn't forward the cancel future

Fixes #26777.

BUG= http://dartbug.com/26777.
R=lrn@google.com

Review URL: https://codereview.chromium.org/2202533003 .
2016-08-05 13:58:45 +02:00
Alan Knight 30b489578d Revert "Reapply zone tasks."
This reverts commit 6a7c037aa6.

BUG=

Review URL: https://codereview.chromium.org/2162643002 .
2016-07-18 13:12:36 -07:00
Florian Loitsch 6a7c037aa6 Reapply zone tasks.
This reverts commit 34d3c37233.

Committed: https://github.com/dart-lang/sdk/commit/f746f8f77e93fd93cb4ff3b4ed644c96a432947a

R=lrn@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/dae392291595fa394d601d2d0baa77b66d85533f
2016-07-05 17:33:09 +02:00
Florian Loitsch dae3922915 Revert "Reapply zone tasks."
This reverts commit f746f8f77e.

Review URL: https://codereview.chromium.org/2123593002 .
2016-07-04 21:58:15 +02:00
Florian Loitsch f746f8f77e Reapply zone tasks.
This reverts commit 34d3c37233.

Review URL: https://codereview.chromium.org/2119243002 .
2016-07-04 19:55:58 +02:00
Florian Loitsch 34d3c37233 Revert zone tasks.
Revert "Add tasks to zones."

This reverts commit 85cccde717.

Revert "Make Dom events run through zone tasks."

This reverts commit 6d1f6b2af6.

Revert "Add zone task support for request-anim."

This reverts commit 726b9f8dc7.

Revert "Add zone task support to http-requests."

This reverts commit b40cfcb57f.

Revert "Update status file for jsshell."

This reverts commit 5e05ee9b5f.

Review URL: https://codereview.chromium.org/2120063002 .
2016-07-01 22:36:52 -07:00
Florian Loitsch 85cccde717 Add tasks to zones.
R=lrn@google.com, misko@google.com

Review URL: https://codereview.chromium.org/1848933002 .
2016-07-01 19:42:22 -07:00
Florian Schneider 60cba24f86 Make timer test more robust.
This would fail, if the cancel() call would not be executed in time.

Give it a little extra time to make intermittent failures go away.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2075793002 .
2016-06-16 14:30:11 -07:00