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

Unified Diff: pkg/stack_trace/test/chain_test.dart

Issue 232783008: Avoid timeouts in stack_trace's chain_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « pkg/pkg.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/test/chain_test.dart
diff --git a/pkg/stack_trace/test/chain_test.dart b/pkg/stack_trace/test/chain_test.dart
index 683544f1d26ad885fbd961db53d2cadf35148cd0..3347deb2b52da0233b146dd7a21b3b3afdf1a883 100644
--- a/pkg/stack_trace/test/chain_test.dart
+++ b/pkg/stack_trace/test/chain_test.dart
@@ -92,16 +92,20 @@ void main() {
inMicrotask(() => throw 'first error');
inPeriodicTimer(() => throw 'second error');
}, onError: (error, chain) {
- if (first) {
- expect(error, equals('first error'));
- expect(chain.traces[1].frames,
- contains(frameMember(startsWith('inMicrotask'))));
- first = false;
- } else {
- expect(error, equals('second error'));
- expect(chain.traces[1].frames,
- contains(frameMember(startsWith('inPeriodicTimer'))));
- completer.complete();
+ try {
+ if (first) {
+ expect(error, equals('first error'));
+ expect(chain.traces[1].frames,
+ contains(frameMember(startsWith('inMicrotask'))));
+ first = false;
+ } else {
+ expect(error, equals('second error'));
+ expect(chain.traces[1].frames,
+ contains(frameMember(startsWith('inPeriodicTimer'))));
+ completer.complete();
+ }
+ } catch (error, stackTrace) {
+ completer.completeError(error, stackTrace);
}
});
@@ -121,11 +125,15 @@ void main() {
throw error;
});
}, onError: (error, chain) {
- expect(error, equals('error'));
- expect(chain, new isInstanceOf<Chain>());
- expect(chain.traces[1].frames,
- contains(frameMember(startsWith('inMicrotask'))));
- completer.complete();
+ try {
+ expect(error, equals('error'));
+ expect(chain, new isInstanceOf<Chain>());
+ expect(chain.traces[1].frames,
+ contains(frameMember(startsWith('inMicrotask'))));
+ completer.complete();
+ } catch (error, stackTrace) {
+ completer.completeError(error, stackTrace);
+ }
});
return completer.future;
@@ -138,11 +146,15 @@ void main() {
runZoned(() {
Chain.capture(() => inMicrotask(() => throw 'error'));
}, onError: (error, chain) {
- expect(error, equals('error'));
- expect(chain, new isInstanceOf<Chain>());
- expect(chain.traces[1].frames,
- contains(frameMember(startsWith('inMicrotask'))));
- completer.complete();
+ try {
+ expect(error, equals('error'));
+ expect(chain, new isInstanceOf<Chain>());
+ expect(chain.traces[1].frames,
+ contains(frameMember(startsWith('inMicrotask'))));
+ completer.complete();
+ } catch (error, stackTrace) {
+ completer.completeError(error, stackTrace);
+ }
});
return completer.future;
« no previous file with comments | « pkg/pkg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698