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

Unified Diff: runtime/observatory/tests/observatory_ui/nav/notify_exception/exception_test.dart

Issue 2176093002: Use Timer and not AnimationFrame during Observatory UI tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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: 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..74c7e13738279d1300880ce7be15bb79e7da079b 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
@@ -4,11 +4,15 @@
import 'dart:html';
import 'dart:async';
import 'package:unittest/unittest.dart';
+import 'package:observatory/src/elements/helpers/rendering_queue.dart';
import 'package:observatory/src/elements/nav/notify_exception.dart';
main() {
NavNotifyExceptionElement.tag.ensureRegistration();
+ final TimedRenderingBarrier barrier = new TimedRenderingBarrier();
+ final RenderingQueue queue = new RenderingQueue.fromBarrier(barrier);
+
final StackTrace stacktrace = new StackTrace.fromString('stacktrace string');
group('normal exception', () {
final Exception exception = new Exception('exception message');
@@ -31,7 +35,7 @@ main() {
group('elements', () {
test('created after attachment (no stacktrace)', () async {
final NavNotifyExceptionElement e =
- new NavNotifyExceptionElement(exception);
+ new NavNotifyExceptionElement(exception, queue: queue);
document.body.append(e);
await e.onRendered.first;
expect(e.children.length, isNonZero, reason: 'has elements');
@@ -43,7 +47,8 @@ main() {
});
test('created after attachment (with stacktrace)', () async {
final NavNotifyExceptionElement e =
- new NavNotifyExceptionElement(exception, stacktrace: stacktrace);
+ new NavNotifyExceptionElement(exception, stacktrace: stacktrace,
+ queue: queue);
document.body.append(e);
await e.onRendered.first;
expect(e.children.length, isNonZero, reason: 'has elements');
@@ -58,13 +63,15 @@ main() {
NavNotifyExceptionElement e;
StreamSubscription sub;
setUp(() async {
- e = new NavNotifyExceptionElement(exception, stacktrace: stacktrace);
+ e = new NavNotifyExceptionElement(exception, stacktrace: stacktrace,
+ queue: queue);
document.body.append(e);
await e.onRendered.first;
});
- tearDown(() {
+ tearDown(() async {
sub.cancel();
e.remove();
+ await e.onRendered.first;
});
test('navigation after connect', () async {
sub = window.onPopState.listen(expectAsync((_) {}, count: 1,

Powered by Google App Engine
This is Rietveld 408576698