diff --git a/lib/stub_ui/lib/src/ui/canvas.dart b/lib/stub_ui/lib/src/ui/canvas.dart index 9d01ae0546bc7..2c4a8875d53f9 100644 --- a/lib/stub_ui/lib/src/ui/canvas.dart +++ b/lib/stub_ui/lib/src/ui/canvas.dart @@ -978,7 +978,7 @@ class Picture { /// /// Although the image is returned synchronously, the picture is actually /// rasterized the first time the image is drawn and then cached. - Image toImage(int width, int height) => null; + Future toImage(int width, int height) => null; /// Release the resources used by this object. The object is no longer usable /// after this method is called. diff --git a/web_sdk/test/api_conform_test.dart b/web_sdk/test/api_conform_test.dart index 137237bc79bd9..d121fb48b8b3d 100644 --- a/web_sdk/test/api_conform_test.dart +++ b/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) {