From 96e8f91640a65e23135bca94e1e233b3a280a50b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 5 Jan 2021 18:15:18 -0800 Subject: [PATCH] Update the web profiler_test to wrap benchmark callbacks with allowInterop (flutter/engine#23439) This is now required by js_util.setProperty (see https://github.com/dart-lang/sdk/commit/d683f33f5bfefe92ea1a590a800c7e41b213f69c) --- .../src/flutter/lib/web_ui/test/engine/profiler_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart b/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart index 49f11242c8..c2fb54e7fb 100644 --- a/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart +++ b/engine/src/flutter/lib/web_ui/test/engine/profiler_test.dart @@ -4,6 +4,7 @@ // @dart = 2.6 import 'dart:html' as html; +import 'dart:js' as js; import 'dart:js_util' as js_util; import 'package:test/bootstrap/browser.dart'; @@ -60,14 +61,13 @@ void testMain() { }); expect( () => Profiler.instance.benchmark('foo', 123), - throwsA(isA()), + throwsA(isA()), ); expect(data, isEmpty); // Not even a callback. - jsOnBenchmark('string'); expect( - () => Profiler.instance.benchmark('foo', 123), + () => jsOnBenchmark('string'), throwsA(isA()), ); }); @@ -102,5 +102,5 @@ class BenchmarkDatapoint { } void jsOnBenchmark(dynamic listener) { - js_util.setProperty(html.window, '_flutter_internal_on_benchmark', listener); + js_util.setProperty(html.window, '_flutter_internal_on_benchmark', listener != null ? js.allowInterop(listener) : null); }