Commit Graph

86 Commits

Author SHA1 Message Date
floitsch@google.com 80aad7930f Fix skipWhile.
BUG= http://dartbug.com/9480

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21623 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 15:39:42 +00:00
lrn@google.com 084cc64ce1 Add Stream.forEach
Review URL: https://codereview.chromium.org//14312010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21608 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 09:13:16 +00:00
floitsch@google.com 466d6670c1 Refactor Future constructors.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21517 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 21:24:27 +00:00
floitsch@google.com 62d413ec91 Remove StreamController.broadcast.
Review URL: https://codereview.chromium.org//14136004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21499 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 19:08:17 +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
floitsch@google.com f553392322 Change StreamController constructor.
Review URL: https://codereview.chromium.org//14196003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21472 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:34:26 +00:00
floitsch@google.com e2ee353940 Rename unsubscribeOnError to cancelOnError.
Review URL: https://codereview.chromium.org//14251013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21469 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 16:07:36 +00:00
floitsch@google.com 457dffa030 Add StreamSubscription.asFuture.
Review URL: https://codereview.chromium.org//14237002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21441 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 12:17:07 +00:00
floitsch@google.com 285849c801 Change hasSubscribers to hasListener.
Review URL: https://codereview.chromium.org//14103010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21337 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 09:30:05 +00:00
ajohnsen@google.com 57161d6e59 Remove deprecated CollectionSink and Stream.pipeInto.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21261 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 09:31:50 +00:00
lrn@google.com f41508d33b Added new version of reduce.
Removed min/max and uses of min/max.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21258 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 08:32:31 +00:00
lrn@google.com 864b4472bc Fix stream_controller_test failure.
Review URL: https://codereview.chromium.org//13814010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21145 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-09 10:54:07 +00:00
lrn@google.com 7e9e78d159 Make EventTransformerStream's subscription not send events after cancel.
Also make Stream.firstm, Stream.single and Stream.elementAt cancel
their subscription before completing the future, instead of after.

BUG=http://dartbug.com/7964

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21140 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-09 09:26:43 +00:00
floitsch@google.com 343fa26d65 Remove deprecated Expect from the libraries.
Review URL: https://codereview.chromium.org//13724021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21079 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 16:07:34 +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
floitsch@google.com e72250e49b StreamConsumer has an addStream and a close functions.
The 'consume' function will be removed.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20979 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 16:22:11 +00:00
floitsch@google.com bef8ebb5f6 Add Iterable.fold (and Stream.fold) which replace reduce.
For now this is just a copy. In a next step we will change the behavior of
`reduce`.

BUG= http://dartbug.com/9536

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20978 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 16:12:40 +00:00
floitsch@google.com 34d86168b4 Mark periodic4-test as flaky and add debug information.
Review URL: https://codereview.chromium.org//13541002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20868 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-03 15:33:29 +00:00
floitsch@google.com 8c4cb66a14 Make stream_periodic4_test more resilient against computer loads.
BUG= http://dartbug.com/9367

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20849 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-03 12:06:48 +00:00
floitsch@google.com a104ba2d4b Give VM a millisecond safety margin for the test.
Review URL: https://codereview.chromium.org//13008020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20384 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 15:46:07 +00:00
ager@google.com e3b397457f Increase the allowed heap size for slow consumer test. We hit the limit in dartium x64 checked mode.
R=lrn@google.com
BUG=dartbug.com/9345

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20369 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 09:18:39 +00:00
floitsch@google.com ab09c261fe Add safetymargin.
Review URL: https://codereview.chromium.org//12617013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20225 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 18:04:19 +00:00
floitsch@google.com 789a144672 Add margin to browser tests and not VM...
Review URL: https://codereview.chromium.org//12516012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20212 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 15:57:27 +00:00
floitsch@google.com 88dc9f5d8c Add safetymargin for timer tests in browsers.
Review URL: https://codereview.chromium.org//12855003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20209 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 15:13:30 +00:00
floitsch@google.com 61b307fb6a Move timer tests to async tests.
Review URL: https://codereview.chromium.org//12812014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20203 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 13:20:35 +00:00
ricow@google.com 10ba4e37fb Remove time dependent part of test
This is flaking
Review URL: https://codereview.chromium.org//12706014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20158 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-18 13:55:55 +00:00
floitsch@google.com 05905fd4b6 Add Stream.periodic.
BUG= http://dartbug.com/8477

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20021 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-14 13:43:35 +00:00
floitsch@google.com 65718c56df Rename XMatching to XWhere.
For example firstMatching -> firstWhere.

