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

Unified Diff: pkg/scheduled_test/test/scheduled_test/simple_test.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/scheduled_test/test/scheduled_test/simple_test.dart
diff --git a/pkg/scheduled_test/test/scheduled_test/simple_test.dart b/pkg/scheduled_test/test/scheduled_test/simple_test.dart
index ea519210111cf0f8421a917bdc838f391f677c60..8c67bf3508428b5f8ff2f5f2f695780b2dc17d22 100644
--- a/pkg/scheduled_test/test/scheduled_test/simple_test.dart
+++ b/pkg/scheduled_test/test/scheduled_test/simple_test.dart
@@ -30,14 +30,14 @@ void main() {
expectTestsPass('a scheduled test with a correct asynchronous expectation '
'should pass', () {
test('test', () {
- expect(new Future.immediate('foo'), completion(equals('foo')));
+ expect(new Future.value('foo'), completion(equals('foo')));
});
});
expectTestsFail('a scheduled test with an incorrect asynchronous expectation '
'should fail', () {
test('test', () {
- expect(new Future.immediate('foo'), completion(equals('bar')));
+ expect(new Future.value('foo'), completion(equals('bar')));
});
});
@@ -57,7 +57,7 @@ void main() {
'register', () {
test('test', () {
schedule(() =>
- expect(new Future.immediate('foo'), completion(equals('foo'))));
+ expect(new Future.value('foo'), completion(equals('foo'))));
});
});
@@ -65,7 +65,7 @@ void main() {
'register', () {
test('test', () {
schedule(() =>
- expect(new Future.immediate('foo'), completion(equals('bar'))));
+ expect(new Future.value('foo'), completion(equals('bar'))));
});
});
@@ -88,7 +88,7 @@ void main() {
});
test('asynchronous value', () {
- var future = schedule(() => new Future.immediate('value'));
+ var future = schedule(() => new Future.value('value'));
expect(future, completion(equals('value')));
});
});
@@ -107,7 +107,7 @@ void main() {
expectTestsFail('a test failure in a chained future in a scheduled block '
'should be registered', () {
test('test', () {
- schedule(() => new Future.immediate('foo')
+ schedule(() => new Future.value('foo')
.then((v) => expect(v, equals('bar'))));
});
});
@@ -115,7 +115,7 @@ void main() {
expectTestsFail('an error in a chained future in a scheduled block should be '
'registered', () {
test('test', () {
- schedule(() => new Future.immediate(null).then((_) {
+ schedule(() => new Future.value().then((_) {
throw 'error';
}));
});
« no previous file with comments | « pkg/scheduled_test/test/descriptor/async_test.dart ('k') | pkg/scheduled_test/test/substitute_future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698