Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Issue 12310123: Added ability for test cases to return Futures. (Closed)

Created:
7 years, 10 months ago by gram
Modified:
7 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added ability for test cases to return Futures. Committed: https://code.google.com/p/dart/source/detail?r=19087

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -39 lines) Patch
M pkg/unittest/lib/src/test_case.dart View 1 2 chunks +27 lines, -14 lines 0 comments Download
M pkg/unittest/lib/unittest.dart View 1 3 chunks +24 lines, -15 lines 0 comments Download
M pkg/unittest/test/unittest_test.dart View 1 4 chunks +120 lines, -10 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
gram
7 years, 10 months ago (2013-02-25 23:48:43 UTC) #1
Siggi Cherem (dart-lang)
lgtm, but see my question below about defer https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dart File pkg/unittest/lib/unittest.dart (right): https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dart#newcode116 pkg/unittest/lib/unittest.dart:116: * ...
7 years, 10 months ago (2013-02-26 00:25:29 UTC) #2
gram
Committed patchset #2 manually as r19087 (presubmit successful).
7 years, 10 months ago (2013-02-26 22:02:27 UTC) #3
gram
7 years, 9 months ago (2013-03-04 19:51:52 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dart
File pkg/unittest/lib/unittest.dart (right):

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dar...
pkg/unittest/lib/unittest.dart:116: * A variation on this is
expectAsyncUntilX(); this takes a callback as the first
On 2013/02/26 00:25:29, Siggi Cherem (dart-lang) wrote:
> 80 col

Done.

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dar...
pkg/unittest/lib/unittest.dart:125: * test that may be invoked via an [Isolate]
(for example, with Timer.run()],
On 2013/02/26 00:25:29, Siggi Cherem (dart-lang) wrote:
> rephrase: 'via an [Isolate]' sounds strange.
> 
> In the browser for example Timer.run uses window.setTimout. You also have
> futures for XHR requests. 
> 
> How about  'may be in voked from a top-level context'?

Done.

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/lib/unittest.dar...
pkg/unittest/lib/unittest.dart:703: (new Future.immediate(null)).then((_) =>
callback());
On 2013/02/26 00:25:29, Siggi Cherem (dart-lang) wrote:
> I wonder if anything depends on the old behavior here.
> 
> In dart2js this will do a setTimeout(0) -- (which I hope gets fixed soon), but
> that will be at the beginning of the next eventloop. The old logic with ports
> was guaranteed to be at the end of the same event-loop. 

I've run all tests in vm (checked/unchecked) and all unchecked in dart2js/d8 and
dart2js/drt, plus quite a few in dart2js/drt checked, with no issues.

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/test/unittest_te...
File pkg/unittest/test/unittest_test.dart (right):

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/test/unittest_te...
pkg/unittest/test/unittest_test.dart:23: return (new
Future.immediate(null)).then((_)=>guardAsync(fn));
On 2013/02/26 00:25:29, Siggi Cherem (dart-lang) wrote:
> style nit: add spaces around =>

Done.

https://codereview.chromium.org/12310123/diff/1/pkg/unittest/test/unittest_te...
pkg/unittest/test/unittest_test.dart:270: } else if (testName == 'test returning
future using isolate (Timer)') {
On 2013/02/26 00:25:29, Siggi Cherem (dart-lang) wrote:
> nit: I'd just say '... future using Timer'?

Done.

Powered by Google App Engine
This is Rietveld 408576698