BUG= http://dartbug.com/8664
BUG= http://dartbug.com/8337

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19880 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 17:34:49 +00:00
floitsch@google.com cf677c0513 Update status file.
Review URL: https://codereview.chromium.org//12554008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19771 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 10:34:12 +00:00
floitsch@google.com cf605283e2 Add first version of runAsync.
Review URL: https://codereview.chromium.org//12380060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19768 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 10:08:28 +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
floitsch@google.com dd48256fe5 Remove deprecated StringBuffer.add, addAll and addCharCode.
Review URL: https://codereview.chromium.org//12473003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19690 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 13:07:18 +00:00
lrn@google.com bead146749 Renamed StreamSink to EventSink. Renamed signalError to addError.
Review URL: https://codereview.chromium.org//12610006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19683 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 11:31:19 +00:00
ajohnsen@google.com 2d48e3d8e8 Re-enable slow_consumer* tests, now stream pausing behave as expected.
To enable slow_consumer2_test to run on x64, double the heap size.

BUG=https://code.google.com/p/dart/issues/detail?id=7726,https://code.google.com/p/dart/issues/detail?id=8647

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19620 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 13:19:36 +00:00
lrn@google.com 1648ec1e12 Another test that cancels a timer.
Review URL: https://codereview.chromium.org//12391059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19385 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 13:48:52 +00:00
lrn@google.com 4d30b1bbbe Split stream_state_test into three files.
The test "framework" is in a file of its own, and the tests are
split into those that uses timers greater than zero (which doesn't
work on d8) and the rest.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19381 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 13:23:43 +00:00
lrn@google.com eb90412c66 Change and structure how Stream implementations do callbacks.
Callbacks are the on-pause/subscription-state change calls from a stream.

Now a callback is an atomic operation. State changes happening during a callback
will not trigger a new callback before the old one is done. If the state is
changed during the callback, another callback will follow immediately.

Firing of events is also atomic, so a callback will not happend during an event
being fired, but will be triggered afterwards if the state was changed by the
event handlers.

A stream controller (or any other listener for callbacks) will not be told
immediately if a paused stream is resumed. If there are pending events in the
queue, those will be fired before the controller is considerered resumed.

A canceled subscription will immediately stop getting events.
Previously it would get the current event being fired, but it's more rational
to not get events after you have said you don't want them, instead of having
the handlers have to discard events after a cancel.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19379 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-04 11:53:12 +00:00
lrn@google.com 8806250918 Fix for issue 8311.
Fix bad state in done-handler of event-transform-stream

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19215 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 12:18:40 +00:00
lrn@google.com 96412ca371 Fix mising rename in tests of Future.isCompleted.
Review URL: https://codereview.chromium.org//12387012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19212 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 11:54:19 +00:00
lrn@google.com cd4ae7e4af Add test for whether a completer or stream controller has been closed.
BUG=http://dartbug.com/8638

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19211 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 11:36:54 +00:00
nweiz@google.com 987dc18324 Make sure Future.forEach properly pipes exceptions.
BUG=8817

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19164 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 19:22:27 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +00:00
lrn@google.com 247601ab57 Increase size for slow-consumer test (overflows memory on X64).
Address comments from previous commit.
Make recursive callbacks from a Stream work correctly.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18753 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 13:21:32 +00:00
lrn@google.com 0b84212bc3 Change Stream callbacks.
During a stat-change callback, events can't be fired. Any events added will be delayed.

When both the subscription state and the pause state has changed in a single operation, only the subscription state change callback is called.

After calling _close on a Stream (close on a StreamController/scheduling a Done event), the pause-state change callback will no longer be called. All necessary pause handling will be done internally in the Stream, since the stream controller can't add any new events anyway.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18748 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 12:45:43 +00:00
ahe@google.com 25c6dedd61 Skeleton API for lazy library loading.
Review URL: https://codereview.chromium.org//11784018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18637 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-18 15:32:22 +00:00
lrn@google.com 03f5a66836 Recommit changing List.skip/take/revert returns Iterable and remove mappedBy.
This reverts r18591.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18615 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-18 10:35:51 +00:00
rnystrom@google.com 0e0473d33a Unbreak pub:
Revert "Make List.skip, List.take and List.reversed return Iterables, not Lists."

This reverts commit 44c3745a76acfad3d1d5bfc7a8b8c8e2def30e09.

Revert "Remove deprecated mappedBy."

This reverts commit 779ab69eab73e5e349245e99560b18955908e0cc.

BUG=dartbug.com/8560

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18591 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 18:38:42 +00:00
floitsch@google.com 0672317bec Remove deprecated mappedBy.
Committed: https://code.google.com/p/dart/source/detail?r=18575
Reverted: http://code.google.com/p/dart/source/detail?r=18576

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18579 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:57:18 +00:00
floitsch@google.com ad839e6957 Revert "Remove deprecated mappedBy."
This reverts commit 18575.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18576 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 13:23:22 +00:00