Test harness should check for running Timers and AnimationControllers

After running a widget test, we now clear out the widget tree and check that we
didn't leak any timers or animations.

Also, fix several bugs that this addtional check revealed.

Fixes #2481
This commit is contained in:
Adam Barth
2016-03-09 08:33:44 -08:00
parent 5faf84c3fa
commit 0d7b0f9ec1
5 changed files with 41 additions and 9 deletions

View File

@@ -22,6 +22,10 @@ void main() {
tester.setLocale("es", "US");
tester.pump();
expect(tab.widget.data, equals("MERCADO"));
// TODO(abarth): We're leaking an animation. We should track down the leak
// and plug it rather than waiting for the animation to end here.
tester.pump(const Duration(seconds: 1));
});
});
}