From 07d7550d808e27eddfbdae83f20178c73cb0cbf9 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Sat, 6 Jul 2019 00:45:07 -0700 Subject: [PATCH] fix Picture.toImage return type check and api conform test. (flutter/engine#9685) --- engine/src/flutter/web_sdk/test/api_conform_test.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/web_sdk/test/api_conform_test.dart b/engine/src/flutter/web_sdk/test/api_conform_test.dart index 137237bc79b..d121fb48b8b 100644 --- a/engine/src/flutter/web_sdk/test/api_conform_test.dart +++ b/engine/src/flutter/web_sdk/test/api_conform_test.dart @@ -148,6 +148,15 @@ void main() { '${uiParam.identifier.name} is named, but not in lib/stub_ui/ui.dart.'); } } + // check return type. + if (uiMethod.returnType?.toString() != webMethod.returnType?.toString()) { + // allow dynamic in web implementation. + if (webMethod.returnType?.toString() != 'dynamic') { + failed = true; + print('Warning: lib/ui/ui.dart $className.$methodName return type' + '${uiMethod.returnType?.toString()} is not the same as in lib/stub_ui/ui.dart.'); + } + } } } if (failed) { @@ -158,8 +167,6 @@ void main() { exit(0); } -void _checkParameters() {} - // Collects all public classes defined by the part files of [unit]. void _collectPublicClasses(CompilationUnit unit, Map destination, String root) {