Index: runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart |
diff --git a/runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart b/runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart |
index be9fdc5fdacf638dd5e875ab40ec6c4ef9bfa7a8..4696ee8c8fe81f0b9e5a4de71ee37424886c0221 100644 |
--- a/runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart |
+++ b/runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart |
@@ -9,46 +9,42 @@ import 'package:observatory/src/elements/nav/notify_exception.dart'; |
main() { |
NavNotifyExceptionElement.tag.ensureRegistration(); |
- final StackTrace stacktrace = new StackTrace.fromString('stacktrace string'); |
+ final st = new StackTrace.fromString('stacktrace string'); |
group('normal exception', () { |
- final Exception exception = new Exception('exception message'); |
+ final ex = new Exception('exception message'); |
group('instantiation', () { |
test('no stacktrace', () { |
- final NavNotifyExceptionElement e = |
- new NavNotifyExceptionElement(exception); |
+ final e = new NavNotifyExceptionElement(ex); |
expect(e, isNotNull, reason: 'element correctly created'); |
- expect(e.exception, equals(exception)); |
+ expect(e.exception, equals(ex)); |
expect(e.stacktrace, isNull); |
}); |
test('with stacktrace', () { |
- final NavNotifyExceptionElement e = |
- new NavNotifyExceptionElement(exception, stacktrace: stacktrace); |
+ final e = new NavNotifyExceptionElement(ex, stacktrace: st); |
expect(e, isNotNull, reason: 'element correctly created'); |
- expect(e.exception, equals(exception)); |
- expect(e.stacktrace, equals(stacktrace)); |
+ expect(e.exception, equals(ex)); |
+ expect(e.stacktrace, equals(st)); |
}); |
}); |
group('elements', () { |
test('created after attachment (no stacktrace)', () async { |
- final NavNotifyExceptionElement e = |
- new NavNotifyExceptionElement(exception); |
+ final e = new NavNotifyExceptionElement(ex); |
document.body.append(e); |
await e.onRendered.first; |
expect(e.children.length, isNonZero, reason: 'has elements'); |
- expect(e.innerHtml.contains(exception.toString()), isTrue); |
- expect(e.innerHtml.contains(stacktrace.toString()), isFalse); |
+ expect(e.innerHtml.contains(ex.toString()), isTrue); |
+ expect(e.innerHtml.contains(st.toString()), isFalse); |
e.remove(); |
await e.onRendered.first; |
expect(e.children.length, isZero, reason: 'is empty'); |
}); |
test('created after attachment (with stacktrace)', () async { |
- final NavNotifyExceptionElement e = |
- new NavNotifyExceptionElement(exception, stacktrace: stacktrace); |
+ final e = new NavNotifyExceptionElement(ex, stacktrace: st); |
document.body.append(e); |
await e.onRendered.first; |
expect(e.children.length, isNonZero, reason: 'has elements'); |
- expect(e.innerHtml.contains(exception.toString()), isTrue); |
- expect(e.innerHtml.contains(stacktrace.toString()), isTrue); |
+ expect(e.innerHtml.contains(ex.toString()), isTrue); |
+ expect(e.innerHtml.contains(st.toString()), isTrue); |
e.remove(); |
await e.onRendered.first; |
expect(e.children.length, isZero, reason: 'is empty'); |
@@ -58,7 +54,7 @@ main() { |
NavNotifyExceptionElement e; |
StreamSubscription sub; |
setUp(() async { |
- e = new NavNotifyExceptionElement(exception, stacktrace: stacktrace); |
+ e = new NavNotifyExceptionElement(ex, stacktrace: st); |
document.body.append(e); |
await e.onRendered.first; |
}); |
@@ -74,9 +70,8 @@ main() { |
test('onDelete events (DOM)', () async { |
sub = e.onDelete.listen(expectAsync((ExceptionDeleteEvent event) { |
expect(event, isNotNull, reason: 'event is passed'); |
- expect(event.exception, equals(exception), |
- reason: 'exception is the same'); |
- expect(event.stacktrace, equals(stacktrace), |
+ expect(event.exception, equals(ex), reason: 'exception is the same'); |
+ expect(event.stacktrace, equals(st), |
reason: 'stacktrace is the same'); |
}, count: 1, reason: 'event is fired')); |
e.querySelector('button').click(); |
@@ -84,9 +79,8 @@ main() { |
test('onDelete events (code)', () async { |
sub = e.onDelete.listen(expectAsync((ExceptionDeleteEvent event) { |
expect(event, isNotNull, reason: 'event is passed'); |
- expect(event.exception, equals(exception), |
- reason: 'exception is the same'); |
- expect(event.stacktrace, equals(stacktrace), |
+ expect(event.exception, equals(ex), reason: 'exception is the same'); |
+ expect(event.stacktrace, equals(st), |
reason: 'stacktrace is the same'); |
}, count: 1, reason: 'event is fired')); |
e.delete(); |