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

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

Issue 12208116: Roll back r18349. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « pkg/scheduled_test/lib/src/schedule.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/test/scheduled_test_test.dart
diff --git a/pkg/scheduled_test/test/scheduled_test_test.dart b/pkg/scheduled_test/test/scheduled_test_test.dart
index 1b8b29bd52588f667fd44b0e149b5ffba330864f..690319c613382ee020e402af6eb1591674c65f04 100644
--- a/pkg/scheduled_test/test/scheduled_test_test.dart
+++ b/pkg/scheduled_test/test/scheduled_test_test.dart
@@ -293,20 +293,20 @@ void main() {
});
}, passing: ['test 2']);
- expectTestsPass('currentSchedule.errors contains the error in the onComplete '
+ expectTestsPass('currentSchedule.error contains the error in the onComplete '
'queue', () {
- var errors;
+ var error;
test('test 1', () {
currentSchedule.onComplete.schedule(() {
- errors = currentSchedule.errors;
+ error = currentSchedule.error;
});
throw 'error';
});
test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error']));
+ expect(error, new isInstanceOf<ScheduleError>());
+ expect(error.error, equals('error'));
});
}, passing: ['test 2']);
@@ -395,147 +395,71 @@ void main() {
});
}, passing: ['test 2']);
- expectTestsPass('currentSchedule.errors contains the error in the '
- 'onException queue', () {
- var errors;
+ expectTestsPass('currentSchedule.error contains the error in the onException '
+ 'queue', () {
+ var error;
test('test 1', () {
currentSchedule.onException.schedule(() {
- errors = currentSchedule.errors;
+ error = currentSchedule.error;
});
throw 'error';
});
test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error']));
+ expect(error, new isInstanceOf<ScheduleError>());
+ expect(error.error, equals('error'));
});
}, passing: ['test 2']);
- expectTestsPass('currentSchedule.errors contains an error passed into '
+ expectTestsPass('currentSchedule.error contains an error passed into '
'signalError synchronously', () {
- var errors;
+ var error;
test('test 1', () {
currentSchedule.onException.schedule(() {
- errors = currentSchedule.errors;
+ error = currentSchedule.error;
});
currentSchedule.signalError('error');
});
test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error']));
+ expect(error, new isInstanceOf<ScheduleError>());
+ expect(error.error, equals('error'));
});
}, passing: ['test 2']);
- expectTestsPass('currentSchedule.errors contains an error passed into '
+ expectTestsPass('currentSchedule.error contains an error passed into '
'signalError asynchronously', () {
- var errors;
+ var error;
test('test 1', () {
currentSchedule.onException.schedule(() {
- errors = currentSchedule.errors;
+ error = currentSchedule.error;
});
schedule(() => currentSchedule.signalError('error'));
});
test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error']));
+ expect(error, new isInstanceOf<ScheduleError>());
+ expect(error.error, equals('error'));
});
}, passing: ['test 2']);
- expectTestsPass('currentSchedule.errors contains an error passed into '
+ expectTestsPass('currentSchedule.error contains an error passed into '
'signalError out-of-band', () {
- var errors;
+ var error;
test('test 1', () {
currentSchedule.onException.schedule(() {
- errors = currentSchedule.errors;
+ error = currentSchedule.error;
});
sleep(50).then(wrapAsync((_) => currentSchedule.signalError('error')));
});
test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error']));
- });
- }, passing: ['test 2']);
-
- expectTestsPass('currentSchedule.errors contains errors from both the task '
- 'queue and the onException queue in onComplete', () {
- var errors;
- test('test 1', () {
- currentSchedule.onComplete.schedule(() {
- errors = currentSchedule.errors;
- });
-
- currentSchedule.onException.schedule(() {
- throw 'error2';
- });
-
- throw 'error1';
- });
-
- test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['error1', 'error2']));
- });
- }, passing: ['test 2']);
-
- expectTestsPass('currentSchedule.errors contains multiple out-of-band errors '
- 'from both the main task queue and onException in onComplete', () {
- var errors;
- test('test 1', () {
- currentSchedule.onComplete.schedule(() {
- errors = currentSchedule.errors;
- });
-
- currentSchedule.onException.schedule(() {
- sleep(25).then(wrapAsync((_) {
- throw 'error3';
- }));
- sleep(50).then(wrapAsync((_) {
- throw 'error4';
- }));
- });
-
- sleep(25).then(wrapAsync((_) {
- throw 'error1';
- }));
- sleep(50).then(wrapAsync((_) {
- throw 'error2';
- }));
- });
-
- test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error),
- orderedEquals(['error1', 'error2', 'error3', 'error4']));
- });
- }, passing: ['test 2']);
-
- expectTestsPass('currentSchedule.errors contains both an out-of-band error '
- 'and an error raised afterwards in a task', () {
- var errors;
- test('test 1', () {
- currentSchedule.onComplete.schedule(() {
- errors = currentSchedule.errors;
- });
-
- sleep(25).then(wrapAsync((_) {
- throw 'out-of-band';
- }));
-
- schedule(() => sleep(50).then((_) {
- throw 'in-band';
- }));
- });
-
- test('test 2', () {
- expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
- expect(errors.map((e) => e.error), equals(['out-of-band', 'in-band']));
+ expect(error, new isInstanceOf<ScheduleError>());
+ expect(error.error, equals('error'));
});
}, passing: ['test 2']);
« no previous file with comments | « pkg/scheduled_test/lib/src/schedule.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698