Unverified Commit 43190156 authored by Tomasz Gucio's avatar Tomasz Gucio Committed by GitHub

Use tearoffs (#122091)

Use tearoffs in TestRenderingFlutterBinding
parent 2181c75b
......@@ -112,9 +112,7 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser
/// to test [SchedulerPhase.postFrameCallbacks].
void pumpCompleteFrame() {
final FlutterExceptionHandler? oldErrorHandler = FlutterError.onError;
FlutterError.onError = (FlutterErrorDetails details) {
_errors.add(details);
};
FlutterError.onError = _errors.add;
try {
TestRenderingFlutterBinding.instance.handleBeginFrame(null);
TestRenderingFlutterBinding.instance.handleDrawFrame();
......@@ -139,9 +137,7 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser
void drawFrame() {
assert(phase != EnginePhase.build, 'rendering_tester does not support testing the build phase; use flutter_test instead');
final FlutterExceptionHandler? oldErrorHandler = FlutterError.onError;
FlutterError.onError = (FlutterErrorDetails details) {
_errors.add(details);
};
FlutterError.onError = _errors.add;
try {
pipelineOwner.flushLayout();
if (phase == EnginePhase.layout) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment