diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index 5c0fb7ecf999..8e37ba236135 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -36,3 +36,9 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_android: {path: ../../../../packages/webview_flutter/webview_flutter_android} + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} + webview_flutter_wkwebview: {path: ../../../../packages/webview_flutter/webview_flutter_wkwebview} diff --git a/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart b/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart index 746caed140d5..215325e56fcb 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart @@ -38,8 +38,11 @@ class NavigationDelegate { /// Constructs a [NavigationDelegate]. /// /// {@template webview_fluttter.NavigationDelegate.constructor} - /// `onUrlChange`: invoked when the underlying web view changes to a new url. - /// `onHttpAuthRequest`: invoked when the web view is requesting authentication. + /// **`onUrlChange`:** invoked when the underlying web view changes to a new url. + /// **`onHttpAuthRequest`:** invoked when the web view is requesting authentication. + /// **`onSslAuthError`:** Invoked when the web view receives a recoverable SSL + /// error for a certificate. The host application must call either + /// [SslAuthError.cancel] or [SslAuthError.proceed]. /// {@endtemplate} NavigationDelegate({ FutureOr Function(NavigationRequest request)? @@ -51,6 +54,7 @@ class NavigationDelegate { void Function(UrlChange change)? onUrlChange, void Function(HttpAuthRequest request)? onHttpAuthRequest, void Function(HttpResponseError error)? onHttpError, + void Function(SslAuthError request)? onSslAuthError, }) : this.fromPlatformCreationParams( const PlatformNavigationDelegateCreationParams(), onNavigationRequest: onNavigationRequest, @@ -61,6 +65,7 @@ class NavigationDelegate { onUrlChange: onUrlChange, onHttpAuthRequest: onHttpAuthRequest, onHttpError: onHttpError, + onSslAuthError: onSslAuthError, ); /// Constructs a [NavigationDelegate] from creation params for a specific @@ -105,6 +110,7 @@ class NavigationDelegate { void Function(UrlChange change)? onUrlChange, void Function(HttpAuthRequest request)? onHttpAuthRequest, void Function(HttpResponseError error)? onHttpError, + void Function(SslAuthError request)? onSslAuthError, }) : this.fromPlatform( PlatformNavigationDelegate(params), onNavigationRequest: onNavigationRequest, @@ -115,6 +121,7 @@ class NavigationDelegate { onUrlChange: onUrlChange, onHttpAuthRequest: onHttpAuthRequest, onHttpError: onHttpError, + onSslAuthError: onSslAuthError, ); /// Constructs a [NavigationDelegate] from a specific platform implementation. @@ -130,6 +137,7 @@ class NavigationDelegate { void Function(UrlChange change)? onUrlChange, HttpAuthRequestCallback? onHttpAuthRequest, void Function(HttpResponseError error)? onHttpError, + void Function(SslAuthError request)? onSslAuthError, }) { if (onNavigationRequest != null) { platform.setOnNavigationRequest(onNavigationRequest!); @@ -155,6 +163,13 @@ class NavigationDelegate { if (onHttpError != null) { platform.setOnHttpError(onHttpError); } + if (onSslAuthError != null) { + platform.setOnSSlAuthError( + (PlatformSslAuthError error) { + onSslAuthError(SslAuthError._fromPlatform(error)); + }, + ); + } } /// Implementation of [PlatformNavigationDelegate] for the current platform. @@ -184,3 +199,53 @@ class NavigationDelegate { /// Invoked when a resource loading error occurred. final WebResourceErrorCallback? onWebResourceError; } + +/// Represents an SSL error with the associated certificate. +/// +/// The host application must call [cancel] or, contrary to secure web +/// communication standards, [proceed] to provide the web view's response to the +/// error. +/// +/// ## Platform-Specific Features +/// This class contains an underlying implementation provided by the current +/// platform. Once a platform implementation is imported, the examples below +/// can be followed to use features provided by a platform's implementation. +/// +/// Below is an example of accessing the platform-specific implementation for +/// iOS and Android: +/// +/// ```dart +/// final SslAuthError error = ...; +/// +/// if (WebViewPlatform.instance is WebKitWebViewPlatform) { +/// final WebKitSslAuthError webKitError = +/// error.platform as WebKitSslAuthError; +/// } else if (WebViewPlatform.instance is AndroidWebViewPlatform) { +/// final AndroidSslAuthError androidError = +/// error.platform as AndroidSslAuthError; +/// } +/// ``` +class SslAuthError { + SslAuthError._fromPlatform(this.platform); + + /// An implementation of [PlatformSslAuthError] for the current platform. + final PlatformSslAuthError platform; + + /// The certificate associated with this error. + X509Certificate? get certificate => platform.certificate; + + /// Instructs the WebView that encountered the SSL certificate error to + /// terminate communication with the server. + /// + /// The host application must call this method to prevent a resource from + /// loading when an SSL certificate is invalid. + Future cancel() => platform.cancel(); + + /// Instructs the WebView that encountered the SSL certificate error to ignore + /// the error and continue communicating with the server. + /// + /// **Warning:** When an SSL error occurs, the host application should always + /// call [cancel] rather than [proceed] because an invalid SSL certificate + /// means the connection is not secure. + Future proceed() => platform.proceed(); +} diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index c609edc11ff4..6592e978394f 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -36,3 +36,9 @@ topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_android: {path: ../../../packages/webview_flutter/webview_flutter_android} + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} + webview_flutter_wkwebview: {path: ../../../packages/webview_flutter/webview_flutter_wkwebview} diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart index 64f5b16170d5..8a174ca2c4cd 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart @@ -111,6 +111,22 @@ void main() { verify(delegate.platform.setOnHttpError(onHttpError)); }); + + test('onSslAuthError', () async { + WebViewPlatform.instance = TestWebViewPlatform(); + + final NavigationDelegate delegate = NavigationDelegate( + onSslAuthError: expectAsync1((_) {}), + ); + + final void Function(PlatformSslAuthError) callback = verify( + (delegate.platform as MockPlatformNavigationDelegate) + .setOnSSlAuthError(captureAny)) + .captured + .single as void Function(PlatformSslAuthError); + + callback(TestPlatformSslAuthError()); + }); }); } @@ -125,3 +141,17 @@ class TestWebViewPlatform extends WebViewPlatform { class TestMockPlatformNavigationDelegate extends MockPlatformNavigationDelegate with MockPlatformInterfaceMixin {} + +class TestPlatformSslAuthError extends PlatformSslAuthError { + TestPlatformSslAuthError() : super(certificate: null, description: ''); + + @override + Future cancel() { + throw UnimplementedError(); + } + + @override + Future proceed() { + throw UnimplementedError(); + } +} diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index 4b02c37ace2a..90f8d338e45f 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -211,4 +211,14 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); + + @override + _i8.Future setOnSSlAuthError( + _i3.SslAuthErrorCallback? onSslAuthError, + ) => + (super.noSuchMethod( + Invocation.method(#setOnSSlAuthError, [onSslAuthError]), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 0c4537103a5f..1bf14e9df61b 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -436,4 +436,14 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + + @override + _i5.Future setOnSSlAuthError( + _i6.SslAuthErrorCallback? onSslAuthError, + ) => + (super.noSuchMethod( + Invocation.method(#setOnSSlAuthError, [onSslAuthError]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt index f48cf24608a3..4a8d7a1cefed 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt @@ -561,6 +561,12 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: */ abstract fun getPigeonApiSslCertificate(): PigeonApiSslCertificate + /** + * An implementation of [PigeonApiCertificate] used to add a new Dart instance of `Certificate` to + * the Dart `InstanceManager`. + */ + abstract fun getPigeonApiCertificate(): PigeonApiCertificate + fun setUp() { AndroidWebkitLibraryPigeonInstanceManagerApi.setUpMessageHandlers( binaryMessenger, instanceManager) @@ -591,6 +597,7 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiSslCertificateDName.setUpMessageHandlers( binaryMessenger, getPigeonApiSslCertificateDName()) PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, getPigeonApiSslCertificate()) + PigeonApiCertificate.setUpMessageHandlers(binaryMessenger, getPigeonApiCertificate()) } fun tearDown() { @@ -615,6 +622,7 @@ abstract class AndroidWebkitLibraryPigeonProxyApiRegistrar(val binaryMessenger: PigeonApiSslError.setUpMessageHandlers(binaryMessenger, null) PigeonApiSslCertificateDName.setUpMessageHandlers(binaryMessenger, null) PigeonApiSslCertificate.setUpMessageHandlers(binaryMessenger, null) + PigeonApiCertificate.setUpMessageHandlers(binaryMessenger, null) } } @@ -716,6 +724,8 @@ private class AndroidWebkitLibraryPigeonProxyApiBaseCodec( registrar.getPigeonApiSslCertificateDName().pigeon_newInstance(value) {} } else if (value is android.net.http.SslCertificate) { registrar.getPigeonApiSslCertificate().pigeon_newInstance(value) {} + } else if (value is java.security.cert.Certificate) { + registrar.getPigeonApiCertificate().pigeon_newInstance(value) {} } when { @@ -5522,6 +5532,12 @@ open class PigeonApiX509Certificate( } } } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiCertificate] used to access callback methods */ + fun pigeon_getPigeonApiCertificate(): PigeonApiCertificate { + return pigeonRegistrar.getPigeonApiCertificate() + } } /** * Represents a request for handling an SSL error. @@ -6091,3 +6107,80 @@ abstract class PigeonApiSslCertificate( } } } +/** + * Abstract class for managing a variety of identity certificates. + * + * See https://developer.android.com/reference/java/security/cert/Certificate. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiCertificate( + open val pigeonRegistrar: AndroidWebkitLibraryPigeonProxyApiRegistrar +) { + /** The encoded form of this certificate. */ + abstract fun getEncoded(pigeon_instance: java.security.cert.Certificate): ByteArray + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCertificate?) { + val codec = api?.pigeonRegistrar?.codec ?: AndroidWebkitLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.webview_flutter_android.Certificate.getEncoded", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as java.security.cert.Certificate + val wrapped: List = + try { + listOf(api.getEncoded(pigeon_instanceArg)) + } catch (exception: Throwable) { + AndroidWebkitLibraryPigeonUtils.wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of Certificate and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: java.security.cert.Certificate, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + AndroidWebKitError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + } else if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + callback(Result.success(Unit)) + } else { + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.webview_flutter_android.Certificate.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + AndroidWebKitError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback( + Result.failure(AndroidWebkitLibraryPigeonUtils.createConnectionError(channelName))) + } + } + } + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/CertificateProxyApi.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/CertificateProxyApi.java new file mode 100644 index 000000000000..b80f44ff255b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/CertificateProxyApi.java @@ -0,0 +1,30 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import androidx.annotation.NonNull; +import java.security.cert.Certificate; +import java.security.cert.CertificateEncodingException; + +/** + * ProxyApi implementation for {@link Certificate}. This class may handle instantiating native + * object instances that are attached to a Dart instance or handle method calls on the associated + * native class or an instance of that class. + */ +class CertificateProxyApi extends PigeonApiCertificate { + CertificateProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) { + super(pigeonRegistrar); + } + + @NonNull + @Override + public byte[] getEncoded(@NonNull Certificate pigeon_instance) { + try { + return pigeon_instance.getEncoded(); + } catch (CertificateEncodingException exception) { + throw new RuntimeException(exception); + } + } +} diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java index c4d8d556746f..671ecf425f41 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/ProxyApiRegistrar.java @@ -232,6 +232,12 @@ public PigeonApiAndroidMessage getPigeonApiAndroidMessage() { return new MessageProxyApi(this); } + @NonNull + @Override + public PigeonApiCertificate getPigeonApiCertificate() { + return new CertificateProxyApi(this); + } + @NonNull public Context getContext() { return context; diff --git a/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/CertificateTest.java b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/CertificateTest.java new file mode 100644 index 000000000000..6be37fe37ff7 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/CertificateTest.java @@ -0,0 +1,26 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package io.flutter.plugins.webviewflutter; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.security.cert.Certificate; +import java.security.cert.CertificateEncodingException; +import org.junit.Test; + +public class CertificateTest { + @Test + public void getEncoded() throws CertificateEncodingException { + final PigeonApiCertificate api = new TestProxyApiRegistrar().getPigeonApiCertificate(); + + final Certificate instance = mock(Certificate.class); + final byte[] value = new byte[] {(byte) 0xA1}; + when(instance.getEncoded()).thenReturn(value); + + assertEquals(value, api.getEncoded(instance)); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/example/android/build.gradle b/packages/webview_flutter/webview_flutter_android/example/android/build.gradle index 7c1eabd81e03..a3e7dce965d2 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/example/android/build.gradle @@ -30,7 +30,8 @@ tasks.register("clean", Delete) { gradle.projectsEvaluated { project(":webview_flutter_android") { tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:all" << "-Werror" + // Ignore classfile due to https://issuetracker.google.com/issues/342067844 + options.compilerArgs << "-Xlint:all" << "-Werror" << "-Xlint:-classfile" } } } diff --git a/packages/webview_flutter/webview_flutter_android/example/lib/main.dart b/packages/webview_flutter/webview_flutter_android/example/lib/main.dart index 490e3d44f7ab..68e94173e059 100644 --- a/packages/webview_flutter/webview_flutter_android/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_android/example/lib/main.dart @@ -201,6 +201,10 @@ Page resource error: }) ..setOnHttpAuthRequest((HttpAuthRequest request) { openDialog(request); + }) + ..setOnSSlAuthError((PlatformSslAuthError error) { + debugPrint('SSL error from ${(error as AndroidSslAuthError).url}'); + error.cancel(); }), ) ..addJavaScriptChannel(JavaScriptChannelParams( diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index de6c69e78064..0fb5a2af64aa 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -33,3 +33,7 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_ssl_auth_error.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_ssl_auth_error.dart new file mode 100644 index 000000000000..fc335cf705b4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_ssl_auth_error.dart @@ -0,0 +1,64 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:meta/meta.dart'; +import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; +import 'android_webkit.g.dart' as android; + +/// Implementation of the [PlatformSslAuthError] with the Android WebView API. +class AndroidSslAuthError extends PlatformSslAuthError { + /// Creates an [AndroidSslAuthError]. + AndroidSslAuthError._({ + required super.certificate, + required super.description, + required android.SslErrorHandler handler, + required this.url, + }) : _handler = handler; + + final android.SslErrorHandler _handler; + + /// The URL associated with the error. + final String url; + + /// Creates an [AndroidSslAuthError] from the parameters from the native + /// `WebViewClient.onReceivedSslError`. + @internal + static Future fromNativeCallback({ + required android.SslError error, + required android.SslErrorHandler handler, + }) async { + final android.SslCertificate certificate = error.certificate; + final android.X509Certificate? x509Certificate = + await certificate.getX509Certificate(); + + final android.SslErrorType errorType = await error.getPrimaryError(); + final String errorDescription = switch (errorType) { + android.SslErrorType.dateInvalid => + 'The date of the certificate is invalid.', + android.SslErrorType.expired => 'The certificate has expired.', + android.SslErrorType.idMismatch => 'Hostname mismatch.', + android.SslErrorType.invalid => 'A generic error occurred.', + android.SslErrorType.notYetValid => 'The certificate is not yet valid.', + android.SslErrorType.untrusted => + 'The certificate authority is not trusted.', + android.SslErrorType.unknown => 'The certificate has an unknown error.', + }; + + return AndroidSslAuthError._( + certificate: X509Certificate( + data: + x509Certificate != null ? await x509Certificate.getEncoded() : null, + ), + handler: handler, + description: errorDescription, + url: error.url, + ); + } + + @override + Future cancel() => _handler.cancel(); + + @override + Future proceed() => _handler.proceed(); +} diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart index c518f0a84329..516fba97f802 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart @@ -194,6 +194,8 @@ class PigeonInstanceManager { pigeon_instanceManager: instanceManager); SslCertificate.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + Certificate.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -7297,7 +7299,7 @@ class PrivateKey extends PigeonInternalProxyApiBaseClass { /// certificate. /// /// See https://developer.android.com/reference/java/security/cert/X509Certificate. -class X509Certificate extends PigeonInternalProxyApiBaseClass { +class X509Certificate extends Certificate { /// Constructs [X509Certificate] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -7306,7 +7308,7 @@ class X509Certificate extends PigeonInternalProxyApiBaseClass { X509Certificate.pigeon_detached({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, - }); + }) : super.pigeon_detached(); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -8118,3 +8120,113 @@ class SslCertificate extends PigeonInternalProxyApiBaseClass { ); } } + +/// Abstract class for managing a variety of identity certificates. +/// +/// See https://developer.android.com/reference/java/security/cert/Certificate. +class Certificate extends PigeonInternalProxyApiBaseClass { + /// Constructs [Certificate] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + Certificate.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecCertificate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + Certificate Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_android.Certificate.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.Certificate.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.webview_flutter_android.Certificate.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + Certificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// The encoded form of this certificate. + Future getEncoded() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecCertificate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_android.Certificate.getEncoded'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Uint8List?)!; + } + } + + @override + Certificate pigeon_copy() { + return Certificate.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index c8326529e591..2f93158b72a1 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -12,6 +12,7 @@ import 'package:flutter/services.dart'; import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; import 'android_proxy.dart'; +import 'android_ssl_auth_error.dart'; import 'android_webkit.g.dart' as android_webview; import 'android_webkit_constants.dart'; import 'platform_views_service_proxy.dart'; @@ -1483,9 +1484,22 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { _, __, android_webview.SslErrorHandler handler, - ___, - ) { - handler.cancel(); + android_webview.SslError error, + ) async { + final void Function(PlatformSslAuthError)? callback = + weakThis.target?._onSslAuthError; + + if (callback != null) { + final AndroidSslAuthError authError = + await AndroidSslAuthError.fromNativeCallback( + error: error, + handler: handler, + ); + + callback(authError); + } else { + await handler.cancel(); + } }, ); @@ -1549,6 +1563,7 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { LoadRequestCallback? _onLoadRequest; UrlChangeCallback? _onUrlChange; HttpAuthRequestCallback? _onHttpAuthRequest; + SslAuthErrorCallback? _onSslAuthError; void _handleNavigation( String url, { @@ -1653,4 +1668,9 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { ) async { _onHttpAuthRequest = onHttpAuthRequest; } + + @override + Future setOnSSlAuthError(SslAuthErrorCallback onSslAuthError) async { + _onSslAuthError = onSslAuthError; + } } diff --git a/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart b/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart index a9297fa43cb1..6c3a3e4248f9 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +export 'src/android_ssl_auth_error.dart'; export 'src/android_webview_controller.dart'; export 'src/android_webview_cookie_manager.dart'; export 'src/android_webview_platform.dart'; diff --git a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart index 42a15fc68bde..30bee0f9f76a 100644 --- a/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart +++ b/packages/webview_flutter/webview_flutter_android/pigeons/android_webkit.dart @@ -951,7 +951,7 @@ abstract class PrivateKey {} fullClassName: 'java.security.cert.X509Certificate', ), ) -abstract class X509Certificate {} +abstract class X509Certificate extends Certificate {} /// Represents a request for handling an SSL error. /// @@ -1048,3 +1048,16 @@ abstract class SslCertificate { /// Always returns null on Android versions below Q. X509Certificate? getX509Certificate(); } + +/// Abstract class for managing a variety of identity certificates. +/// +/// See https://developer.android.com/reference/java/security/cert/Certificate. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'java.security.cert.Certificate', + ), +) +abstract class Certificate { + /// The encoded form of this certificate. + Uint8List getEncoded(); +} diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 5f6cb957df85..a55bc9f21b85 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -20,6 +20,7 @@ flutter: dependencies: flutter: sdk: flutter + meta: ^1.10.0 webview_flutter_platform_interface: ^2.11.0 dev_dependencies: @@ -33,3 +34,7 @@ topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart index fef0b9f1e80e..97ed60ae8fa0 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; @@ -19,6 +20,10 @@ import 'android_navigation_delegate_test.mocks.dart'; @GenerateMocks([ android_webview.HttpAuthHandler, android_webview.DownloadListener, + android_webview.SslCertificate, + android_webview.SslError, + android_webview.SslErrorHandler, + android_webview.X509Certificate, ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -624,6 +629,74 @@ void main() { verify(mockAuthHandler.cancel()); }); + + test('setOnSSlAuthError', () async { + final AndroidNavigationDelegate androidNavigationDelegate = + AndroidNavigationDelegate(_buildCreationParams()); + + final Completer errorCompleter = + Completer(); + await androidNavigationDelegate.setOnSSlAuthError( + (PlatformSslAuthError error) { + errorCompleter.complete(error); + }, + ); + + final Uint8List certificateData = Uint8List(0); + const String url = 'https://google.com'; + + final MockSslError mockSslError = MockSslError(); + when(mockSslError.url).thenReturn(url); + when(mockSslError.getPrimaryError()) + .thenAnswer((_) async => android_webview.SslErrorType.dateInvalid); + final MockSslCertificate mockSslCertificate = MockSslCertificate(); + final MockX509Certificate mockX509Certificate = MockX509Certificate(); + when(mockX509Certificate.getEncoded()).thenAnswer( + (_) async => certificateData, + ); + when(mockSslCertificate.getX509Certificate()).thenAnswer( + (_) async => mockX509Certificate, + ); + when(mockSslError.certificate).thenReturn(mockSslCertificate); + + final MockSslErrorHandler mockSslErrorHandler = MockSslErrorHandler(); + + CapturingWebViewClient.lastCreatedDelegate.onReceivedSslError!( + CapturingWebViewClient(), + TestWebView(), + mockSslErrorHandler, + mockSslError, + ); + + final AndroidSslAuthError error = + await errorCompleter.future as AndroidSslAuthError; + expect(error.certificate?.data, certificateData); + expect(error.description, 'The date of the certificate is invalid.'); + expect(error.url, url); + + await error.proceed(); + verify(mockSslErrorHandler.proceed()); + + clearInteractions(mockSslErrorHandler); + + await error.cancel(); + verify(mockSslErrorHandler.cancel()); + }); + + test('setOnSSlAuthError calls cancel by default', () async { + AndroidNavigationDelegate(_buildCreationParams()); + + final MockSslErrorHandler mockSslErrorHandler = MockSslErrorHandler(); + + CapturingWebViewClient.lastCreatedDelegate.onReceivedSslError!( + CapturingWebViewClient(), + TestWebView(), + mockSslErrorHandler, + MockSslError(), + ); + + verify(mockSslErrorHandler.cancel()); + }); }); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index 7d84c4694a10..e72891b02542 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -1,11 +1,13 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_android/test/android_navigation_delegate_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; +import 'dart:typed_data' as _i5; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i4; import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; // ignore_for_file: type=lint @@ -24,20 +26,78 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeHttpAuthHandler_1 extends _i1.SmartFake implements _i2.HttpAuthHandler { - _FakeHttpAuthHandler_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeHttpAuthHandler_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDownloadListener_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSslCertificate_3 extends _i1.SmartFake + implements _i2.SslCertificate { + _FakeSslCertificate_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSslError_4 extends _i1.SmartFake implements _i2.SslError { + _FakeSslError_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeSslErrorHandler_5 extends _i1.SmartFake + implements _i2.SslErrorHandler { + _FakeSslErrorHandler_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeX509Certificate_6 extends _i1.SmartFake + implements _i2.X509Certificate { + _FakeX509Certificate_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [HttpAuthHandler]. @@ -59,31 +119,52 @@ class MockHttpAuthHandler extends _i1.Mock implements _i2.HttpAuthHandler { @override _i3.Future useHttpAuthUsernamePassword() => (super.noSuchMethod( - Invocation.method(#useHttpAuthUsernamePassword, []), + Invocation.method( + #useHttpAuthUsernamePassword, + [], + ), returnValue: _i3.Future.value(false), ) as _i3.Future); @override _i3.Future cancel() => (super.noSuchMethod( - Invocation.method(#cancel, []), + Invocation.method( + #cancel, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future proceed(String? username, String? password) => + _i3.Future proceed( + String? username, + String? password, + ) => (super.noSuchMethod( - Invocation.method(#proceed, [username, password]), + Invocation.method( + #proceed, + [ + username, + password, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.HttpAuthHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeHttpAuthHandler_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.HttpAuthHandler); } @@ -97,25 +178,31 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); + void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) get onDownloadStart => (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -128,10 +215,259 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeDownloadListener_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.DownloadListener); } + +/// A class which mocks [SslCertificate]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSslCertificate extends _i1.Mock implements _i2.SslCertificate { + MockSslCertificate() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future<_i2.SslCertificateDName?> getIssuedBy() => (super.noSuchMethod( + Invocation.method( + #getIssuedBy, + [], + ), + returnValue: _i3.Future<_i2.SslCertificateDName?>.value(), + ) as _i3.Future<_i2.SslCertificateDName?>); + + @override + _i3.Future<_i2.SslCertificateDName?> getIssuedTo() => (super.noSuchMethod( + Invocation.method( + #getIssuedTo, + [], + ), + returnValue: _i3.Future<_i2.SslCertificateDName?>.value(), + ) as _i3.Future<_i2.SslCertificateDName?>); + + @override + _i3.Future getValidNotAfterMsSinceEpoch() => (super.noSuchMethod( + Invocation.method( + #getValidNotAfterMsSinceEpoch, + [], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future getValidNotBeforeMsSinceEpoch() => (super.noSuchMethod( + Invocation.method( + #getValidNotBeforeMsSinceEpoch, + [], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future<_i2.X509Certificate?> getX509Certificate() => (super.noSuchMethod( + Invocation.method( + #getX509Certificate, + [], + ), + returnValue: _i3.Future<_i2.X509Certificate?>.value(), + ) as _i3.Future<_i2.X509Certificate?>); + + @override + _i2.SslCertificate pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeSslCertificate_3( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.SslCertificate); +} + +/// A class which mocks [SslError]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSslError extends _i1.Mock implements _i2.SslError { + MockSslError() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.SslCertificate get certificate => (super.noSuchMethod( + Invocation.getter(#certificate), + returnValue: _FakeSslCertificate_3( + this, + Invocation.getter(#certificate), + ), + ) as _i2.SslCertificate); + + @override + String get url => (super.noSuchMethod( + Invocation.getter(#url), + returnValue: _i4.dummyValue( + this, + Invocation.getter(#url), + ), + ) as String); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future<_i2.SslErrorType> getPrimaryError() => (super.noSuchMethod( + Invocation.method( + #getPrimaryError, + [], + ), + returnValue: + _i3.Future<_i2.SslErrorType>.value(_i2.SslErrorType.dateInvalid), + ) as _i3.Future<_i2.SslErrorType>); + + @override + _i3.Future hasError(_i2.SslErrorType? error) => (super.noSuchMethod( + Invocation.method( + #hasError, + [error], + ), + returnValue: _i3.Future.value(false), + ) as _i3.Future); + + @override + _i2.SslError pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeSslError_4( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.SslError); +} + +/// A class which mocks [SslErrorHandler]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockSslErrorHandler extends _i1.Mock implements _i2.SslErrorHandler { + MockSslErrorHandler() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future cancel() => (super.noSuchMethod( + Invocation.method( + #cancel, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future proceed() => (super.noSuchMethod( + Invocation.method( + #proceed, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i2.SslErrorHandler pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeSslErrorHandler_5( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.SslErrorHandler); +} + +/// A class which mocks [X509Certificate]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockX509Certificate extends _i1.Mock implements _i2.X509Certificate { + MockX509Certificate() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i2.X509Certificate pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeX509Certificate_6( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.X509Certificate); + + @override + _i3.Future<_i5.Uint8List> getEncoded() => (super.noSuchMethod( + Invocation.method( + #getEncoded, + [], + ), + returnValue: _i3.Future<_i5.Uint8List>.value(_i5.Uint8List(0)), + ) as _i3.Future<_i5.Uint8List>); +} diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index 102470066572..e9a213740eff 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_android/test/android_webview_controller_test.dart. // Do not manually edit this file. @@ -37,19 +37,34 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakeWebChromeClient_0 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebChromeClient_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebViewClient_1 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebViewClient_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeDownloadListener_2 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDownloadListener_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake @@ -57,7 +72,10 @@ class _FakePlatformNavigationDelegateCreationParams_3 extends _i1.SmartFake _FakePlatformNavigationDelegateCreationParams_3( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake @@ -65,67 +83,125 @@ class _FakePlatformWebViewControllerCreationParams_4 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_4( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakeObject_5 extends _i1.SmartFake implements Object { - _FakeObject_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeObject_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeOffset_6 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeOffset_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebView_7 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebView_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeJavaScriptChannel_8 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeJavaScriptChannel_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeCookieManager_9 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeCookieManager_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeFlutterAssetManager_10 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeFlutterAssetManager_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebStorage_11 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebStorage_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePigeonInstanceManager_12 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePlatformViewsServiceProxy_13 extends _i1.SmartFake implements _i5.PlatformViewsServiceProxy { - _FakePlatformViewsServiceProxy_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePlatformViewsServiceProxy_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePlatformWebViewController_14 extends _i1.SmartFake implements _i3.PlatformWebViewController { - _FakePlatformWebViewController_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePlatformWebViewController_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeSize_15 extends _i1.SmartFake implements _i4.Size { - _FakeSize_15(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeSize_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake @@ -133,13 +209,21 @@ class _FakeGeolocationPermissionsCallback_16 extends _i1.SmartFake _FakeGeolocationPermissionsCallback_16( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakePermissionRequest_17 extends _i1.SmartFake implements _i2.PermissionRequest { - _FakePermissionRequest_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePermissionRequest_17( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake @@ -147,7 +231,10 @@ class _FakeExpensiveAndroidViewController_18 extends _i1.SmartFake _FakeExpensiveAndroidViewController_18( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake @@ -155,17 +242,30 @@ class _FakeSurfaceAndroidViewController_19 extends _i1.SmartFake _FakeSurfaceAndroidViewController_19( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakeWebSettings_20 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_20(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebSettings_20( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebViewPoint_21 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_21(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebViewPoint_21( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [AndroidNavigationDelegate]. @@ -230,17 +330,22 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnLoadRequest(_i7.LoadRequestCallback? onLoadRequest) => (super.noSuchMethod( - Invocation.method(#setOnLoadRequest, [onLoadRequest]), + Invocation.method( + #setOnLoadRequest, + [onLoadRequest], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnNavigationRequest( - _i3.NavigationRequestCallback? onNavigationRequest, - ) => + _i3.NavigationRequestCallback? onNavigationRequest) => (super.noSuchMethod( - Invocation.method(#setOnNavigationRequest, [onNavigationRequest]), + Invocation.method( + #setOnNavigationRequest, + [onNavigationRequest], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -248,7 +353,10 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( - Invocation.method(#setOnPageStarted, [onPageStarted]), + Invocation.method( + #setOnPageStarted, + [onPageStarted], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -256,7 +364,10 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( - Invocation.method(#setOnPageFinished, [onPageFinished]), + Invocation.method( + #setOnPageFinished, + [onPageFinished], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -264,7 +375,10 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( - Invocation.method(#setOnHttpError, [onHttpError]), + Invocation.method( + #setOnHttpError, + [onHttpError], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -272,17 +386,22 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( - Invocation.method(#setOnProgress, [onProgress]), + Invocation.method( + #setOnProgress, + [onProgress], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnWebResourceError( - _i3.WebResourceErrorCallback? onWebResourceError, - ) => + _i3.WebResourceErrorCallback? onWebResourceError) => (super.noSuchMethod( - Invocation.method(#setOnWebResourceError, [onWebResourceError]), + Invocation.method( + #setOnWebResourceError, + [onWebResourceError], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -290,17 +409,34 @@ class MockAndroidNavigationDelegate extends _i1.Mock @override _i8.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( - Invocation.method(#setOnUrlChange, [onUrlChange]), + Invocation.method( + #setOnUrlChange, + [onUrlChange], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnHttpAuthRequest( - _i3.HttpAuthRequestCallback? onHttpAuthRequest, - ) => + _i3.HttpAuthRequestCallback? onHttpAuthRequest) => (super.noSuchMethod( - Invocation.method(#setOnHttpAuthRequest, [onHttpAuthRequest]), + Invocation.method( + #setOnHttpAuthRequest, + [onHttpAuthRequest], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); + + @override + _i8.Future setOnSSlAuthError( + _i3.SslAuthErrorCallback? onSslAuthError) => + (super.noSuchMethod( + Invocation.method( + #setOnSSlAuthError, + [onSslAuthError], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -334,29 +470,45 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), + Invocation.method( + #setAllowFileAccess, + [allow], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), + Invocation.method( + #loadFile, + [absoluteFilePath], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), + Invocation.method( + #loadFlutterAsset, + [key], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future loadHtmlString(String? html, {String? baseUrl}) => + _i8.Future loadHtmlString( + String? html, { + String? baseUrl, + }) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + Invocation.method( + #loadHtmlString, + [html], + {#baseUrl: baseUrl}, + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -364,80 +516,112 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), + Invocation.method( + #loadRequest, + [params], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), + Invocation.method( + #currentUrl, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), + Invocation.method( + #clearCache, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), + Invocation.method( + #clearLocalStorage, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler, - ) => + _i3.PlatformNavigationDelegate? handler) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), + Invocation.method( + #setPlatformNavigationDelegate, + [handler], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), + Invocation.method( + #runJavaScript, + [javaScript], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -445,27 +629,34 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), + Invocation.method( + #runJavaScriptReturningResult, + [javaScript], ), - returnValueForMissingStub: _i8.Future.value( - _FakeObject_5( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), + returnValue: _i8.Future.value(_FakeObject_5( + this, + Invocation.method( + #runJavaScriptReturningResult, + [javaScript], ), - ), + )), + returnValueForMissingStub: _i8.Future.value(_FakeObject_5( + this, + Invocation.method( + #runJavaScriptReturningResult, + [javaScript], + ), + )), ) as _i8.Future); @override _i8.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams, - ) => + _i3.JavaScriptChannelParams? javaScriptChannelParams) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + Invocation.method( + #addJavaScriptChannel, + [javaScriptChannelParams], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -473,55 +664,96 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), + Invocation.method( + #removeJavaScriptChannel, + [javaScriptChannelName], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), + _i8.Future scrollTo( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollTo, + [ + x, + y, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i8.Future scrollBy( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), - ), - returnValueForMissingStub: _i8.Future<_i4.Offset>.value( - _FakeOffset_6(this, Invocation.method(#getScrollPosition, [])), + Invocation.method( + #getScrollPosition, + [], ), + returnValue: _i8.Future<_i4.Offset>.value(_FakeOffset_6( + this, + Invocation.method( + #getScrollPosition, + [], + ), + )), + returnValueForMissingStub: _i8.Future<_i4.Offset>.value(_FakeOffset_6( + this, + Invocation.method( + #getScrollPosition, + [], + ), + )), ) as _i8.Future<_i4.Offset>); @override _i8.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), + Invocation.method( + #enableZoom, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), + Invocation.method( + #setBackgroundColor, + [color], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -529,26 +761,32 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), + Invocation.method( + #setJavaScriptMode, + [javaScriptMode], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), + Invocation.method( + #setUserAgent, + [userAgent], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange, - ) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), + Invocation.method( + #setOnScrollPositionChange, + [onScrollPositionChange], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -556,51 +794,66 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + Invocation.method( + #setMediaPlaybackRequiresUserGesture, + [require], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), + Invocation.method( + #setTextZoom, + [textZoom], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), + Invocation.method( + #setAllowContentAccess, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), + Invocation.method( + #setGeolocationEnabled, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnShowFileSelector( - _i8.Future> Function(_i7.FileSelectorParams)? - onShowFileSelector, - ) => + _i8.Future> Function(_i7.FileSelectorParams)? + onShowFileSelector) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + Invocation.method( + #setOnShowFileSelector, + [onShowFileSelector], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, - ) => + void Function(_i3.PlatformWebViewPermissionRequest)? + onPermissionRequest) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), + Invocation.method( + #setOnPlatformPermissionRequest, + [onPermissionRequest], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -611,10 +864,14 @@ class MockAndroidWebViewController extends _i1.Mock _i7.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), + Invocation.method( + #setGeolocationPermissionsPromptCallbacks, + [], + { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }, + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -625,66 +882,75 @@ class MockAndroidWebViewController extends _i1.Mock required _i7.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), + Invocation.method( + #setCustomWidgetCallbacks, + [], + { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }, + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, - ) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + Invocation.method( + #setOnConsoleMessage, + [onConsoleMessage], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), + Invocation.method( + #getUserAgent, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptAlertDialog( - _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, - ) => + _i8.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), + Invocation.method( + #setOnJavaScriptAlertDialog, + [onJavaScriptAlertDialog], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptConfirmDialog( - _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, - ) => + _i8.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), + Invocation.method( + #setOnJavaScriptConfirmDialog, + [onJavaScriptConfirmDialog], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setOnJavaScriptTextInputDialog( - _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, - ) => + _i8.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), + Invocation.method( + #setOnJavaScriptTextInputDialog, + [onJavaScriptTextInputDialog], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -692,7 +958,10 @@ class MockAndroidWebViewController extends _i1.Mock @override _i8.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), + Invocation.method( + #setOverScrollMode, + [mode], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -704,31 +973,63 @@ class MockAndroidWebViewController extends _i1.Mock class MockAndroidWebViewProxy extends _i1.Mock implements _i9.AndroidWebViewProxy { @override - _i2.WebView Function({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) get newWebView => (super.noSuchMethod( + _i2.WebView Function( + {void Function( + _i2.WebView, + int, + int, + int, + int, + )? onScrollChanged}) get newWebView => (super.noSuchMethod( Invocation.getter(#newWebView), - returnValue: ({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) => - _FakeWebView_7(this, Invocation.getter(#newWebView)), - returnValueForMissingStub: ({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - }) => - _FakeWebView_7(this, Invocation.getter(#newWebView)), - ) as _i2.WebView Function({ - void Function(_i2.WebView, int, int, int, int)? onScrollChanged, - })); + returnValue: ( + {void Function( + _i2.WebView, + int, + int, + int, + int, + )? onScrollChanged}) => + _FakeWebView_7( + this, + Invocation.getter(#newWebView), + ), + returnValueForMissingStub: ( + {void Function( + _i2.WebView, + int, + int, + int, + int, + )? onScrollChanged}) => + _FakeWebView_7( + this, + Invocation.getter(#newWebView), + ), + ) as _i2.WebView Function( + {void Function( + _i2.WebView, + int, + int, + int, + int, + )? onScrollChanged})); @override _i2.JavaScriptChannel Function({ required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, + required void Function( + _i2.JavaScriptChannel, + String, + ) postMessage, }) get newJavaScriptChannel => (super.noSuchMethod( Invocation.getter(#newJavaScriptChannel), returnValue: ({ required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, + required void Function( + _i2.JavaScriptChannel, + String, + ) postMessage, }) => _FakeJavaScriptChannel_8( this, @@ -736,7 +1037,10 @@ class MockAndroidWebViewProxy extends _i1.Mock ), returnValueForMissingStub: ({ required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, + required void Function( + _i2.JavaScriptChannel, + String, + ) postMessage, }) => _FakeJavaScriptChannel_8( this, @@ -744,27 +1048,58 @@ class MockAndroidWebViewProxy extends _i1.Mock ), ) as _i2.JavaScriptChannel Function({ required String channelName, - required void Function(_i2.JavaScriptChannel, String) postMessage, + required void Function( + _i2.JavaScriptChannel, + String, + ) postMessage, })); @override _i2.WebViewClient Function({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + bool, + )? doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, - void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onLoadResource, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageCommitVisible, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageFinished, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, @@ -778,8 +1113,13 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebResourceRequest, _i2.WebResourceResponse, )? onReceivedHttpError, - void Function(_i2.WebViewClient, _i2.WebView, String, String?, String)? - onReceivedLoginRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + String?, + String, + )? onReceivedLoginRequest, void Function( _i2.WebViewClient, _i2.WebView, @@ -798,27 +1138,57 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.SslErrorHandler, _i2.SslError, )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, - void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + double, + double, + )? onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? urlLoading, }) get newWebViewClient => (super.noSuchMethod( Invocation.getter(#newWebViewClient), returnValue: ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + bool, + )? doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onLoadResource, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageCommitVisible, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageFinished, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, @@ -869,33 +1239,60 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.SslErrorHandler, _i2.SslError, )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + double, + double, + )? onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? urlLoading, }) => _FakeWebViewClient_1( this, Invocation.getter(#newWebViewClient), ), returnValueForMissingStub: ({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + bool, + )? doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onLoadResource, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageCommitVisible, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageFinished, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, @@ -946,40 +1343,72 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.SslErrorHandler, _i2.SslError, )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + double, + double, + )? onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? urlLoading, }) => _FakeWebViewClient_1( this, Invocation.getter(#newWebViewClient), ), ) as _i2.WebViewClient Function({ - void Function(_i2.WebViewClient, _i2.WebView, String, bool)? - doUpdateVisitedHistory, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + bool, + )? doUpdateVisitedHistory, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, String)? onLoadResource, - void Function(_i2.WebViewClient, _i2.WebView, String)? - onPageCommitVisible, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onLoadResource, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageCommitVisible, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageFinished, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageStarted, void Function( _i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest, )? onReceivedClientCertRequest, - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, void Function( _i2.WebViewClient, _i2.WebView, @@ -1018,66 +1447,70 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.SslErrorHandler, _i2.SslError, )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, double, double)? - onScaleChanged, + void Function( + _i2.WebViewClient, + _i2.WebView, + double, + double, + )? onScaleChanged, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, )? requestLoading, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? urlLoading, })); @override - _i2.DownloadListener Function({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - }) get newDownloadListener => (super.noSuchMethod( + _i2.DownloadListener Function( + {required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart}) get newDownloadListener => (super.noSuchMethod( Invocation.getter(#newDownloadListener), - returnValue: ({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - }) => + returnValue: ( + {required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart}) => _FakeDownloadListener_2( this, Invocation.getter(#newDownloadListener), ), - returnValueForMissingStub: ({ - required void Function( + returnValueForMissingStub: ( + {required void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) onDownloadStart}) => + _FakeDownloadListener_2( + this, + Invocation.getter(#newDownloadListener), + ), + ) as _i2.DownloadListener Function( + {required void Function( _i2.DownloadListener, String, String, String, String, int, - ) onDownloadStart, - }) => - _FakeDownloadListener_2( - this, - Invocation.getter(#newDownloadListener), - ), - ) as _i2.DownloadListener Function({ - required void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - ) onDownloadStart, - })); + ) onDownloadStart})); @override _i2.WebChromeClient Function({ @@ -1092,7 +1525,10 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebView, _i2.FileChooserParams, ) onShowFileChooser, - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? onConsoleMessage, + void Function( + _i2.WebChromeClient, + _i2.ConsoleMessage, + )? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, @@ -1100,8 +1536,12 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.GeolocationPermissionsCallback, )? onGeolocationPermissionsShowPrompt, void Function(_i2.WebChromeClient)? onHideCustomView, - _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String)? - onJsAlert, + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )? onJsAlert, _i8.Future Function( _i2.WebChromeClient, _i2.WebView, @@ -1109,16 +1549,27 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, - void Function(_i2.WebChromeClient, _i2.View, _i2.CustomViewCallback)? - onShowCustomView, + void Function( + _i2.WebChromeClient, + _i2.PermissionRequest, + )? onPermissionRequest, + void Function( + _i2.WebChromeClient, + _i2.WebView, + int, + )? onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.View, + _i2.CustomViewCallback, + )? onShowCustomView, }) get newWebChromeClient => (super.noSuchMethod( Invocation.getter(#newWebChromeClient), returnValue: ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, + void Function( + _i2.WebChromeClient, + _i2.ConsoleMessage, + )? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( @@ -1146,10 +1597,15 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.PermissionRequest, + )? onPermissionRequest, + void Function( + _i2.WebChromeClient, + _i2.WebView, + int, + )? onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, @@ -1166,8 +1622,10 @@ class MockAndroidWebViewProxy extends _i1.Mock Invocation.getter(#newWebChromeClient), ), returnValueForMissingStub: ({ - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, + void Function( + _i2.WebChromeClient, + _i2.ConsoleMessage, + )? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( @@ -1195,10 +1653,15 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? - onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.PermissionRequest, + )? onPermissionRequest, + void Function( + _i2.WebChromeClient, + _i2.WebView, + int, + )? onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, @@ -1226,8 +1689,10 @@ class MockAndroidWebViewProxy extends _i1.Mock _i2.WebView, _i2.FileChooserParams, ) onShowFileChooser, - void Function(_i2.WebChromeClient, _i2.ConsoleMessage)? - onConsoleMessage, + void Function( + _i2.WebChromeClient, + _i2.ConsoleMessage, + )? onConsoleMessage, void Function(_i2.WebChromeClient)? onGeolocationPermissionsHidePrompt, void Function( _i2.WebChromeClient, @@ -1248,9 +1713,15 @@ class MockAndroidWebViewProxy extends _i1.Mock String, String, )? onJsPrompt, - void Function(_i2.WebChromeClient, _i2.PermissionRequest)? - onPermissionRequest, - void Function(_i2.WebChromeClient, _i2.WebView, int)? onProgressChanged, + void Function( + _i2.WebChromeClient, + _i2.PermissionRequest, + )? onPermissionRequest, + void Function( + _i2.WebChromeClient, + _i2.WebView, + int, + )? onProgressChanged, void Function( _i2.WebChromeClient, _i2.View, @@ -1406,18 +1877,16 @@ class MockExpensiveAndroidViewController extends _i1.Mock @override _i6.PointTransformer get pointTransformer => (super.noSuchMethod( Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValue: (_i4.Offset position) => _FakeOffset_6( + this, + Invocation.getter(#pointTransformer), + ), + returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( + this, + Invocation.getter(#pointTransformer), + ), ) as _i6.PointTransformer); - @override - set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); - @override bool get isCreated => (super.noSuchMethod( Invocation.getter(#isCreated), @@ -1433,62 +1902,105 @@ class MockExpensiveAndroidViewController extends _i1.Mock returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], ) as List<_i6.PlatformViewCreatedCallback>); + @override + set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( + Invocation.setter( + #pointTransformer, + transformer, + ), + returnValueForMissingStub: null, + ); + @override _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method(#setOffset, [off]), + Invocation.method( + #setOffset, + [off], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future create({_i4.Size? size, _i4.Offset? position}) => + _i8.Future create({ + _i4.Size? size, + _i4.Offset? position, + }) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), + Invocation.method( + #create, + [], + { + #size: size, + #position: position, + }, + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), + Invocation.method( + #setSize, + [size], ), + returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( + this, + Invocation.method( + #setSize, + [size], + ), + )), + returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( + this, + Invocation.method( + #setSize, + [size], + ), + )), ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), + Invocation.method( + #sendMotionEvent, + [event], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener, - ) => + _i6.PlatformViewCreatedCallback? listener) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + Invocation.method( + #addOnPlatformViewCreatedListener, + [listener], + ), returnValueForMissingStub: null, ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener, - ) => + _i6.PlatformViewCreatedCallback? listener) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + Invocation.method( + #removeOnPlatformViewCreatedListener, + [listener], + ), returnValueForMissingStub: null, ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), + Invocation.method( + #setLayoutDirection, + [layoutDirection], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1496,21 +2008,30 @@ class MockExpensiveAndroidViewController extends _i1.Mock @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), + Invocation.method( + #dispatchPointerEvent, + [event], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method(#clearFocus, []), + Invocation.method( + #clearFocus, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future dispose() => (super.noSuchMethod( - Invocation.method(#dispose, []), + Invocation.method( + #dispose, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1536,41 +2057,57 @@ class MockFlutterAssetManager extends _i1.Mock @override _i8.Future> list(String? path) => (super.noSuchMethod( - Invocation.method(#list, [path]), - returnValue: _i8.Future>.value([]), - returnValueForMissingStub: _i8.Future>.value( - [], + Invocation.method( + #list, + [path], ), + returnValue: _i8.Future>.value([]), + returnValueForMissingStub: _i8.Future>.value([]), ) as _i8.Future>); @override _i8.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), + Invocation.method( + #getAssetFilePathByName, + [name], ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), + returnValue: _i8.Future.value(_i12.dummyValue( + this, + Invocation.method( + #getAssetFilePathByName, + [name], ), - ), + )), + returnValueForMissingStub: + _i8.Future.value(_i12.dummyValue( + this, + Invocation.method( + #getAssetFilePathByName, + [name], + ), + )), ) as _i8.Future); @override _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeFlutterAssetManager_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeFlutterAssetManager_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.FlutterAssetManager); } @@ -1594,23 +2131,43 @@ class MockGeolocationPermissionsCallback extends _i1.Mock ) as _i2.PigeonInstanceManager); @override - _i8.Future invoke(String? origin, bool? allow, bool? retain) => + _i8.Future invoke( + String? origin, + bool? allow, + bool? retain, + ) => (super.noSuchMethod( - Invocation.method(#invoke, [origin, allow, retain]), + Invocation.method( + #invoke, + [ + origin, + allow, + retain, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.GeolocationPermissionsCallback pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeGeolocationPermissionsCallback_16( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeGeolocationPermissionsCallback_16( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.GeolocationPermissionsCallback); } @@ -1633,13 +2190,23 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { ) as String); @override - void Function(_i2.JavaScriptChannel, String) get postMessage => - (super.noSuchMethod( + void Function( + _i2.JavaScriptChannel, + String, + ) get postMessage => (super.noSuchMethod( Invocation.getter(#postMessage), - returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, - returnValueForMissingStub: - (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) as void Function(_i2.JavaScriptChannel, String)); + returnValue: ( + _i2.JavaScriptChannel pigeon_instance, + String message, + ) {}, + returnValueForMissingStub: ( + _i2.JavaScriptChannel pigeon_instance, + String message, + ) {}, + ) as void Function( + _i2.JavaScriptChannel, + String, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -1656,14 +2223,23 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeJavaScriptChannel_8( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeJavaScriptChannel_8( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.JavaScriptChannel); } @@ -1694,28 +2270,43 @@ class MockPermissionRequest extends _i1.Mock implements _i2.PermissionRequest { @override _i8.Future grant(List? resources) => (super.noSuchMethod( - Invocation.method(#grant, [resources]), + Invocation.method( + #grant, + [resources], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future deny() => (super.noSuchMethod( - Invocation.method(#deny, []), + Invocation.method( + #deny, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.PermissionRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakePermissionRequest_17( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakePermissionRequest_17( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.PermissionRequest); } @@ -1736,35 +2327,47 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeExpensiveAndroidViewController_18( - this, - Invocation.method(#initExpensiveAndroidView, [], { + Invocation.method( + #initExpensiveAndroidView, + [], + { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }), + }, + ), + returnValue: _FakeExpensiveAndroidViewController_18( + this, + Invocation.method( + #initExpensiveAndroidView, + [], + { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }, + ), ), returnValueForMissingStub: _FakeExpensiveAndroidViewController_18( this, - Invocation.method(#initExpensiveAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), + Invocation.method( + #initExpensiveAndroidView, + [], + { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }, + ), ), ) as _i6.ExpensiveAndroidViewController); @@ -1778,35 +2381,47 @@ class MockPlatformViewsServiceProxy extends _i1.Mock _i4.VoidCallback? onFocus, }) => (super.noSuchMethod( - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), - returnValue: _FakeSurfaceAndroidViewController_19( - this, - Invocation.method(#initSurfaceAndroidView, [], { + Invocation.method( + #initSurfaceAndroidView, + [], + { #id: id, #viewType: viewType, #layoutDirection: layoutDirection, #creationParams: creationParams, #creationParamsCodec: creationParamsCodec, #onFocus: onFocus, - }), + }, + ), + returnValue: _FakeSurfaceAndroidViewController_19( + this, + Invocation.method( + #initSurfaceAndroidView, + [], + { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }, + ), ), returnValueForMissingStub: _FakeSurfaceAndroidViewController_19( this, - Invocation.method(#initSurfaceAndroidView, [], { - #id: id, - #viewType: viewType, - #layoutDirection: layoutDirection, - #creationParams: creationParams, - #creationParamsCodec: creationParamsCodec, - #onFocus: onFocus, - }), + Invocation.method( + #initSurfaceAndroidView, + [], + { + #id: id, + #viewType: viewType, + #layoutDirection: layoutDirection, + #creationParams: creationParams, + #creationParamsCodec: creationParamsCodec, + #onFocus: onFocus, + }, + ), ), ) as _i6.SurfaceAndroidViewController); } @@ -1840,18 +2455,16 @@ class MockSurfaceAndroidViewController extends _i1.Mock @override _i6.PointTransformer get pointTransformer => (super.noSuchMethod( Invocation.getter(#pointTransformer), - returnValue: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), - returnValueForMissingStub: (_i4.Offset position) => - _FakeOffset_6(this, Invocation.getter(#pointTransformer)), + returnValue: (_i4.Offset position) => _FakeOffset_6( + this, + Invocation.getter(#pointTransformer), + ), + returnValueForMissingStub: (_i4.Offset position) => _FakeOffset_6( + this, + Invocation.getter(#pointTransformer), + ), ) as _i6.PointTransformer); - @override - set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( - Invocation.setter(#pointTransformer, transformer), - returnValueForMissingStub: null, - ); - @override bool get isCreated => (super.noSuchMethod( Invocation.getter(#isCreated), @@ -1867,62 +2480,105 @@ class MockSurfaceAndroidViewController extends _i1.Mock returnValueForMissingStub: <_i6.PlatformViewCreatedCallback>[], ) as List<_i6.PlatformViewCreatedCallback>); + @override + set pointTransformer(_i6.PointTransformer? transformer) => super.noSuchMethod( + Invocation.setter( + #pointTransformer, + transformer, + ), + returnValueForMissingStub: null, + ); + @override _i8.Future setOffset(_i4.Offset? off) => (super.noSuchMethod( - Invocation.method(#setOffset, [off]), + Invocation.method( + #setOffset, + [off], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future create({_i4.Size? size, _i4.Offset? position}) => + _i8.Future create({ + _i4.Size? size, + _i4.Offset? position, + }) => (super.noSuchMethod( - Invocation.method(#create, [], {#size: size, #position: position}), + Invocation.method( + #create, + [], + { + #size: size, + #position: position, + }, + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i4.Size> setSize(_i4.Size? size) => (super.noSuchMethod( - Invocation.method(#setSize, [size]), - returnValue: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), - ), - returnValueForMissingStub: _i8.Future<_i4.Size>.value( - _FakeSize_15(this, Invocation.method(#setSize, [size])), + Invocation.method( + #setSize, + [size], ), + returnValue: _i8.Future<_i4.Size>.value(_FakeSize_15( + this, + Invocation.method( + #setSize, + [size], + ), + )), + returnValueForMissingStub: _i8.Future<_i4.Size>.value(_FakeSize_15( + this, + Invocation.method( + #setSize, + [size], + ), + )), ) as _i8.Future<_i4.Size>); @override _i8.Future sendMotionEvent(_i6.AndroidMotionEvent? event) => (super.noSuchMethod( - Invocation.method(#sendMotionEvent, [event]), + Invocation.method( + #sendMotionEvent, + [event], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override void addOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener, - ) => + _i6.PlatformViewCreatedCallback? listener) => super.noSuchMethod( - Invocation.method(#addOnPlatformViewCreatedListener, [listener]), + Invocation.method( + #addOnPlatformViewCreatedListener, + [listener], + ), returnValueForMissingStub: null, ); @override void removeOnPlatformViewCreatedListener( - _i6.PlatformViewCreatedCallback? listener, - ) => + _i6.PlatformViewCreatedCallback? listener) => super.noSuchMethod( - Invocation.method(#removeOnPlatformViewCreatedListener, [listener]), + Invocation.method( + #removeOnPlatformViewCreatedListener, + [listener], + ), returnValueForMissingStub: null, ); @override _i8.Future setLayoutDirection(_i4.TextDirection? layoutDirection) => (super.noSuchMethod( - Invocation.method(#setLayoutDirection, [layoutDirection]), + Invocation.method( + #setLayoutDirection, + [layoutDirection], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1930,21 +2586,30 @@ class MockSurfaceAndroidViewController extends _i1.Mock @override _i8.Future dispatchPointerEvent(_i11.PointerEvent? event) => (super.noSuchMethod( - Invocation.method(#dispatchPointerEvent, [event]), + Invocation.method( + #dispatchPointerEvent, + [event], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearFocus() => (super.noSuchMethod( - Invocation.method(#clearFocus, []), + Invocation.method( + #clearFocus, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future dispose() => (super.noSuchMethod( - Invocation.method(#dispose, []), + Invocation.method( + #dispose, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -1980,29 +2645,33 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @override - _i8.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => (super.noSuchMethod( - Invocation.getter(#onJsConfirm), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i8.Future.value(false), - returnValueForMissingStub: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i8.Future.value(false), - ) as _i8.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )); + _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) get onJsConfirm => (super.noSuchMethod( + Invocation.getter(#onJsConfirm), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + returnValueForMissingStub: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i8.Future.value(false), + ) as _i8.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -2020,9 +2689,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnShowFileChooser, + [value], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2030,9 +2700,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnConsoleMessage, + [value], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2040,7 +2711,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + Invocation.method( + #setSynchronousReturnValueForOnJsAlert, + [value], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2048,9 +2722,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnJsConfirm, + [value], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2058,21 +2733,33 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i8.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + Invocation.method( + #setSynchronousReturnValueForOnJsPrompt, + [value], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebChromeClient_0( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWebChromeClient_0( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebChromeClient); } @@ -2096,7 +2783,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), + Invocation.method( + #setDomStorageEnabled, + [flag], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2104,9 +2794,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), + Invocation.method( + #setJavaScriptCanOpenWindowsAutomatically, + [flag], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2114,14 +2805,20 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), + Invocation.method( + #setSupportMultipleWindows, + [support], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), + Invocation.method( + #setJavaScriptEnabled, + [flag], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2129,7 +2826,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), + Invocation.method( + #setUserAgentString, + [userAgentString], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2137,14 +2837,20 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + Invocation.method( + #setMediaPlaybackRequiresUserGesture, + [require], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), + Invocation.method( + #setSupportZoom, + [support], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2152,87 +2858,126 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i8.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), + Invocation.method( + #setLoadWithOverviewMode, + [overview], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), + Invocation.method( + #setUseWideViewPort, + [use], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), + Invocation.method( + #setDisplayZoomControls, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), + Invocation.method( + #setBuiltInZoomControls, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), + Invocation.method( + #setAllowFileAccess, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), + Invocation.method( + #setAllowContentAccess, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), + Invocation.method( + #setGeolocationEnabled, + [enabled], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), + Invocation.method( + #setTextZoom, + [textZoom], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method(#getUserAgentString, []), - returnValue: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), + Invocation.method( + #getUserAgentString, + [], ), - returnValueForMissingStub: _i8.Future.value( - _i12.dummyValue( - this, - Invocation.method(#getUserAgentString, []), + returnValue: _i8.Future.value(_i12.dummyValue( + this, + Invocation.method( + #getUserAgentString, + [], ), - ), + )), + returnValueForMissingStub: + _i8.Future.value(_i12.dummyValue( + this, + Invocation.method( + #getUserAgentString, + [], + ), + )), ) as _i8.Future); @override _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebSettings_20( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWebSettings_20( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebSettings); } @@ -2269,21 +3014,41 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), + Invocation.method( + #pigeonVar_settings, + [], + ), returnValue: _FakeWebSettings_20( this, - Invocation.method(#pigeonVar_settings, []), + Invocation.method( + #pigeonVar_settings, + [], + ), ), returnValueForMissingStub: _FakeWebSettings_20( this, - Invocation.method(#pigeonVar_settings, []), + Invocation.method( + #pigeonVar_settings, + [], + ), ), ) as _i2.WebSettings); @override - _i8.Future loadData(String? data, String? mimeType, String? encoding) => + _i8.Future loadData( + String? data, + String? mimeType, + String? encoding, + ) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), + Invocation.method( + #loadData, + [ + data, + mimeType, + encoding, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2297,78 +3062,120 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), + Invocation.method( + #loadDataWithBaseUrl, + [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future loadUrl(String? url, Map? headers) => + _i8.Future loadUrl( + String? url, + Map? headers, + ) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), + Invocation.method( + #loadUrl, + [ + url, + headers, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future postUrl(String? url, _i13.Uint8List? data) => + _i8.Future postUrl( + String? url, + _i13.Uint8List? data, + ) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), + Invocation.method( + #postUrl, + [ + url, + data, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i8.Future.value(false), returnValueForMissingStub: _i8.Future.value(false), ) as _i8.Future); @override _i8.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), + Invocation.method( + #clearCache, + [includeDiskFiles], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2376,14 +3183,20 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascriptString]), + Invocation.method( + #evaluateJavascript, + [javascriptString], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2391,7 +3204,10 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), + Invocation.method( + #setWebViewClient, + [client], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2399,14 +3215,20 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), + Invocation.method( + #addJavaScriptChannel, + [channel], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), + Invocation.method( + #removeJavaScriptChannel, + [name], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2414,7 +3236,10 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), + Invocation.method( + #setDownloadListener, + [listener], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2422,73 +3247,120 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i8.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), + Invocation.method( + #setWebChromeClient, + [client], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), + Invocation.method( + #setBackgroundColor, + [color], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future destroy() => (super.noSuchMethod( - Invocation.method(#destroy, []), + Invocation.method( + #destroy, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebView_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWebView_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebView); @override - _i8.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), + _i8.Future scrollTo( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollTo, + [ + x, + y, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override - _i8.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i8.Future scrollBy( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i8.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), - ), + Invocation.method( + #getScrollPosition, + [], ), - returnValueForMissingStub: _i8.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_21( - this, - Invocation.method(#getScrollPosition, []), + returnValue: _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( + this, + Invocation.method( + #getScrollPosition, + [], ), - ), + )), + returnValueForMissingStub: + _i8.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_21( + this, + Invocation.method( + #getScrollPosition, + [], + ), + )), ) as _i8.Future<_i2.WebViewPoint>); @override _i8.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), + Invocation.method( + #setOverScrollMode, + [mode], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @@ -2513,8 +3385,7 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i8.Future setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value, - ) => + bool? value) => (super.noSuchMethod( Invocation.method( #setSynchronousReturnValueForShouldOverrideUrlLoading, @@ -2526,14 +3397,23 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebViewClient_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWebViewClient_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebViewClient); } @@ -2557,21 +3437,33 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override _i8.Future deleteAllData() => (super.noSuchMethod( - Invocation.method(#deleteAllData, []), + Invocation.method( + #deleteAllData, + [], + ), returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); @override _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebStorage_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWebStorage_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebStorage); } diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index b44e59a8c08d..0fd5fdc4bea7 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_android/test/android_webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -29,13 +29,23 @@ import 'package:webview_flutter_platform_interface/webview_flutter_platform_inte class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeCookieManager_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake @@ -43,17 +53,30 @@ class _FakePlatformWebViewControllerCreationParams_2 extends _i1.SmartFake _FakePlatformWebViewControllerCreationParams_2( Object parent, Invocation parentInvocation, - ) : super(parent, parentInvocation); + ) : super( + parent, + parentInvocation, + ); } class _FakeObject_3 extends _i1.SmartFake implements Object { - _FakeObject_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeObject_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeOffset_4 extends _i1.SmartFake implements _i4.Offset { - _FakeOffset_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeOffset_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [CookieManager]. @@ -74,15 +97,28 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { ) as _i2.PigeonInstanceManager); @override - _i5.Future setCookie(String? url, String? value) => (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), + _i5.Future setCookie( + String? url, + String? value, + ) => + (super.noSuchMethod( + Invocation.method( + #setCookie, + [ + url, + value, + ], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), + Invocation.method( + #removeAllCookies, + [], + ), returnValue: _i5.Future.value(false), ) as _i5.Future); @@ -92,17 +128,29 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + Invocation.method( + #setAcceptThirdPartyCookies, + [ + webView, + accept, + ], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeCookieManager_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.CookieManager); } @@ -117,9 +165,10 @@ class MockAndroidWebViewController extends _i1.Mock } @override - int get webViewIdentifier => - (super.noSuchMethod(Invocation.getter(#webViewIdentifier), returnValue: 0) - as int); + int get webViewIdentifier => (super.noSuchMethod( + Invocation.getter(#webViewIdentifier), + returnValue: 0, + ) as int); @override _i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod( @@ -132,29 +181,45 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setAllowFileAccess(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [allow]), + Invocation.method( + #setAllowFileAccess, + [allow], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future loadFile(String? absoluteFilePath) => (super.noSuchMethod( - Invocation.method(#loadFile, [absoluteFilePath]), + Invocation.method( + #loadFile, + [absoluteFilePath], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), + Invocation.method( + #loadFlutterAsset, + [key], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future loadHtmlString(String? html, {String? baseUrl}) => + _i5.Future loadHtmlString( + String? html, { + String? baseUrl, + }) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [html], {#baseUrl: baseUrl}), + Invocation.method( + #loadHtmlString, + [html], + {#baseUrl: baseUrl}, + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -162,77 +227,109 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future loadRequest(_i3.LoadRequestParams? params) => (super.noSuchMethod( - Invocation.method(#loadRequest, [params]), + Invocation.method( + #loadRequest, + [params], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future currentUrl() => (super.noSuchMethod( - Invocation.method(#currentUrl, []), + Invocation.method( + #currentUrl, + [], + ), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i5.Future.value(false), ) as _i5.Future); @override _i5.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearCache() => (super.noSuchMethod( - Invocation.method(#clearCache, []), + Invocation.method( + #clearCache, + [], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future clearLocalStorage() => (super.noSuchMethod( - Invocation.method(#clearLocalStorage, []), + Invocation.method( + #clearLocalStorage, + [], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setPlatformNavigationDelegate( - _i3.PlatformNavigationDelegate? handler, - ) => + _i3.PlatformNavigationDelegate? handler) => (super.noSuchMethod( - Invocation.method(#setPlatformNavigationDelegate, [handler]), + Invocation.method( + #setPlatformNavigationDelegate, + [handler], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future runJavaScript(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScript, [javaScript]), + Invocation.method( + #runJavaScript, + [javaScript], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -240,21 +337,27 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future runJavaScriptReturningResult(String? javaScript) => (super.noSuchMethod( - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - returnValue: _i5.Future.value( - _FakeObject_3( - this, - Invocation.method(#runJavaScriptReturningResult, [javaScript]), - ), + Invocation.method( + #runJavaScriptReturningResult, + [javaScript], ), + returnValue: _i5.Future.value(_FakeObject_3( + this, + Invocation.method( + #runJavaScriptReturningResult, + [javaScript], + ), + )), ) as _i5.Future); @override _i5.Future addJavaScriptChannel( - _i3.JavaScriptChannelParams? javaScriptChannelParams, - ) => + _i3.JavaScriptChannelParams? javaScriptChannelParams) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [javaScriptChannelParams]), + Invocation.method( + #addJavaScriptChannel, + [javaScriptChannelParams], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -262,51 +365,88 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future removeJavaScriptChannel(String? javaScriptChannelName) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [ - javaScriptChannelName, - ]), + Invocation.method( + #removeJavaScriptChannel, + [javaScriptChannelName], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), + _i5.Future scrollTo( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollTo, + [ + x, + y, + ], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i5.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i5.Future scrollBy( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future<_i4.Offset> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i5.Future<_i4.Offset>.value( - _FakeOffset_4(this, Invocation.method(#getScrollPosition, [])), + Invocation.method( + #getScrollPosition, + [], ), + returnValue: _i5.Future<_i4.Offset>.value(_FakeOffset_4( + this, + Invocation.method( + #getScrollPosition, + [], + ), + )), ) as _i5.Future<_i4.Offset>); @override _i5.Future enableZoom(bool? enabled) => (super.noSuchMethod( - Invocation.method(#enableZoom, [enabled]), + Invocation.method( + #enableZoom, + [enabled], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setBackgroundColor(_i4.Color? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), + Invocation.method( + #setBackgroundColor, + [color], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -314,26 +454,32 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setJavaScriptMode(_i3.JavaScriptMode? javaScriptMode) => (super.noSuchMethod( - Invocation.method(#setJavaScriptMode, [javaScriptMode]), + Invocation.method( + #setJavaScriptMode, + [javaScriptMode], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setUserAgent, [userAgent]), + Invocation.method( + #setUserAgent, + [userAgent], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnScrollPositionChange( - void Function(_i3.ScrollPositionChange)? onScrollPositionChange, - ) => + void Function(_i3.ScrollPositionChange)? onScrollPositionChange) => (super.noSuchMethod( - Invocation.method(#setOnScrollPositionChange, [ - onScrollPositionChange, - ]), + Invocation.method( + #setOnScrollPositionChange, + [onScrollPositionChange], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -341,51 +487,66 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + Invocation.method( + #setMediaPlaybackRequiresUserGesture, + [require], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), + Invocation.method( + #setTextZoom, + [textZoom], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), + Invocation.method( + #setAllowContentAccess, + [enabled], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), + Invocation.method( + #setGeolocationEnabled, + [enabled], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnShowFileSelector( - _i5.Future> Function(_i6.FileSelectorParams)? - onShowFileSelector, - ) => + _i5.Future> Function(_i6.FileSelectorParams)? + onShowFileSelector) => (super.noSuchMethod( - Invocation.method(#setOnShowFileSelector, [onShowFileSelector]), + Invocation.method( + #setOnShowFileSelector, + [onShowFileSelector], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnPlatformPermissionRequest( - void Function(_i3.PlatformWebViewPermissionRequest)? onPermissionRequest, - ) => + void Function(_i3.PlatformWebViewPermissionRequest)? + onPermissionRequest) => (super.noSuchMethod( - Invocation.method(#setOnPlatformPermissionRequest, [ - onPermissionRequest, - ]), + Invocation.method( + #setOnPlatformPermissionRequest, + [onPermissionRequest], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -396,10 +557,14 @@ class MockAndroidWebViewController extends _i1.Mock _i6.OnGeolocationPermissionsHidePrompt? onHidePrompt, }) => (super.noSuchMethod( - Invocation.method(#setGeolocationPermissionsPromptCallbacks, [], { - #onShowPrompt: onShowPrompt, - #onHidePrompt: onHidePrompt, - }), + Invocation.method( + #setGeolocationPermissionsPromptCallbacks, + [], + { + #onShowPrompt: onShowPrompt, + #onHidePrompt: onHidePrompt, + }, + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -410,65 +575,74 @@ class MockAndroidWebViewController extends _i1.Mock required _i6.OnHideCustomWidgetCallback? onHideCustomWidget, }) => (super.noSuchMethod( - Invocation.method(#setCustomWidgetCallbacks, [], { - #onShowCustomWidget: onShowCustomWidget, - #onHideCustomWidget: onHideCustomWidget, - }), + Invocation.method( + #setCustomWidgetCallbacks, + [], + { + #onShowCustomWidget: onShowCustomWidget, + #onHideCustomWidget: onHideCustomWidget, + }, + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnConsoleMessage( - void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage, - ) => + void Function(_i3.JavaScriptConsoleMessage)? onConsoleMessage) => (super.noSuchMethod( - Invocation.method(#setOnConsoleMessage, [onConsoleMessage]), + Invocation.method( + #setOnConsoleMessage, + [onConsoleMessage], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future getUserAgent() => (super.noSuchMethod( - Invocation.method(#getUserAgent, []), + Invocation.method( + #getUserAgent, + [], + ), returnValue: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptAlertDialog( - _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? - onJavaScriptAlertDialog, - ) => + _i5.Future Function(_i3.JavaScriptAlertDialogRequest)? + onJavaScriptAlertDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptAlertDialog, [ - onJavaScriptAlertDialog, - ]), + Invocation.method( + #setOnJavaScriptAlertDialog, + [onJavaScriptAlertDialog], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptConfirmDialog( - _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? - onJavaScriptConfirmDialog, - ) => + _i5.Future Function(_i3.JavaScriptConfirmDialogRequest)? + onJavaScriptConfirmDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptConfirmDialog, [ - onJavaScriptConfirmDialog, - ]), + Invocation.method( + #setOnJavaScriptConfirmDialog, + [onJavaScriptConfirmDialog], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override _i5.Future setOnJavaScriptTextInputDialog( - _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? - onJavaScriptTextInputDialog, - ) => + _i5.Future Function(_i3.JavaScriptTextInputDialogRequest)? + onJavaScriptTextInputDialog) => (super.noSuchMethod( - Invocation.method(#setOnJavaScriptTextInputDialog, [ - onJavaScriptTextInputDialog, - ]), + Invocation.method( + #setOnJavaScriptTextInputDialog, + [onJavaScriptTextInputDialog], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @@ -476,7 +650,10 @@ class MockAndroidWebViewController extends _i1.Mock @override _i5.Future setOverScrollMode(_i3.WebViewOverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), + Invocation.method( + #setOverScrollMode, + [mode], + ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index 68d1d82b29c6..3e523c6bf426 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_android/test/legacy/webview_android_cookie_manager_test.dart. // Do not manually edit this file. @@ -24,13 +24,23 @@ import 'package:webview_flutter_android/src/android_webkit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeCookieManager_1 extends _i1.SmartFake implements _i2.CookieManager { - _FakeCookieManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeCookieManager_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [CookieManager]. @@ -51,15 +61,28 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { ) as _i2.PigeonInstanceManager); @override - _i3.Future setCookie(String? url, String? value) => (super.noSuchMethod( - Invocation.method(#setCookie, [url, value]), + _i3.Future setCookie( + String? url, + String? value, + ) => + (super.noSuchMethod( + Invocation.method( + #setCookie, + [ + url, + value, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future removeAllCookies() => (super.noSuchMethod( - Invocation.method(#removeAllCookies, []), + Invocation.method( + #removeAllCookies, + [], + ), returnValue: _i3.Future.value(false), ) as _i3.Future); @@ -69,17 +92,29 @@ class MockCookieManager extends _i1.Mock implements _i2.CookieManager { bool? accept, ) => (super.noSuchMethod( - Invocation.method(#setAcceptThirdPartyCookies, [webView, accept]), + Invocation.method( + #setAcceptThirdPartyCookies, + [ + webView, + accept, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.CookieManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeCookieManager_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.CookieManager); } diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index 6eebf3a56d85..374fb136d376 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_android/test/legacy/webview_android_widget_test.dart. // Do not manually edit this file. @@ -30,69 +30,129 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeFlutterAssetManager_1 extends _i1.SmartFake implements _i2.FlutterAssetManager { - _FakeFlutterAssetManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeFlutterAssetManager_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebSettings_2 extends _i1.SmartFake implements _i2.WebSettings { - _FakeWebSettings_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebSettings_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebStorage_3 extends _i1.SmartFake implements _i2.WebStorage { - _FakeWebStorage_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebStorage_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebView_4 extends _i1.SmartFake implements _i2.WebView { - _FakeWebView_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebView_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebViewPoint_5 extends _i1.SmartFake implements _i2.WebViewPoint { - _FakeWebViewPoint_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebViewPoint_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebResourceRequest_6 extends _i1.SmartFake implements _i2.WebResourceRequest { - _FakeWebResourceRequest_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebResourceRequest_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeDownloadListener_7 extends _i1.SmartFake implements _i2.DownloadListener { - _FakeDownloadListener_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeDownloadListener_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeJavascriptChannelRegistry_8 extends _i1.SmartFake implements _i3.JavascriptChannelRegistry { - _FakeJavascriptChannelRegistry_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeJavascriptChannelRegistry_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeJavaScriptChannel_9 extends _i1.SmartFake implements _i2.JavaScriptChannel { - _FakeJavaScriptChannel_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeJavaScriptChannel_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebChromeClient_10 extends _i1.SmartFake implements _i2.WebChromeClient { - _FakeWebChromeClient_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebChromeClient_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWebViewClient_11 extends _i1.SmartFake implements _i2.WebViewClient { - _FakeWebViewClient_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWebViewClient_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [FlutterAssetManager]. @@ -115,28 +175,41 @@ class MockFlutterAssetManager extends _i1.Mock @override _i4.Future> list(String? path) => (super.noSuchMethod( - Invocation.method(#list, [path]), + Invocation.method( + #list, + [path], + ), returnValue: _i4.Future>.value([]), ) as _i4.Future>); @override _i4.Future getAssetFilePathByName(String? name) => (super.noSuchMethod( - Invocation.method(#getAssetFilePathByName, [name]), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getAssetFilePathByName, [name]), - ), + Invocation.method( + #getAssetFilePathByName, + [name], ), + returnValue: _i4.Future.value(_i5.dummyValue( + this, + Invocation.method( + #getAssetFilePathByName, + [name], + ), + )), ) as _i4.Future); @override _i2.FlutterAssetManager pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeFlutterAssetManager_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.FlutterAssetManager); } @@ -160,7 +233,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setDomStorageEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setDomStorageEnabled, [flag]), + Invocation.method( + #setDomStorageEnabled, + [flag], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -168,9 +244,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setJavaScriptCanOpenWindowsAutomatically(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptCanOpenWindowsAutomatically, [ - flag, - ]), + Invocation.method( + #setJavaScriptCanOpenWindowsAutomatically, + [flag], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -178,14 +255,20 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setSupportMultipleWindows(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportMultipleWindows, [support]), + Invocation.method( + #setSupportMultipleWindows, + [support], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setJavaScriptEnabled(bool? flag) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [flag]), + Invocation.method( + #setJavaScriptEnabled, + [flag], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -193,7 +276,10 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setUserAgentString(String? userAgentString) => (super.noSuchMethod( - Invocation.method(#setUserAgentString, [userAgentString]), + Invocation.method( + #setUserAgentString, + [userAgentString], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -201,14 +287,20 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setMediaPlaybackRequiresUserGesture(bool? require) => (super.noSuchMethod( - Invocation.method(#setMediaPlaybackRequiresUserGesture, [require]), + Invocation.method( + #setMediaPlaybackRequiresUserGesture, + [require], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setSupportZoom(bool? support) => (super.noSuchMethod( - Invocation.method(#setSupportZoom, [support]), + Invocation.method( + #setSupportZoom, + [support], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -216,77 +308,111 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { @override _i4.Future setLoadWithOverviewMode(bool? overview) => (super.noSuchMethod( - Invocation.method(#setLoadWithOverviewMode, [overview]), + Invocation.method( + #setLoadWithOverviewMode, + [overview], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setUseWideViewPort(bool? use) => (super.noSuchMethod( - Invocation.method(#setUseWideViewPort, [use]), + Invocation.method( + #setUseWideViewPort, + [use], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setDisplayZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setDisplayZoomControls, [enabled]), + Invocation.method( + #setDisplayZoomControls, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setBuiltInZoomControls, [enabled]), + Invocation.method( + #setBuiltInZoomControls, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowFileAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowFileAccess, [enabled]), + Invocation.method( + #setAllowFileAccess, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowContentAccess(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setAllowContentAccess, [enabled]), + Invocation.method( + #setAllowContentAccess, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setGeolocationEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setGeolocationEnabled, [enabled]), + Invocation.method( + #setGeolocationEnabled, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setTextZoom(int? textZoom) => (super.noSuchMethod( - Invocation.method(#setTextZoom, [textZoom]), + Invocation.method( + #setTextZoom, + [textZoom], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getUserAgentString() => (super.noSuchMethod( - Invocation.method(#getUserAgentString, []), - returnValue: _i4.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getUserAgentString, []), - ), + Invocation.method( + #getUserAgentString, + [], ), + returnValue: _i4.Future.value(_i5.dummyValue( + this, + Invocation.method( + #getUserAgentString, + [], + ), + )), ) as _i4.Future); @override _i2.WebSettings pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebSettings_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebSettings); } @@ -310,17 +436,26 @@ class MockWebStorage extends _i1.Mock implements _i2.WebStorage { @override _i4.Future deleteAllData() => (super.noSuchMethod( - Invocation.method(#deleteAllData, []), + Invocation.method( + #deleteAllData, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebStorage pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebStorage_3( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebStorage); } @@ -336,7 +471,10 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings get settings => (super.noSuchMethod( Invocation.getter(#settings), - returnValue: _FakeWebSettings_2(this, Invocation.getter(#settings)), + returnValue: _FakeWebSettings_2( + this, + Invocation.getter(#settings), + ), ) as _i2.WebSettings); @override @@ -350,17 +488,34 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i2.WebSettings pigeonVar_settings() => (super.noSuchMethod( - Invocation.method(#pigeonVar_settings, []), + Invocation.method( + #pigeonVar_settings, + [], + ), returnValue: _FakeWebSettings_2( this, - Invocation.method(#pigeonVar_settings, []), + Invocation.method( + #pigeonVar_settings, + [], + ), ), ) as _i2.WebSettings); @override - _i4.Future loadData(String? data, String? mimeType, String? encoding) => + _i4.Future loadData( + String? data, + String? mimeType, + String? encoding, + ) => (super.noSuchMethod( - Invocation.method(#loadData, [data, mimeType, encoding]), + Invocation.method( + #loadData, + [ + data, + mimeType, + encoding, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -374,75 +529,117 @@ class MockWebView extends _i1.Mock implements _i2.WebView { String? historyUrl, ) => (super.noSuchMethod( - Invocation.method(#loadDataWithBaseUrl, [ - baseUrl, - data, - mimeType, - encoding, - historyUrl, - ]), + Invocation.method( + #loadDataWithBaseUrl, + [ + baseUrl, + data, + mimeType, + encoding, + historyUrl, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future loadUrl(String? url, Map? headers) => + _i4.Future loadUrl( + String? url, + Map? headers, + ) => (super.noSuchMethod( - Invocation.method(#loadUrl, [url, headers]), + Invocation.method( + #loadUrl, + [ + url, + headers, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future postUrl(String? url, _i6.Uint8List? data) => + _i4.Future postUrl( + String? url, + _i6.Uint8List? data, + ) => (super.noSuchMethod( - Invocation.method(#postUrl, [url, data]), + Invocation.method( + #postUrl, + [ + url, + data, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future clearCache(bool? includeDiskFiles) => (super.noSuchMethod( - Invocation.method(#clearCache, [includeDiskFiles]), + Invocation.method( + #clearCache, + [includeDiskFiles], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -450,20 +647,29 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future evaluateJavascript(String? javascriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavascript, [javascriptString]), + Invocation.method( + #evaluateJavascript, + [javascriptString], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setWebViewClient(_i2.WebViewClient? client) => (super.noSuchMethod( - Invocation.method(#setWebViewClient, [client]), + Invocation.method( + #setWebViewClient, + [client], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -471,14 +677,20 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future addJavaScriptChannel(_i2.JavaScriptChannel? channel) => (super.noSuchMethod( - Invocation.method(#addJavaScriptChannel, [channel]), + Invocation.method( + #addJavaScriptChannel, + [channel], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future removeJavaScriptChannel(String? name) => (super.noSuchMethod( - Invocation.method(#removeJavaScriptChannel, [name]), + Invocation.method( + #removeJavaScriptChannel, + [name], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -486,7 +698,10 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future setDownloadListener(_i2.DownloadListener? listener) => (super.noSuchMethod( - Invocation.method(#setDownloadListener, [listener]), + Invocation.method( + #setDownloadListener, + [listener], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -494,63 +709,105 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i4.Future setWebChromeClient(_i2.WebChromeClient? client) => (super.noSuchMethod( - Invocation.method(#setWebChromeClient, [client]), + Invocation.method( + #setWebChromeClient, + [client], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBackgroundColor(int? color) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [color]), + Invocation.method( + #setBackgroundColor, + [color], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future destroy() => (super.noSuchMethod( - Invocation.method(#destroy, []), + Invocation.method( + #destroy, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebView_4( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebView); @override - _i4.Future scrollTo(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollTo, [x, y]), + _i4.Future scrollTo( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollTo, + [ + x, + y, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future scrollBy(int? x, int? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i4.Future scrollBy( + int? x, + int? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future<_i2.WebViewPoint> getScrollPosition() => (super.noSuchMethod( - Invocation.method(#getScrollPosition, []), - returnValue: _i4.Future<_i2.WebViewPoint>.value( - _FakeWebViewPoint_5( - this, - Invocation.method(#getScrollPosition, []), - ), + Invocation.method( + #getScrollPosition, + [], ), + returnValue: _i4.Future<_i2.WebViewPoint>.value(_FakeWebViewPoint_5( + this, + Invocation.method( + #getScrollPosition, + [], + ), + )), ) as _i4.Future<_i2.WebViewPoint>); @override _i4.Future setOverScrollMode(_i2.OverScrollMode? mode) => (super.noSuchMethod( - Invocation.method(#setOverScrollMode, [mode]), + Invocation.method( + #setOverScrollMode, + [mode], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -568,7 +825,10 @@ class MockWebResourceRequest extends _i1.Mock @override String get url => (super.noSuchMethod( Invocation.getter(#url), - returnValue: _i5.dummyValue(this, Invocation.getter(#url)), + returnValue: _i5.dummyValue( + this, + Invocation.getter(#url), + ), ) as String); @override @@ -578,9 +838,10 @@ class MockWebResourceRequest extends _i1.Mock ) as bool); @override - bool get hasGesture => - (super.noSuchMethod(Invocation.getter(#hasGesture), returnValue: false) - as bool); + bool get hasGesture => (super.noSuchMethod( + Invocation.getter(#hasGesture), + returnValue: false, + ) as bool); @override String get method => (super.noSuchMethod( @@ -602,10 +863,16 @@ class MockWebResourceRequest extends _i1.Mock @override _i2.WebResourceRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebResourceRequest_6( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebResourceRequest); } @@ -619,25 +886,31 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { } @override - void Function(_i2.DownloadListener, String, String, String, String, int) - get onDownloadStart => (super.noSuchMethod( - Invocation.getter(#onDownloadStart), - returnValue: ( - _i2.DownloadListener pigeon_instance, - String url, - String userAgent, - String contentDisposition, - String mimetype, - int contentLength, - ) {}, - ) as void Function( - _i2.DownloadListener, - String, - String, - String, - String, - int, - )); + void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + ) get onDownloadStart => (super.noSuchMethod( + Invocation.getter(#onDownloadStart), + returnValue: ( + _i2.DownloadListener pigeon_instance, + String url, + String userAgent, + String contentDisposition, + String mimetype, + int contentLength, + ) {}, + ) as void Function( + _i2.DownloadListener, + String, + String, + String, + String, + int, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -650,10 +923,16 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { @override _i2.DownloadListener pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeDownloadListener_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.DownloadListener); } @@ -687,11 +966,19 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock ) as String); @override - void Function(_i2.JavaScriptChannel, String) get postMessage => - (super.noSuchMethod( + void Function( + _i2.JavaScriptChannel, + String, + ) get postMessage => (super.noSuchMethod( Invocation.getter(#postMessage), - returnValue: (_i2.JavaScriptChannel pigeon_instance, String message) {}, - ) as void Function(_i2.JavaScriptChannel, String)); + returnValue: ( + _i2.JavaScriptChannel pigeon_instance, + String message, + ) {}, + ) as void Function( + _i2.JavaScriptChannel, + String, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -704,10 +991,16 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override _i2.JavaScriptChannel pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeJavaScriptChannel_9( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.JavaScriptChannel); } @@ -740,22 +1033,26 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { )); @override - _i4.Future Function(_i2.WebChromeClient, _i2.WebView, String, String) - get onJsConfirm => (super.noSuchMethod( - Invocation.getter(#onJsConfirm), - returnValue: ( - _i2.WebChromeClient pigeon_instance, - _i2.WebView webView, - String url, - String message, - ) => - _i4.Future.value(false), - ) as _i4.Future Function( - _i2.WebChromeClient, - _i2.WebView, - String, - String, - )); + _i4.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + ) get onJsConfirm => (super.noSuchMethod( + Invocation.getter(#onJsConfirm), + returnValue: ( + _i2.WebChromeClient pigeon_instance, + _i2.WebView webView, + String url, + String message, + ) => + _i4.Future.value(false), + ) as _i4.Future Function( + _i2.WebChromeClient, + _i2.WebView, + String, + String, + )); @override _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( @@ -769,9 +1066,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnShowFileChooser(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnShowFileChooser, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnShowFileChooser, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -779,9 +1077,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnConsoleMessage(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnConsoleMessage, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnConsoleMessage, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -789,7 +1088,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsAlert(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsAlert, [value]), + Invocation.method( + #setSynchronousReturnValueForOnJsAlert, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -797,9 +1099,10 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsConfirm(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsConfirm, [ - value, - ]), + Invocation.method( + #setSynchronousReturnValueForOnJsConfirm, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -807,17 +1110,26 @@ class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient { @override _i4.Future setSynchronousReturnValueForOnJsPrompt(bool? value) => (super.noSuchMethod( - Invocation.method(#setSynchronousReturnValueForOnJsPrompt, [value]), + Invocation.method( + #setSynchronousReturnValueForOnJsPrompt, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WebChromeClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebChromeClient_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebChromeClient); } @@ -841,8 +1153,7 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i4.Future setSynchronousReturnValueForShouldOverrideUrlLoading( - bool? value, - ) => + bool? value) => (super.noSuchMethod( Invocation.method( #setSynchronousReturnValueForShouldOverrideUrlLoading, @@ -854,10 +1165,16 @@ class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient { @override _i2.WebViewClient pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWebViewClient_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WebViewClient); } @@ -878,16 +1195,28 @@ class MockJavascriptChannelRegistry extends _i1.Mock ) as Map); @override - void onJavascriptChannelMessage(String? channel, String? message) => + void onJavascriptChannelMessage( + String? channel, + String? message, + ) => super.noSuchMethod( - Invocation.method(#onJavascriptChannelMessage, [channel, message]), + Invocation.method( + #onJavascriptChannelMessage, + [ + channel, + message, + ], + ), returnValueForMissingStub: null, ); @override void updateJavascriptChannelsFromSet(Set<_i3.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method(#updateJavascriptChannelsFromSet, [channels]), + Invocation.method( + #updateJavascriptChannelsFromSet, + [channels], + ), returnValueForMissingStub: null, ); } @@ -907,34 +1236,50 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method(#onNavigationRequest, [], { - #url: url, - #isForMainFrame: isForMainFrame, - }), + Invocation.method( + #onNavigationRequest, + [], + { + #url: url, + #isForMainFrame: isForMainFrame, + }, + ), returnValue: _i4.Future.value(false), ) as _i4.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( - Invocation.method(#onPageStarted, [url]), + Invocation.method( + #onPageStarted, + [url], + ), returnValueForMissingStub: null, ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method(#onPageFinished, [url]), + Invocation.method( + #onPageFinished, + [url], + ), returnValueForMissingStub: null, ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method(#onProgress, [progress]), + Invocation.method( + #onProgress, + [progress], + ), returnValueForMissingStub: null, ); @override void onWebResourceError(_i3.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), + Invocation.method( + #onWebResourceError, + [error], + ), returnValueForMissingStub: null, ); } @@ -949,58 +1294,77 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { @override _i2.WebView createWebView() => (super.noSuchMethod( - Invocation.method(#createWebView, []), + Invocation.method( + #createWebView, + [], + ), returnValue: _FakeWebView_4( this, - Invocation.method(#createWebView, []), + Invocation.method( + #createWebView, + [], + ), ), ) as _i2.WebView); @override _i2.WebViewClient createWebViewClient({ - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageStarted, - void Function(_i2.WebViewClient, _i2.WebView, String)? onPageFinished, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageStarted, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? onPageFinished, void Function( _i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest, _i2.WebResourceError, )? onReceivedRequestError, - void Function(_i2.WebViewClient, _i2.WebView, int, String, String)? - onReceivedError, - void Function(_i2.WebViewClient, _i2.WebView, _i2.WebResourceRequest)? - requestLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + int, + String, + String, + )? onReceivedError, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.WebResourceRequest, + )? requestLoading, void Function( _i2.WebViewClient, _i2.WebView, _i2.AndroidMessage, _i2.AndroidMessage, )? onFormResubmission, - void Function(_i2.WebViewClient, _i2.WebView, _i2.ClientCertRequest)? - onReceivedClientCertRequest, + void Function( + _i2.WebViewClient, + _i2.WebView, + _i2.ClientCertRequest, + )? onReceivedClientCertRequest, void Function( _i2.WebViewClient, _i2.WebView, _i2.SslErrorHandler, _i2.SslError, )? onReceivedSslError, - void Function(_i2.WebViewClient, _i2.WebView, String)? urlLoading, + void Function( + _i2.WebViewClient, + _i2.WebView, + String, + )? urlLoading, }) => (super.noSuchMethod( - Invocation.method(#createWebViewClient, [], { - #onPageStarted: onPageStarted, - #onPageFinished: onPageFinished, - #onReceivedRequestError: onReceivedRequestError, - #onReceivedError: onReceivedError, - #requestLoading: requestLoading, - #onFormResubmission: onFormResubmission, - #onReceivedClientCertRequest: onReceivedClientCertRequest, - #onReceivedSslError: onReceivedSslError, - #urlLoading: urlLoading, - }), - returnValue: _FakeWebViewClient_11( - this, - Invocation.method(#createWebViewClient, [], { + Invocation.method( + #createWebViewClient, + [], + { #onPageStarted: onPageStarted, #onPageFinished: onPageFinished, #onReceivedRequestError: onReceivedRequestError, @@ -1010,14 +1374,35 @@ class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { #onReceivedClientCertRequest: onReceivedClientCertRequest, #onReceivedSslError: onReceivedSslError, #urlLoading: urlLoading, - }), + }, + ), + returnValue: _FakeWebViewClient_11( + this, + Invocation.method( + #createWebViewClient, + [], + { + #onPageStarted: onPageStarted, + #onPageFinished: onPageFinished, + #onReceivedRequestError: onReceivedRequestError, + #onReceivedError: onReceivedError, + #requestLoading: requestLoading, + #onFormResubmission: onFormResubmission, + #onReceivedClientCertRequest: onReceivedClientCertRequest, + #onReceivedSslError: onReceivedSslError, + #urlLoading: urlLoading, + }, + ), ), ) as _i2.WebViewClient); @override _i4.Future setWebContentsDebuggingEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setWebContentsDebuggingEnabled, [enabled]), + Invocation.method( + #setWebContentsDebuggingEnabled, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_navigation_delegate.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_navigation_delegate.dart index 38cf7c19a2d5..040ab2466136 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_navigation_delegate.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_navigation_delegate.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; +import 'platform_ssl_auth_error.dart'; import 'types/types.dart'; import 'webview_platform.dart' show WebViewPlatform; @@ -34,6 +35,13 @@ typedef UrlChangeCallback = void Function(UrlChange change); /// authentication request. typedef HttpAuthRequestCallback = void Function(HttpAuthRequest request); +/// Signature for callbacks that notify the host application of an SSL +/// authentication error. +/// +/// The host application must call either [PlatformSslAuthError.cancel] or +/// [PlatformSslAuthError.proceed]. +typedef SslAuthErrorCallback = void Function(PlatformSslAuthError error); + /// An interface defining navigation events that occur on the native platform. /// /// The [PlatformWebViewController] is notifying this delegate on events that @@ -143,4 +151,15 @@ abstract class PlatformNavigationDelegate extends PlatformInterface { 'setOnHttpAuthRequest is not implemented on the current platform.', ); } + + /// Invoked when the web view receives a recoverable SSL error for a + /// certificate. + /// + /// The host application must call either [PlatformSslAuthError.cancel] or + /// [PlatformSslAuthError.proceed]. + Future setOnSSlAuthError(SslAuthErrorCallback onSslAuthError) { + throw UnimplementedError( + 'setOnSSlAuthError is not implemented on the current platform.', + ); + } } diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_ssl_auth_error.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_ssl_auth_error.dart new file mode 100644 index 000000000000..7bd0576a51cb --- /dev/null +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_ssl_auth_error.dart @@ -0,0 +1,39 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/foundation.dart'; + +import 'types/types.dart'; + +/// Represents an SSL error with the associated certificate. +/// +/// The host application must call [cancel] or, contrary to secure web +/// communication standards, [proceed] to provide the web view's response to the +/// request. +abstract class PlatformSslAuthError { + /// Creates a [PlatformSslAuthError]. + @protected + PlatformSslAuthError({required this.certificate, required this.description}); + + /// The certificate associated with this error. + final X509Certificate? certificate; + + /// A human-presentable description for a given error. + final String description; + + /// Instructs the WebView that encountered the SSL certificate error to ignore + /// the error and continue communicating with the server. + /// + /// **Warning:** When an SSL error occurs, the host application should always + /// call [cancel] rather than [proceed] because an invalid SSL certificate + /// means the connection is not secure. + Future proceed(); + + /// Instructs the WebView that encountered the SSL certificate error to + /// terminate communication with the server. + /// + /// The host application must call this method to prevent a resource from + /// loading when an SSL certificate is invalid. + Future cancel(); +} diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart index 937b44a13a85..bc4e9a867209 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart @@ -25,3 +25,4 @@ export 'web_resource_request.dart'; export 'web_resource_response.dart'; export 'webview_cookie.dart'; export 'webview_credential.dart'; +export 'x509_certificate.dart'; diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/x509_certificate.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/x509_certificate.dart new file mode 100644 index 000000000000..f4ca0cd6fe18 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/x509_certificate.dart @@ -0,0 +1,15 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/foundation.dart'; + +/// Represents an X.509 certificate. +@immutable +class X509Certificate { + /// Creates an [X509Certificate]. + const X509Certificate({this.data}); + + /// A DER representation of the certificate object. + final Uint8List? data; +} diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/webview_flutter_platform_interface.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/webview_flutter_platform_interface.dart index d14fec163327..47c2ad261b89 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/webview_flutter_platform_interface.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/webview_flutter_platform_interface.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. export 'src/platform_navigation_delegate.dart'; +export 'src/platform_ssl_auth_error.dart'; export 'src/platform_webview_controller.dart'; export 'src/platform_webview_cookie_manager.dart'; export 'src/platform_webview_widget.dart'; diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_navigation_delegate_test.dart index 2d6d40e70a1d..73ee279a4a9e 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_navigation_delegate_test.dart @@ -155,6 +155,19 @@ void main() { throwsUnimplementedError, ); }); + + test( + 'Default implementation of setOnSSlAuthError should throw unimplemented error', + () { + final PlatformNavigationDelegate callbackDelegate = + ExtendsPlatformNavigationDelegate( + const PlatformNavigationDelegateCreationParams()); + + expect( + () => callbackDelegate.setOnSSlAuthError((PlatformSslAuthError eror) {}), + throwsUnimplementedError, + ); + }); } class MockWebViewPlatformWithMixin extends MockWebViewPlatform diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift index 822e38025ff6..df77486425b6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/NavigationDelegateProxyAPITests.swift @@ -221,17 +221,17 @@ class TestNavigationDelegateApi: PigeonApiProtocolWKNavigationDelegate { challenge challengeArg: URLAuthenticationChallenge, completion: @escaping ( Result< - [Any?], + webview_flutter_wkwebview.AuthenticationChallengeResponse, webview_flutter_wkwebview.PigeonError > ) -> Void ) { didReceiveAuthenticationChallengeArgs = [webViewArg, challengeArg] completion( - .success([ - UrlSessionAuthChallengeDisposition.useCredential, - ["user": "user1", "password": "password1", "persistence": UrlCredentialPersistence.none], - ])) + .success( + AuthenticationChallengeResponse( + disposition: .useCredential, + credential: URLCredential(user: "user1", password: "password1", persistence: .none)))) } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift index 7367e71990b6..5ebfdcab1e1b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/AuthenticationChallengeResponseProxyAPIDelegate.swift @@ -34,6 +34,17 @@ class AuthenticationChallengeResponseProxyAPIDelegate: return AuthenticationChallengeResponse(disposition: nativeDisposition, credential: credential) } + func createAsync( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?, + completion: @escaping (Result) -> Void + ) { + completion( + Result.success( + try! pigeonDefaultConstructor( + pigeonApi: pigeonApi, disposition: disposition, credential: credential))) + } + func disposition( pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift index 8735fddf4c60..4988bb60228a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/NavigationDelegateProxyAPIDelegate.swift @@ -230,46 +230,6 @@ public class NavigationDelegateImpl: NSObject, WKNavigationDelegate { } #endif - func handleAuthChallengeSuccessResponse(_ response: [Any?]) -> ( - URLSession.AuthChallengeDisposition, URLCredential? - ) { - let disposition = response[0] as! UrlSessionAuthChallengeDisposition - var nativeDisposition: URLSession.AuthChallengeDisposition - switch disposition { - case .useCredential: - nativeDisposition = .useCredential - case .performDefaultHandling: - nativeDisposition = .performDefaultHandling - case .cancelAuthenticationChallenge: - nativeDisposition = .cancelAuthenticationChallenge - case .rejectProtectionSpace: - nativeDisposition = .rejectProtectionSpace - case .unknown: - print( - self.registrar.createUnknownEnumError(withEnum: disposition).localizedDescription) - nativeDisposition = .cancelAuthenticationChallenge - } - let credentialMap = response[1] as? [AnyHashable?: AnyHashable?] - var credential: URLCredential? - if let credentialMap = credentialMap { - let nativePersistence: URLCredential.Persistence - switch credentialMap["persistence"] as! UrlCredentialPersistence { - case .none: - nativePersistence = .none - case .forSession: - nativePersistence = .forSession - case .permanent: - nativePersistence = .permanent - case .synchronizable: - nativePersistence = .synchronizable - } - credential = URLCredential( - user: credentialMap["user"] as! String, - password: credentialMap["password"] as! String, persistence: nativePersistence) - } - return (nativeDisposition, credential) - } - #if compiler(>=6.0) public func webView( _ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, @@ -284,8 +244,7 @@ public class NavigationDelegateImpl: NSObject, WKNavigationDelegate { DispatchQueue.main.async { switch result { case .success(let response): - let nativeValues = self.handleAuthChallengeSuccessResponse(response) - completionHandler(nativeValues.0, nativeValues.1) + completionHandler(response.disposition, response.credential) case .failure(let error): completionHandler(.cancelAuthenticationChallenge, nil) onFailure("WKNavigationDelegate.didReceiveAuthenticationChallenge", error) @@ -307,8 +266,7 @@ public class NavigationDelegateImpl: NSObject, WKNavigationDelegate { DispatchQueue.main.async { switch result { case .success(let response): - let nativeValues = self.handleAuthChallengeSuccessResponse(response) - completionHandler(nativeValues.0, nativeValues.1) + completionHandler(response.disposition, response.credential) case .failure(let error): completionHandler(.cancelAuthenticationChallenge, nil) onFailure("WKNavigationDelegate.didReceiveAuthenticationChallenge", error) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift index d19f89bc3346..39d6973435a9 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/URLCredentialProxyAPIDelegate.swift @@ -26,4 +26,22 @@ class URLCredentialProxyAPIDelegate: PigeonApiDelegateURLCredential { } return URLCredential(user: user, password: password, persistence: nativePersistence) } + + func withUserAsync( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence, + completion: @escaping (Result) -> Void + ) { + completion( + Result.success( + try! withUser( + pigeonApi: pigeonApi, user: user, password: password, persistence: persistence))) + } + + func serverTrustAsync( + pigeonApi: PigeonApiURLCredential, trust: SecTrustWrapper, + completion: @escaping (Result) -> Void + ) { + completion(Result.success(URLCredential(trust: trust.value))) + } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift index d99e60eb5d53..dd0c8855254c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.0), do not edit directly. +// Autogenerated from Pigeon (v25.3.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -597,6 +597,8 @@ open class WebKitLibraryPigeonProxyApiRegistrar { binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiUIScrollViewDelegate(self)) PigeonApiURLCredential.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLCredential(self)) + PigeonApiURLProtectionSpace.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLProtectionSpace(self)) PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiURLAuthenticationChallenge(self)) PigeonApiURL.setUpMessageHandlers( @@ -632,6 +634,7 @@ open class WebKitLibraryPigeonProxyApiRegistrar { PigeonApiWKHTTPCookieStore.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiUIScrollViewDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLCredential.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiURLProtectionSpace.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiURLAuthenticationChallenge.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: nil) PigeonApiURL.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) @@ -2589,6 +2592,10 @@ final class PigeonApiHTTPCookie: PigeonApiProtocolHTTPCookie { } } protocol PigeonApiDelegateAuthenticationChallengeResponse { + /// Creates an [AuthenticationChallengeResponse]. + /// + /// Due to https://github.com/flutter/flutter/issues/162437, this should only + /// be used for testing. func pigeonDefaultConstructor( pigeonApi: PigeonApiAuthenticationChallengeResponse, disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential? @@ -2604,6 +2611,15 @@ protocol PigeonApiDelegateAuthenticationChallengeResponse { pigeonApi: PigeonApiAuthenticationChallengeResponse, pigeonInstance: AuthenticationChallengeResponse ) throws -> URLCredential? + /// Creates an [AuthenticationChallengeResponse] + /// + /// This provides the native `AuthenticationChallengeResponse()` constructor + /// as an async method to ensure the class is added to the InstanceManager. + /// See https://github.com/flutter/flutter/issues/162437. + func createAsync( + pigeonApi: PigeonApiAuthenticationChallengeResponse, + disposition: UrlSessionAuthChallengeDisposition, credential: URLCredential?, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolAuthenticationChallengeResponse { @@ -2653,6 +2669,29 @@ final class PigeonApiAuthenticationChallengeResponse: } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } + let createAsyncChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.createAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + createAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let dispositionArg = args[0] as! UrlSessionAuthChallengeDisposition + let credentialArg: URLCredential? = nilOrValue(args[1]) + api.pigeonDelegate.createAsync( + pigeonApi: api, disposition: dispositionArg, credential: credentialArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + createAsyncChannel.setMessageHandler(nil) + } } ///Creates a Dart instance of AuthenticationChallengeResponse and attaches it to [pigeonInstance]. @@ -4078,20 +4117,10 @@ protocol PigeonApiProtocolWKNavigationDelegate { pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, completion: @escaping (Result) -> Void) /// Asks the delegate to respond to an authentication challenge. - /// - /// This return value expects a List with: - /// - /// 1. `UrlSessionAuthChallengeDisposition` - /// 2. A nullable map to instantiate a `URLCredential`. The map structure is - /// [ - /// "user": "", - /// "password": "", - /// "persistence": , - /// ] func didReceiveAuthenticationChallenge( pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void) + completion: @escaping (Result) -> Void) } final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate { @@ -4429,20 +4458,10 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate } /// Asks the delegate to respond to an authentication challenge. - /// - /// This return value expects a List with: - /// - /// 1. `UrlSessionAuthChallengeDisposition` - /// 2. A nullable map to instantiate a `URLCredential`. The map structure is - /// [ - /// "user": "", - /// "password": "", - /// "persistence": , - /// ] func didReceiveAuthenticationChallenge( pigeonInstance pigeonInstanceArg: WKNavigationDelegate, webView webViewArg: WKWebView, challenge challengeArg: URLAuthenticationChallenge, - completion: @escaping (Result<[Any?], PigeonError>) -> Void + completion: @escaping (Result) -> Void ) { if pigeonRegistrar.ignoreCallsToDart { completion( @@ -4475,7 +4494,7 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [Any?] + let result = listResponse[0] as! AuthenticationChallengeResponse completion(.success(result)) } } @@ -6620,6 +6639,25 @@ protocol PigeonApiDelegateURLCredential { pigeonApi: PigeonApiURLCredential, user: String, password: String, persistence: UrlCredentialPersistence ) throws -> URLCredential + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + /// + /// This provides the native `UrlCredential(user:password:persistence)` + /// constructor as an async method to ensure the class is added to the + /// InstanceManager. See https://github.com/flutter/flutter/issues/162437. + func withUserAsync( + pigeonApi: PigeonApiURLCredential, user: String, password: String, + persistence: UrlCredentialPersistence, + completion: @escaping (Result) -> Void) + /// Creates a URL credential instance for server trust authentication, + /// initialized with a accepted trust. + /// + /// This provides the native `UrlCredential(forTrust:)` constructor as an + /// async method to ensure the class is added to the InstanceManager. See + /// https://github.com/flutter/flutter/issues/162437. + func serverTrustAsync( + pigeonApi: PigeonApiURLCredential, trust: SecTrustWrapper, + completion: @escaping (Result) -> Void) } protocol PigeonApiProtocolURLCredential { @@ -6671,6 +6709,48 @@ final class PigeonApiURLCredential: PigeonApiProtocolURLCredential { } else { withUserChannel.setMessageHandler(nil) } + let withUserAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUserAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + withUserAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let userArg = args[0] as! String + let passwordArg = args[1] as! String + let persistenceArg = args[2] as! UrlCredentialPersistence + api.pigeonDelegate.withUserAsync( + pigeonApi: api, user: userArg, password: passwordArg, persistence: persistenceArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + withUserAsyncChannel.setMessageHandler(nil) + } + let serverTrustAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.serverTrustAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + serverTrustAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let trustArg = args[0] as! SecTrustWrapper + api.pigeonDelegate.serverTrustAsync(pigeonApi: api, trust: trustArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + serverTrustAsyncChannel.setMessageHandler(nil) + } } ///Creates a Dart instance of URLCredential and attaches it to [pigeonInstance]. @@ -6748,6 +6828,35 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { self.pigeonRegistrar = pigeonRegistrar self.pigeonDelegate = delegate } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiURLProtectionSpace? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: WebKitLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let getServerTrustChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.getServerTrust", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getServerTrustChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! URLProtectionSpace + do { + let result = try api.pigeonDelegate.getServerTrust( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getServerTrustChannel.setMessageHandler(nil) + } + } + ///Creates a Dart instance of URLProtectionSpace and attaches it to [pigeonInstance]. func pigeonNewInstance( pigeonInstance: URLProtectionSpace, completion: @escaping (Result) -> Void @@ -6768,8 +6877,6 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { let realmArg = try! pigeonDelegate.realm(pigeonApi: self, pigeonInstance: pigeonInstance) let authenticationMethodArg = try! pigeonDelegate.authenticationMethod( pigeonApi: self, pigeonInstance: pigeonInstance) - let getServerTrustArg = try! pigeonDelegate.getServerTrust( - pigeonApi: self, pigeonInstance: pigeonInstance) let binaryMessenger = pigeonRegistrar.binaryMessenger let codec = pigeonRegistrar.codec let channelName: String = @@ -6777,10 +6884,7 @@ final class PigeonApiURLProtectionSpace: PigeonApiProtocolURLProtectionSpace { let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage( - [ - pigeonIdentifierArg, hostArg, portArg, realmArg, authenticationMethodArg, - getServerTrustArg, - ] as [Any?] + [pigeonIdentifierArg, hostArg, portArg, realmArg, authenticationMethodArg] as [Any?] ) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart index 3bd0a5382ac8..206afc5d5c97 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/lib/main.dart @@ -199,6 +199,10 @@ Page resource error: }) ..setOnHttpAuthRequest((HttpAuthRequest request) { openDialog(request); + }) + ..setOnSSlAuthError((PlatformSslAuthError error) { + debugPrint('SSL error from ${(error as WebKitSslAuthError).host}'); + error.cancel(); }), ) ..addJavaScriptChannel(JavaScriptChannelParams( diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index fa7f2114200e..23fa31f4d5af 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -34,3 +34,7 @@ flutter: - assets/www/styles/style.css # Test certificate used to create a test native `SecTrust`. - assets/test_cert.der +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index 5d3f3ee1fe72..8cf38f76edd3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v25.3.0), do not edit directly. +// Autogenerated from Pigeon (v25.3.1), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -2342,6 +2342,10 @@ class HTTPCookie extends NSObject { /// `WKNavigationDelegate` responds with a completion handler that takes two /// values. The wrapper returns this class instead to handle this scenario. class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { + /// Creates an [AuthenticationChallengeResponse]. + /// + /// Due to https://github.com/flutter/flutter/issues/162437, this should only + /// be used for testing. AuthenticationChallengeResponse({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, @@ -2462,6 +2466,51 @@ class AuthenticationChallengeResponse extends PigeonInternalProxyApiBaseClass { } } + /// Creates an [AuthenticationChallengeResponse] + /// + /// This provides the native `AuthenticationChallengeResponse()` constructor + /// as an async method to ensure the class is added to the InstanceManager. + /// See https://github.com/flutter/flutter/issues/162437. + static Future createAsync( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, { + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + }) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.AuthenticationChallengeResponse.createAsync'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([disposition, credential]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AuthenticationChallengeResponse?)!; + } + } + @override AuthenticationChallengeResponse pigeon_copy() { return AuthenticationChallengeResponse.pigeon_detached( @@ -4369,16 +4418,6 @@ class WKNavigationDelegate extends NSObject { /// Asks the delegate to respond to an authentication challenge. /// - /// This return value expects a List with: - /// - /// 1. `UrlSessionAuthChallengeDisposition` - /// 2. A nullable map to instantiate a `URLCredential`. The map structure is - /// [ - /// "user": "", - /// "password": "", - /// "persistence": , - /// ] - /// /// For the associated Native object to be automatically garbage collected, /// it is required that the implementation of this `Function` doesn't have a /// strong reference to the encapsulating class instance. When this `Function` @@ -4396,7 +4435,7 @@ class WKNavigationDelegate extends NSObject { /// /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. - final Future> Function( + final Future Function( WKNavigationDelegate pigeon_instance, WKWebView webView, URLAuthenticationChallenge challenge, @@ -4440,7 +4479,7 @@ class WKNavigationDelegate extends NSObject { WKNavigationDelegate pigeon_instance, WKWebView webView, )? webViewWebContentProcessDidTerminate, - Future> Function( + Future Function( WKNavigationDelegate pigeon_instance, WKWebView webView, URLAuthenticationChallenge challenge, @@ -4746,7 +4785,7 @@ class WKNavigationDelegate extends NSObject { assert(arg_challenge != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.didReceiveAuthenticationChallenge was null, expected non-null URLAuthenticationChallenge.'); try { - final List output = + final AuthenticationChallengeResponse output = await (didReceiveAuthenticationChallenge ?? arg_pigeon_instance!.didReceiveAuthenticationChallenge) .call(arg_pigeon_instance!, arg_webView!, arg_challenge!); @@ -7617,6 +7656,98 @@ class URLCredential extends NSObject { } } + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + /// + /// This provides the native `UrlCredential(user:password:persistence)` + /// constructor as an async method to ensure the class is added to the + /// InstanceManager. See https://github.com/flutter/flutter/issues/162437. + static Future withUserAsync( + String user, + String password, + UrlCredentialPersistence persistence, { + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + }) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.withUserAsync'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([user, password, persistence]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as URLCredential?)!; + } + } + + /// Creates a URL credential instance for server trust authentication, + /// initialized with a accepted trust. + /// + /// This provides the native `UrlCredential(forTrust:)` constructor as an + /// async method to ensure the class is added to the InstanceManager. See + /// https://github.com/flutter/flutter/issues/162437. + static Future serverTrustAsync( + SecTrust trust, { + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + }) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLCredential.serverTrustAsync'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([trust]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as URLCredential?)!; + } + } + @override URLCredential pigeon_copy() { return URLCredential.pigeon_detached( @@ -7644,10 +7775,13 @@ class URLProtectionSpace extends NSObject { required this.port, this.realm, this.authenticationMethod, - this.getServerTrust, super.observeValue, }) : super.pigeon_detached(); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecURLProtectionSpace = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + /// The receiver’s host. final String host; @@ -7660,9 +7794,6 @@ class URLProtectionSpace extends NSObject { /// The authentication method used by the receiver. final String? authenticationMethod; - /// A representation of the server’s SSL transaction state. - final SecTrust? getServerTrust; - static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, @@ -7672,7 +7803,6 @@ class URLProtectionSpace extends NSObject { int port, String? realm, String? authenticationMethod, - SecTrust? getServerTrust, )? pigeon_newInstance, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = @@ -7704,12 +7834,11 @@ class URLProtectionSpace extends NSObject { 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.pigeon_newInstance was null, expected non-null int.'); final String? arg_realm = (args[3] as String?); final String? arg_authenticationMethod = (args[4] as String?); - final SecTrust? arg_getServerTrust = (args[5] as SecTrust?); try { (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call(arg_host!, arg_port!, arg_realm, - arg_authenticationMethod, arg_getServerTrust) ?? + arg_authenticationMethod) ?? URLProtectionSpace.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, @@ -7717,7 +7846,6 @@ class URLProtectionSpace extends NSObject { port: arg_port!, realm: arg_realm, authenticationMethod: arg_authenticationMethod, - getServerTrust: arg_getServerTrust, ), arg_pigeon_instanceIdentifier!, ); @@ -7733,6 +7861,36 @@ class URLProtectionSpace extends NSObject { } } + /// A representation of the server’s SSL transaction state. + Future getServerTrust() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecURLProtectionSpace; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.URLProtectionSpace.getServerTrust'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final Future pigeonVar_sendFuture = + pigeonVar_channel.send([this]); + final List? pigeonVar_replyList = + await pigeonVar_sendFuture as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as SecTrust?); + } + } + @override URLProtectionSpace pigeon_copy() { return URLProtectionSpace.pigeon_detached( @@ -7742,7 +7900,6 @@ class URLProtectionSpace extends NSObject { port: port, realm: realm, authenticationMethod: authenticationMethod, - getServerTrust: getServerTrust, observeValue: observeValue, ); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart index 281df86ce5e6..6dc413e0cb7b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/webkit_constants.dart @@ -69,4 +69,8 @@ class NSUrlAuthenticationMethod { /// Use NTLM authentication for this protection space. static const String httpNtlm = 'NSURLAuthenticationMethodNTLM'; + + /// Perform server trust authentication (certificate validation) for this + /// protection space. + static const String serverTrust = 'NSURLAuthenticationMethodServerTrust'; } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart index 89e184a89a5a..5eef2a3d52bb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart @@ -193,10 +193,10 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { return NavigationResponsePolicy.allow; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + ); }, ); }, @@ -751,7 +751,7 @@ class WebViewWidgetProxy { WKWebView webView, WKNavigationResponse navigationResponse, ) decidePolicyForNavigationResponse, - required Future> Function( + required Future Function( WKNavigationDelegate, WKWebView webView, URLAuthenticationChallenge challenge, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart index a9ecf777fefc..f0736d741eed 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:typed_data'; + import 'common/platform_webview.dart'; import 'common/web_kit.g.dart'; @@ -29,7 +31,17 @@ class WebKitProxy { this.newPlatformWebView = PlatformWebView.new, this.newWKUIDelegate = WKUIDelegate.new, this.newUIScrollViewDelegate = UIScrollViewDelegate.new, + this.createAsyncAuthenticationChallengeResponse = + AuthenticationChallengeResponse.createAsync, + this.withUserAsyncURLCredential = URLCredential.withUserAsync, + this.serverTrustAsyncURLCredential = URLCredential.serverTrustAsync, this.withUserURLCredential = URLCredential.withUser, + this.evaluateWithErrorSecTrust = SecTrust.evaluateWithError, + this.copyExceptionsSecTrust = SecTrust.copyExceptions, + this.setExceptionsSecTrust = SecTrust.setExceptions, + this.getTrustResultSecTrust = SecTrust.getTrustResult, + this.copyCertificateChainSecTrust = SecTrust.copyCertificateChain, + this.copyDataSecCertificate = SecCertificate.copyData, this.defaultDataStoreWKWebsiteDataStore = _defaultDataStoreWKWebsiteDataStore, }); @@ -102,7 +114,7 @@ class WebKitProxy { WKNavigationDelegate, WKWebView, )? webViewWebContentProcessDidTerminate, - required Future> Function( + required Future Function( WKNavigationDelegate, WKWebView, URLAuthenticationChallenge, @@ -175,6 +187,22 @@ class WebKitProxy { )? scrollViewDidScroll, }) newUIScrollViewDelegate; + /// Calls to [AuthenticationChallengeResponse.createAsync]. + final Future Function( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) createAsyncAuthenticationChallengeResponse; + + /// Calls to [URLCredential.withUserAsync]. + final Future Function( + String, + String, + UrlCredentialPersistence, + ) withUserAsyncURLCredential; + + /// Calls to [URLCredential.serverTrustAsync]. + final Future Function(SecTrust) serverTrustAsyncURLCredential; + /// Constructs [URLCredential]. final URLCredential Function({ required String user, @@ -182,6 +210,26 @@ class WebKitProxy { required UrlCredentialPersistence persistence, }) withUserURLCredential; + /// Calls to [SecTrust.evaluateWithError]. + final Future Function(SecTrust) evaluateWithErrorSecTrust; + + /// Calls to [SecTrust.copyExceptions]. + final Future Function(SecTrust) copyExceptionsSecTrust; + + /// Calls to [SecTrust.setExceptions]. + final Future Function(SecTrust, Uint8List?) setExceptionsSecTrust; + + /// Calls to [SecTrust.getTrustResult]. + final Future Function(SecTrust) + getTrustResultSecTrust; + + /// Calls to [SecTrust.copyCertificateChain]. + final Future?> Function(SecTrust) + copyCertificateChainSecTrust; + + /// Calls to [SecCertificate.copyData]. + final Future Function(SecCertificate) copyDataSecCertificate; + /// Calls to [WKWebsiteDataStore.defaultDataStore]. final WKWebsiteDataStore Function() defaultDataStoreWKWebsiteDataStore; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_ssl_auth_error.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_ssl_auth_error.dart new file mode 100644 index 000000000000..db857d67f9b9 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_ssl_auth_error.dart @@ -0,0 +1,64 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/services.dart'; +import 'package:meta/meta.dart'; +import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'; +import 'common/web_kit.g.dart'; +import 'webkit_proxy.dart'; + +/// An implementation of [PlatformSslAuthError] with the WebKit api. +class WebKitSslAuthError extends PlatformSslAuthError { + /// Creates a [WebKitSslAuthError]. + @internal + WebKitSslAuthError({ + required super.certificate, + required super.description, + required SecTrust trust, + required this.host, + required this.port, + required WebKitProxy proxy, + required Future Function( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) onResponse, + }) : _trust = trust, + _proxy = proxy, + _onResponse = onResponse; + + final SecTrust _trust; + final WebKitProxy _proxy; + + final Future Function( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) _onResponse; + + /// The host portion of the url associated with the error. + final String host; + + /// The port portion of the url associated with the error. + final int port; + + @override + Future cancel() async { + await _onResponse( + UrlSessionAuthChallengeDisposition.cancelAuthenticationChallenge, + null, + ); + } + + @override + Future proceed() async { + final Uint8List? exceptions = await _proxy.copyExceptionsSecTrust(_trust); + if (exceptions != null) { + await _proxy.setExceptionsSecTrust(_trust, exceptions); + } + + await _onResponse( + UrlSessionAuthChallengeDisposition.useCredential, + await _proxy.serverTrustAsyncURLCredential(_trust), + ); + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart index 57f188e9e719..8f0fdc2ccf2d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart @@ -16,6 +16,7 @@ import 'common/weak_reference_utils.dart'; import 'common/web_kit.g.dart'; import 'common/webkit_constants.dart'; import 'webkit_proxy.dart'; +import 'webkit_ssl_auth_error.dart'; /// Media types that can require a user gesture to begin playing. /// @@ -1233,63 +1234,125 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { __, URLAuthenticationChallenge challenge, ) async { - final URLProtectionSpace protectionSpace = - await challenge.getProtectionSpace(); - - final bool isBasicOrNtlm = protectionSpace.authenticationMethod == - NSUrlAuthenticationMethod.httpBasic || - protectionSpace.authenticationMethod == - NSUrlAuthenticationMethod.httpNtlm; - - final void Function(HttpAuthRequest)? callback = - weakThis.target?._onHttpAuthRequest; + final WebKitNavigationDelegate? delegate = weakThis.target; final WebKitProxy? proxy = - (weakThis.target?.params as WebKitNavigationDelegateCreationParams?) + (delegate?.params as WebKitNavigationDelegateCreationParams?) ?.webKitProxy; - if (isBasicOrNtlm && callback != null && proxy != null) { - final String host = protectionSpace.host; - final String? realm = protectionSpace.realm; - - final Completer> responseCompleter = - Completer>(); - - callback( - HttpAuthRequest( - host: host, - realm: realm, - onProceed: (WebViewCredential credential) { - responseCompleter.complete( - [ - UrlSessionAuthChallengeDisposition.useCredential, - { - 'user': credential.user, - 'password': credential.password, - 'persistence': UrlCredentialPersistence.forSession, + if (delegate != null && proxy != null) { + final URLProtectionSpace protectionSpace = + await challenge.getProtectionSpace(); + final Completer responseCompleter = + Completer(); + + switch (protectionSpace.authenticationMethod) { + case NSUrlAuthenticationMethod.httpBasic: + case NSUrlAuthenticationMethod.httpNtlm: + final void Function(HttpAuthRequest)? callback = + delegate._onHttpAuthRequest; + if (callback != null) { + callback( + HttpAuthRequest( + host: protectionSpace.host, + realm: protectionSpace.realm, + onProceed: (WebViewCredential credential) async { + responseCompleter.complete( + await proxy.createAsyncAuthenticationChallengeResponse( + UrlSessionAuthChallengeDisposition.useCredential, + await proxy.withUserAsyncURLCredential( + credential.user, + credential.password, + UrlCredentialPersistence.forSession, + ), + ), + ); }, - ], - ); - }, - onCancel: () { - responseCompleter.complete( - [ - UrlSessionAuthChallengeDisposition - .cancelAuthenticationChallenge, - null, - ], + onCancel: () async { + responseCompleter.complete( + await proxy.createAsyncAuthenticationChallengeResponse( + UrlSessionAuthChallengeDisposition + .cancelAuthenticationChallenge, + null, + ), + ); + }, + ), ); - }, - ), - ); - return responseCompleter.future; + return responseCompleter.future; + } + case NSUrlAuthenticationMethod.serverTrust: + final void Function(PlatformSslAuthError)? callback = + delegate._onSslAuthError; + if (callback == null) { + break; + } + + final SecTrust? serverTrust = + await protectionSpace.getServerTrust(); + if (serverTrust == null) { + break; + } + + try { + final bool trusted = + await proxy.evaluateWithErrorSecTrust(serverTrust); + if (!trusted) { + throw StateError( + 'Expected to throw an exception when evaluation fails.', + ); + } + } on PlatformException catch (exception) { + final DartSecTrustResultType result = + (await proxy.getTrustResultSecTrust(serverTrust)).result; + if (result == DartSecTrustResultType.recoverableTrustFailure) { + final List certificates = + (await proxy.copyCertificateChainSecTrust(serverTrust)) ?? + []; + + final SecCertificate? leafCertificate = + certificates.firstOrNull; + callback( + WebKitSslAuthError( + certificate: leafCertificate != null + ? X509Certificate( + data: await proxy.copyDataSecCertificate( + leafCertificate, + ), + ) + : null, + description: '${exception.code}: ${exception.message}', + trust: serverTrust, + host: protectionSpace.host, + port: protectionSpace.port, + proxy: proxy, + onResponse: ( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) async { + responseCompleter.complete( + await proxy + .createAsyncAuthenticationChallengeResponse( + disposition, + credential, + ), + ); + }, + ), + ); + + return responseCompleter.future; + } + } + } } - return [ + return (proxy ?? const WebKitProxy()) + .createAsyncAuthenticationChallengeResponse( UrlSessionAuthChallengeDisposition.performDefaultHandling, null, - ]; + ); }, ); } @@ -1305,6 +1368,7 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { NavigationRequestCallback? _onNavigationRequest; UrlChangeCallback? _onUrlChange; HttpAuthRequestCallback? _onHttpAuthRequest; + SslAuthErrorCallback? _onSslAuthError; @override Future setOnPageFinished(PageEventCallback onPageFinished) async { @@ -1351,6 +1415,11 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { ) async { _onHttpAuthRequest = onHttpAuthRequest; } + + @override + Future setOnSSlAuthError(SslAuthErrorCallback onSslAuthError) async { + _onSslAuthError = onSslAuthError; + } } /// WebKit implementation of [PlatformWebViewPermissionRequest]. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart index 01dbb61babe8..9eba1513d3c3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/webview_flutter_wkwebview.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +export 'src/webkit_ssl_auth_error.dart'; export 'src/webkit_webview_controller.dart'; export 'src/webkit_webview_cookie_manager.dart'; export 'src/webkit_webview_platform.dart'; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart index 0cf38a4e9ee2..3d181d704bc3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -547,8 +547,24 @@ abstract class HTTPCookie extends NSObject { /// values. The wrapper returns this class instead to handle this scenario. @ProxyApi() abstract class AuthenticationChallengeResponse { + /// Creates an [AuthenticationChallengeResponse]. + /// + /// Due to https://github.com/flutter/flutter/issues/162437, this should only + /// be used for testing. AuthenticationChallengeResponse(); + /// Creates an [AuthenticationChallengeResponse] + /// + /// This provides the native `AuthenticationChallengeResponse()` constructor + /// as an async method to ensure the class is added to the InstanceManager. + /// See https://github.com/flutter/flutter/issues/162437. + @async + @static + AuthenticationChallengeResponse createAsync( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ); + /// The option to use to handle the challenge. late UrlSessionAuthChallengeDisposition disposition; @@ -778,22 +794,9 @@ abstract class WKNavigationDelegate extends NSObject { /// Tells the delegate that the web view’s content process was terminated. void Function(WKWebView webView)? webViewWebContentProcessDidTerminate; - // TODO(bparrishMines): This method should return an - // `AuthenticationChallengeResponse` once the cause of - // https://github.com/flutter/flutter/issues/162437 can be found and fixed. /// Asks the delegate to respond to an authentication challenge. - /// - /// This return value expects a List with: - /// - /// 1. `UrlSessionAuthChallengeDisposition` - /// 2. A nullable map to instantiate a `URLCredential`. The map structure is - /// [ - /// "user": "", - /// "password": "", - /// "persistence": , - /// ] @async - late List Function( + late AuthenticationChallengeResponse Function( WKWebView webView, URLAuthenticationChallenge challenge, ) didReceiveAuthenticationChallenge; @@ -1121,6 +1124,30 @@ abstract class URLCredential extends NSObject { String password, UrlCredentialPersistence persistence, ); + + /// Creates a URL credential instance for internet password authentication + /// with a given user name and password, using a given persistence setting. + /// + /// This provides the native `UrlCredential(user:password:persistence)` + /// constructor as an async method to ensure the class is added to the + /// InstanceManager. See https://github.com/flutter/flutter/issues/162437. + @async + @static + URLCredential withUserAsync( + String user, + String password, + UrlCredentialPersistence persistence, + ); + + /// Creates a URL credential instance for server trust authentication, + /// initialized with a accepted trust. + /// + /// This provides the native `UrlCredential(forTrust:)` constructor as an + /// async method to ensure the class is added to the InstanceManager. See + /// https://github.com/flutter/flutter/issues/162437. + @async + @static + URLCredential serverTrustAsync(SecTrust trust); } /// A server or an area on a server, commonly referred to as a realm, that @@ -1142,7 +1169,7 @@ abstract class URLProtectionSpace extends NSObject { late String? authenticationMethod; /// A representation of the server’s SSL transaction state. - late SecTrust? getServerTrust; + SecTrust? getServerTrust(); } /// A challenge from a server requiring authentication from the client. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 64bf86387d49..9cfd5751c6cc 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -24,6 +24,7 @@ flutter: dependencies: flutter: sdk: flutter + meta: ^1.10.0 path: ^1.8.0 webview_flutter_platform_interface: ^2.11.0 @@ -32,9 +33,13 @@ dev_dependencies: flutter_test: sdk: flutter mockito: ^5.4.4 - pigeon: ^25.2.0 + pigeon: ^25.3.1 topics: - html - webview - webview-flutter +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins +dependency_overrides: + webview_flutter_platform_interface: {path: ../../../packages/webview_flutter/webview_flutter_platform_interface} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart index 4e7d186e80f5..1cc0655d88dc 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart. // Do not manually edit this file. @@ -24,20 +24,35 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKHTTPCookieStore_1 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKHTTPCookieStore_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebsiteDataStore_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [WKHTTPCookieStore]. @@ -59,17 +74,26 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { @override _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), + Invocation.method( + #setCookie, + [cookie], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKHTTPCookieStore_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -80,15 +104,31 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -123,10 +163,16 @@ class MockWKWebsiteDataStore extends _i1.Mock @override _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), returnValue: _FakeWKHTTPCookieStore_1( this, - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -136,19 +182,28 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), + Invocation.method( + #removeDataOfTypes, + [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ], + ), returnValue: _i3.Future.value(false), ) as _i3.Future); @override _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebsiteDataStore_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebsiteDataStore); @@ -159,15 +214,31 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart index 88df3f478fc5..6faf240e477c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart. // Do not manually edit this file. @@ -35,87 +35,173 @@ import 'package:webview_flutter_wkwebview/src/legacy/web_kit_webview_widget.dart class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { - _FakeUIScrollView_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIScrollView_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURLRequest_2 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURLRequest_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKNavigationDelegate_3 extends _i1.SmartFake +class _FakeAuthenticationChallengeResponse_3 extends _i1.SmartFake + implements _i2.AuthenticationChallengeResponse { + _FakeAuthenticationChallengeResponse_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeWKNavigationDelegate_4 extends _i1.SmartFake implements _i2.WKNavigationDelegate { - _FakeWKNavigationDelegate_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKNavigationDelegate_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKPreferences_4 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); +class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { + _FakeWKPreferences_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKScriptMessageHandler_5 extends _i1.SmartFake +class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKScriptMessageHandler_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKWebView_6 extends _i1.SmartFake implements _i2.WKWebView { - _FakeWKWebView_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); +class _FakeWKWebView_7 extends _i1.SmartFake implements _i2.WKWebView { + _FakeWKWebView_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKWebViewConfiguration_7 extends _i1.SmartFake +class _FakeWKWebViewConfiguration_8 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebViewConfiguration_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeUIViewWKWebView_8 extends _i1.SmartFake +class _FakeUIViewWKWebView_9 extends _i1.SmartFake implements _i2.UIViewWKWebView { - _FakeUIViewWKWebView_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIViewWKWebView_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKUserContentController_9 extends _i1.SmartFake +class _FakeWKUserContentController_10 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKUserContentController_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKWebsiteDataStore_10 extends _i1.SmartFake +class _FakeWKWebsiteDataStore_11 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebsiteDataStore_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKWebpagePreferences_11 extends _i1.SmartFake +class _FakeWKWebpagePreferences_12 extends _i1.SmartFake implements _i2.WKWebpagePreferences { - _FakeWKWebpagePreferences_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebpagePreferences_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKHTTPCookieStore_12 extends _i1.SmartFake +class _FakeWKHTTPCookieStore_13 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKHTTPCookieStore_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakeWKUIDelegate_13 extends _i1.SmartFake implements _i2.WKUIDelegate { - _FakeWKUIDelegate_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); +class _FakeWKUIDelegate_14 extends _i1.SmartFake implements _i2.WKUIDelegate { + _FakeWKUIDelegate_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } -class _FakePlatformWebView_14 extends _i1.SmartFake +class _FakePlatformWebView_15 extends _i1.SmartFake implements _i3.PlatformWebView { - _FakePlatformWebView_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePlatformWebView_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [UIScrollView]. @@ -137,21 +223,43 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i4.Future> getContentOffset() => (super.noSuchMethod( - Invocation.method(#getContentOffset, []), + Invocation.method( + #getContentOffset, + [], + ), returnValue: _i4.Future>.value([]), ) as _i4.Future>); @override - _i4.Future scrollBy(double? x, double? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i4.Future scrollBy( + double? x, + double? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future setContentOffset(double? x, double? y) => + _i4.Future setContentOffset( + double? x, + double? y, + ) => (super.noSuchMethod( - Invocation.method(#setContentOffset, [x, y]), + Invocation.method( + #setContentOffset, + [ + x, + y, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -159,35 +267,50 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i4.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setDelegate, [delegate]), + Invocation.method( + #setDelegate, + [delegate], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBounces(bool? value) => (super.noSuchMethod( - Invocation.method(#setBounces, [value]), + Invocation.method( + #setBounces, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBouncesHorizontally(bool? value) => (super.noSuchMethod( - Invocation.method(#setBouncesHorizontally, [value]), + Invocation.method( + #setBouncesHorizontally, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setBouncesVertically(bool? value) => (super.noSuchMethod( - Invocation.method(#setBouncesVertically, [value]), + Invocation.method( + #setBouncesVertically, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAlwaysBounceVertical(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceVertical, [value]), + Invocation.method( + #setAlwaysBounceVertical, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -195,30 +318,45 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i4.Future setAlwaysBounceHorizontal(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceHorizontal, [value]), + Invocation.method( + #setAlwaysBounceHorizontal, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeUIScrollView_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIScrollView); @override _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), + Invocation.method( + #setBackgroundColor, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), + Invocation.method( + #setOpaque, + [opaque], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -230,15 +368,31 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -263,40 +417,58 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), + Invocation.method( + #setHttpMethod, + [method], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), + Invocation.method( + #getHttpMethod, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), + Invocation.method( + #setHttpBody, + [body], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method(#getHttpBody, []), + Invocation.method( + #getHttpBody, + [], + ), returnValue: _i4.Future<_i5.Uint8List?>.value(), ) as _i4.Future<_i5.Uint8List?>); @override _i4.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), + Invocation.method( + #setAllHttpHeaderFields, + [fields], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -304,16 +476,25 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i4.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), + Invocation.method( + #getAllHttpHeaderFields, + [], + ), returnValue: _i4.Future?>.value(), ) as _i4.Future?>); @override _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeURLRequest_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.URLRequest); @@ -324,15 +505,31 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -360,8 +557,7 @@ class MockWKNavigationDelegate extends _i1.Mock _i2.WKNavigationAction navigationAction, ) => _i4.Future<_i2.NavigationActionPolicy>.value( - _i2.NavigationActionPolicy.allow, - ), + _i2.NavigationActionPolicy.allow), ) as _i4.Future<_i2.NavigationActionPolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, @@ -381,8 +577,7 @@ class MockWKNavigationDelegate extends _i1.Mock _i2.WKNavigationResponse navigationResponse, ) => _i4.Future<_i2.NavigationResponsePolicy>.value( - _i2.NavigationResponsePolicy.allow, - ), + _i2.NavigationResponsePolicy.allow), ) as _i4.Future<_i2.NavigationResponsePolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, @@ -390,7 +585,7 @@ class MockWKNavigationDelegate extends _i1.Mock )); @override - _i4.Future> Function( + _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, @@ -401,8 +596,12 @@ class MockWKNavigationDelegate extends _i1.Mock _i2.WKWebView webView, _i2.URLAuthenticationChallenge challenge, ) => - _i4.Future>.value([]), - ) as _i4.Future> Function( + _i4.Future<_i2.AuthenticationChallengeResponse>.value( + _FakeAuthenticationChallengeResponse_3( + this, + Invocation.getter(#didReceiveAuthenticationChallenge), + )), + ) as _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, @@ -419,10 +618,16 @@ class MockWKNavigationDelegate extends _i1.Mock @override _i2.WKNavigationDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKNavigationDelegate_3( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKNavigationDelegate_4( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKNavigationDelegate); @@ -433,15 +638,31 @@ class MockWKNavigationDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -466,17 +687,26 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { @override _i4.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [enabled]), + Invocation.method( + #setJavaScriptEnabled, + [enabled], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKPreferences_4( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKPreferences_5( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKPreferences); @@ -487,15 +717,31 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -539,10 +785,16 @@ class MockWKScriptMessageHandler extends _i1.Mock @override _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKScriptMessageHandler_5( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKScriptMessageHandler_6( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKScriptMessageHandler); @@ -553,15 +805,31 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -586,10 +854,16 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { @override _i2.WKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebView_6( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKWebView_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebView); @@ -600,15 +874,31 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -625,7 +915,7 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i2.WKWebViewConfiguration get configuration => (super.noSuchMethod( Invocation.getter(#configuration), - returnValue: _FakeWKWebViewConfiguration_7( + returnValue: _FakeWKWebViewConfiguration_8( this, Invocation.getter(#configuration), ), @@ -651,26 +941,41 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( - Invocation.method(#pigeonVar_configuration, []), - returnValue: _FakeWKWebViewConfiguration_7( + Invocation.method( + #pigeonVar_configuration, + [], + ), + returnValue: _FakeWKWebViewConfiguration_8( this, - Invocation.method(#pigeonVar_configuration, []), + Invocation.method( + #pigeonVar_configuration, + [], + ), ), ) as _i2.WKWebViewConfiguration); @override _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( - Invocation.method(#pigeonVar_scrollView, []), + Invocation.method( + #pigeonVar_scrollView, + [], + ), returnValue: _FakeUIScrollView_1( this, - Invocation.method(#pigeonVar_scrollView, []), + Invocation.method( + #pigeonVar_scrollView, + [], + ), ), ) as _i2.UIScrollView); @override _i4.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setUIDelegate, [delegate]), + Invocation.method( + #setUIDelegate, + [delegate], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -678,103 +983,160 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i4.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setNavigationDelegate, [delegate]), + Invocation.method( + #setNavigationDelegate, + [delegate], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method(#getEstimatedProgress, []), + Invocation.method( + #getEstimatedProgress, + [], + ), returnValue: _i4.Future.value(0.0), ) as _i4.Future); @override _i4.Future load(_i2.URLRequest? request) => (super.noSuchMethod( - Invocation.method(#load, [request]), + Invocation.method( + #load, + [request], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future loadHtmlString(String? string, String? baseUrl) => + _i4.Future loadHtmlString( + String? string, + String? baseUrl, + ) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [string, baseUrl]), + Invocation.method( + #loadHtmlString, + [ + string, + baseUrl, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future loadFileUrl(String? url, String? readAccessUrl) => + _i4.Future loadFileUrl( + String? url, + String? readAccessUrl, + ) => (super.noSuchMethod( - Invocation.method(#loadFileUrl, [url, readAccessUrl]), + Invocation.method( + #loadFileUrl, + [ + url, + readAccessUrl, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), + Invocation.method( + #loadFlutterAsset, + [key], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i4.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + Invocation.method( + #setAllowsBackForwardNavigationGestures, + [allow], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setCustomUserAgent, [userAgent]), + Invocation.method( + #setCustomUserAgent, + [userAgent], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -782,49 +1144,73 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i4.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavaScript, [javaScriptString]), + Invocation.method( + #evaluateJavaScript, + [javaScriptString], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method(#setInspectable, [inspectable]), + Invocation.method( + #setInspectable, + [inspectable], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), + Invocation.method( + #getCustomUserAgent, + [], + ), returnValue: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), + Invocation.method( + #setAllowsLinkPreview, + [allow], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeUIViewWKWebView_8( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeUIViewWKWebView_9( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIViewWKWebView); @override _i4.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), + Invocation.method( + #setBackgroundColor, + [value], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), + Invocation.method( + #setOpaque, + [opaque], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -836,15 +1222,31 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -870,10 +1272,12 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i4.Future setUserContentController( - _i2.WKUserContentController? controller, - ) => + _i2.WKUserContentController? controller) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), + Invocation.method( + #setUserContentController, + [controller], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -881,19 +1285,27 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i4.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method(#getUserContentController, []), + Invocation.method( + #getUserContentController, + [], + ), returnValue: _i4.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_9( - this, - Invocation.method(#getUserContentController, []), + _FakeWKUserContentController_10( + this, + Invocation.method( + #getUserContentController, + [], ), - ), + )), ) as _i4.Future<_i2.WKUserContentController>); @override _i4.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), + Invocation.method( + #setWebsiteDataStore, + [dataStore], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -901,38 +1313,53 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i4.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method(#getWebsiteDataStore, []), - returnValue: _i4.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#getWebsiteDataStore, []), - ), + Invocation.method( + #getWebsiteDataStore, + [], ), + returnValue: + _i4.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_11( + this, + Invocation.method( + #getWebsiteDataStore, + [], + ), + )), ) as _i4.Future<_i2.WKWebsiteDataStore>); @override _i4.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), + Invocation.method( + #setPreferences, + [preferences], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method(#getPreferences, []), - returnValue: _i4.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_4( - this, - Invocation.method(#getPreferences, []), - ), + Invocation.method( + #getPreferences, + [], ), + returnValue: _i4.Future<_i2.WKPreferences>.value(_FakeWKPreferences_5( + this, + Invocation.method( + #getPreferences, + [], + ), + )), ) as _i4.Future<_i2.WKPreferences>); @override _i4.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + Invocation.method( + #setAllowsInlineMediaPlayback, + [allow], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -940,19 +1367,22 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i4.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + Invocation.method( + #setLimitsNavigationsToAppBoundDomains, + [limit], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type, - ) => + _i2.AudiovisualMediaType? type) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), + Invocation.method( + #setMediaTypesRequiringUserActionForPlayback, + [type], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -960,21 +1390,32 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i4.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( - Invocation.method(#getDefaultWebpagePreferences, []), + Invocation.method( + #getDefaultWebpagePreferences, + [], + ), returnValue: _i4.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - this, - Invocation.method(#getDefaultWebpagePreferences, []), + _FakeWKWebpagePreferences_12( + this, + Invocation.method( + #getDefaultWebpagePreferences, + [], ), - ), + )), ) as _i4.Future<_i2.WKWebpagePreferences>); @override _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebViewConfiguration_7( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKWebViewConfiguration_8( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebViewConfiguration); @@ -985,15 +1426,31 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1011,7 +1468,7 @@ class MockWKWebsiteDataStore extends _i1.Mock @override _i2.WKHTTPCookieStore get httpCookieStore => (super.noSuchMethod( Invocation.getter(#httpCookieStore), - returnValue: _FakeWKHTTPCookieStore_12( + returnValue: _FakeWKHTTPCookieStore_13( this, Invocation.getter(#httpCookieStore), ), @@ -1028,10 +1485,16 @@ class MockWKWebsiteDataStore extends _i1.Mock @override _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), - returnValue: _FakeWKHTTPCookieStore_12( + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), + returnValue: _FakeWKHTTPCookieStore_13( this, - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -1041,19 +1504,28 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), + Invocation.method( + #removeDataOfTypes, + [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ], + ), returnValue: _i4.Future.value(false), ) as _i4.Future); @override _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebsiteDataStore_10( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKWebsiteDataStore_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebsiteDataStore); @@ -1064,15 +1536,31 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1103,8 +1591,7 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.MediaCaptureType type, ) => _i4.Future<_i2.PermissionDecision>.value( - _i2.PermissionDecision.deny, - ), + _i2.PermissionDecision.deny), ) as _i4.Future<_i2.PermissionDecision> Function( _i2.WKUIDelegate, _i2.WKWebView, @@ -1146,10 +1633,16 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { @override _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUIDelegate_13( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKUIDelegate_14( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKUIDelegate); @@ -1160,15 +1653,31 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1198,7 +1707,13 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method(#addScriptMessageHandler, [handler, name]), + Invocation.method( + #addScriptMessageHandler, + [ + handler, + name, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1206,14 +1721,20 @@ class MockWKUserContentController extends _i1.Mock @override _i4.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method(#removeScriptMessageHandler, [name]), + Invocation.method( + #removeScriptMessageHandler, + [name], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method(#removeAllScriptMessageHandlers, []), + Invocation.method( + #removeAllScriptMessageHandlers, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1221,24 +1742,36 @@ class MockWKUserContentController extends _i1.Mock @override _i4.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method(#addUserScript, [userScript]), + Invocation.method( + #addUserScript, + [userScript], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i4.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method(#removeAllUserScripts, []), + Invocation.method( + #removeAllUserScripts, + [], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKUserContentController_9( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKUserContentController_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKUserContentController); @@ -1249,15 +1782,31 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @@ -1279,16 +1828,28 @@ class MockJavascriptChannelRegistry extends _i1.Mock ) as Map); @override - void onJavascriptChannelMessage(String? channel, String? message) => + void onJavascriptChannelMessage( + String? channel, + String? message, + ) => super.noSuchMethod( - Invocation.method(#onJavascriptChannelMessage, [channel, message]), + Invocation.method( + #onJavascriptChannelMessage, + [ + channel, + message, + ], + ), returnValueForMissingStub: null, ); @override void updateJavascriptChannelsFromSet(Set<_i7.JavascriptChannel>? channels) => super.noSuchMethod( - Invocation.method(#updateJavascriptChannelsFromSet, [channels]), + Invocation.method( + #updateJavascriptChannelsFromSet, + [channels], + ), returnValueForMissingStub: null, ); } @@ -1308,34 +1869,50 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock required bool? isForMainFrame, }) => (super.noSuchMethod( - Invocation.method(#onNavigationRequest, [], { - #url: url, - #isForMainFrame: isForMainFrame, - }), + Invocation.method( + #onNavigationRequest, + [], + { + #url: url, + #isForMainFrame: isForMainFrame, + }, + ), returnValue: _i4.Future.value(false), ) as _i4.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( - Invocation.method(#onPageStarted, [url]), + Invocation.method( + #onPageStarted, + [url], + ), returnValueForMissingStub: null, ); @override void onPageFinished(String? url) => super.noSuchMethod( - Invocation.method(#onPageFinished, [url]), + Invocation.method( + #onPageFinished, + [url], + ), returnValueForMissingStub: null, ); @override void onProgress(int? progress) => super.noSuchMethod( - Invocation.method(#onProgress, [progress]), + Invocation.method( + #onProgress, + [progress], + ), returnValueForMissingStub: null, ); @override void onWebResourceError(_i8.WebResourceError? error) => super.noSuchMethod( - Invocation.method(#onWebResourceError, [error]), + Invocation.method( + #onWebResourceError, + [error], + ), returnValueForMissingStub: null, ); } @@ -1352,8 +1929,11 @@ class MockWebViewWidgetProxy extends _i1.Mock @override _i3.PlatformWebView createWebView( _i2.WKWebViewConfiguration? configuration, { - void Function(String, _i2.NSObject, Map<_i2.KeyValueChangeKey, Object?>)? - observeValue, + void Function( + String, + _i2.NSObject, + Map<_i2.KeyValueChangeKey, Object?>, + )? observeValue, }) => (super.noSuchMethod( Invocation.method( @@ -1361,7 +1941,7 @@ class MockWebViewWidgetProxy extends _i1.Mock [configuration], {#observeValue: observeValue}, ), - returnValue: _FakePlatformWebView_14( + returnValue: _FakePlatformWebView_15( this, Invocation.method( #createWebView, @@ -1373,97 +1953,115 @@ class MockWebViewWidgetProxy extends _i1.Mock @override _i2.URLRequest createRequest({required String? url}) => (super.noSuchMethod( - Invocation.method(#createRequest, [], {#url: url}), + Invocation.method( + #createRequest, + [], + {#url: url}, + ), returnValue: _FakeURLRequest_2( this, - Invocation.method(#createRequest, [], {#url: url}), + Invocation.method( + #createRequest, + [], + {#url: url}, + ), ), ) as _i2.URLRequest); @override - _i2.WKScriptMessageHandler createScriptMessageHandler({ - required void Function( - _i2.WKScriptMessageHandler, - _i2.WKUserContentController, - _i2.WKScriptMessage, - )? didReceiveScriptMessage, - }) => + _i2.WKScriptMessageHandler createScriptMessageHandler( + {required void Function( + _i2.WKScriptMessageHandler, + _i2.WKUserContentController, + _i2.WKScriptMessage, + )? didReceiveScriptMessage}) => (super.noSuchMethod( - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), - returnValue: _FakeWKScriptMessageHandler_5( + Invocation.method( + #createScriptMessageHandler, + [], + {#didReceiveScriptMessage: didReceiveScriptMessage}, + ), + returnValue: _FakeWKScriptMessageHandler_6( this, - Invocation.method(#createScriptMessageHandler, [], { - #didReceiveScriptMessage: didReceiveScriptMessage, - }), + Invocation.method( + #createScriptMessageHandler, + [], + {#didReceiveScriptMessage: didReceiveScriptMessage}, + ), ), ) as _i2.WKScriptMessageHandler); @override - _i2.WKUIDelegate createUIDelgate({ - void Function( - _i2.WKUIDelegate, - _i2.WKWebView, - _i2.WKWebViewConfiguration, - _i2.WKNavigationAction, - )? onCreateWebView, - }) => + _i2.WKUIDelegate createUIDelgate( + {void Function( + _i2.WKUIDelegate, + _i2.WKWebView, + _i2.WKWebViewConfiguration, + _i2.WKNavigationAction, + )? onCreateWebView}) => (super.noSuchMethod( - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), - returnValue: _FakeWKUIDelegate_13( + Invocation.method( + #createUIDelgate, + [], + {#onCreateWebView: onCreateWebView}, + ), + returnValue: _FakeWKUIDelegate_14( this, - Invocation.method(#createUIDelgate, [], { - #onCreateWebView: onCreateWebView, - }), + Invocation.method( + #createUIDelgate, + [], + {#onCreateWebView: onCreateWebView}, + ), ), ) as _i2.WKUIDelegate); @override _i2.WKNavigationDelegate createNavigationDelegate({ - void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? - didFinishNavigation, - void Function(_i2.WKNavigationDelegate, _i2.WKWebView, String?)? - didStartProvisionalNavigation, + void Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + String?, + )? didFinishNavigation, + void Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + String?, + )? didStartProvisionalNavigation, required _i4.Future<_i2.NavigationActionPolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationAction, )? decidePolicyForNavigationAction, - void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? - didFailNavigation, - void Function(_i2.WKNavigationDelegate, _i2.WKWebView, _i2.NSError)? - didFailProvisionalNavigation, - void Function(_i2.WKNavigationDelegate, _i2.WKWebView)? - webViewWebContentProcessDidTerminate, + void Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.NSError, + )? didFailNavigation, + void Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + _i2.NSError, + )? didFailProvisionalNavigation, + void Function( + _i2.WKNavigationDelegate, + _i2.WKWebView, + )? webViewWebContentProcessDidTerminate, required _i4.Future<_i2.NavigationResponsePolicy> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.WKNavigationResponse, )? decidePolicyForNavigationResponse, - required _i4.Future> Function( + required _i4.Future<_i2.AuthenticationChallengeResponse> Function( _i2.WKNavigationDelegate, _i2.WKWebView, _i2.URLAuthenticationChallenge, )? didReceiveAuthenticationChallenge, }) => (super.noSuchMethod( - Invocation.method(#createNavigationDelegate, [], { - #didFinishNavigation: didFinishNavigation, - #didStartProvisionalNavigation: didStartProvisionalNavigation, - #decidePolicyForNavigationAction: decidePolicyForNavigationAction, - #didFailNavigation: didFailNavigation, - #didFailProvisionalNavigation: didFailProvisionalNavigation, - #webViewWebContentProcessDidTerminate: - webViewWebContentProcessDidTerminate, - #decidePolicyForNavigationResponse: decidePolicyForNavigationResponse, - #didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, - }), - returnValue: _FakeWKNavigationDelegate_3( - this, - Invocation.method(#createNavigationDelegate, [], { + Invocation.method( + #createNavigationDelegate, + [], + { #didFinishNavigation: didFinishNavigation, #didStartProvisionalNavigation: didStartProvisionalNavigation, #decidePolicyForNavigationAction: decidePolicyForNavigationAction, @@ -1475,7 +2073,27 @@ class MockWebViewWidgetProxy extends _i1.Mock decidePolicyForNavigationResponse, #didReceiveAuthenticationChallenge: didReceiveAuthenticationChallenge, - }), + }, + ), + returnValue: _FakeWKNavigationDelegate_4( + this, + Invocation.method( + #createNavigationDelegate, + [], + { + #didFinishNavigation: didFinishNavigation, + #didStartProvisionalNavigation: didStartProvisionalNavigation, + #decidePolicyForNavigationAction: decidePolicyForNavigationAction, + #didFailNavigation: didFailNavigation, + #didFailProvisionalNavigation: didFailProvisionalNavigation, + #webViewWebContentProcessDidTerminate: + webViewWebContentProcessDidTerminate, + #decidePolicyForNavigationResponse: + decidePolicyForNavigationResponse, + #didReceiveAuthenticationChallenge: + didReceiveAuthenticationChallenge, + }, + ), ), ) as _i2.WKNavigationDelegate); } @@ -1501,17 +2119,26 @@ class MockWKWebpagePreferences extends _i1.Mock @override _i4.Future setAllowsContentJavaScript(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsContentJavaScript, [allow]), + Invocation.method( + #setAllowsContentJavaScript, + [allow], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override _i2.WKWebpagePreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeWKWebpagePreferences_11( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeWKWebpagePreferences_12( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebpagePreferences); @@ -1522,15 +2149,31 @@ class MockWKWebpagePreferences extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i4.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i4.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart index d7f7b5898799..577d3b9eba56 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -16,7 +17,12 @@ import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; import 'webkit_navigation_delegate_test.mocks.dart'; -@GenerateMocks([URLAuthenticationChallenge, URLRequest, URL]) +@GenerateMocks([ + URLAuthenticationChallenge, + URLProtectionSpace, + URLRequest, + URL, +]) void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -54,10 +60,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -92,10 +99,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -134,10 +142,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -183,10 +192,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -231,10 +241,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -286,10 +297,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -342,10 +354,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -399,10 +412,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -433,13 +447,13 @@ void main() { WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( newWKNavigationDelegate: CapturingNavigationDelegate.new, - newAuthenticationChallengeResponse: ({ - required UrlSessionAuthChallengeDisposition disposition, + createAsyncAuthenticationChallengeResponse: ( + UrlSessionAuthChallengeDisposition disposition, URLCredential? credential, - }) { + ) async { return AuthenticationChallengeResponse.pigeon_detached( - disposition: UrlSessionAuthChallengeDisposition - .cancelAuthenticationChallenge, + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, pigeon_instanceManager: TestInstanceManager(), ); }, @@ -488,10 +502,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -505,36 +520,53 @@ void main() { }); test('onHttpNtlmAuthRequest emits host and realm', () async { + const String expectedUser = 'user'; + const String expectedPassword = 'password'; + const UrlCredentialPersistence expectedPersistence = + UrlCredentialPersistence.forSession; + final WebKitNavigationDelegate iosNavigationDelegate = WebKitNavigationDelegate( WebKitNavigationDelegateCreationParams( webKitProxy: WebKitProxy( - newWKNavigationDelegate: CapturingNavigationDelegate.new, - newAuthenticationChallengeResponse: ({ - required UrlSessionAuthChallengeDisposition disposition, - URLCredential? credential, - }) { - return AuthenticationChallengeResponse.pigeon_detached( - disposition: UrlSessionAuthChallengeDisposition - .cancelAuthenticationChallenge, - pigeon_instanceManager: TestInstanceManager(), - ); - }, - ), + newWKNavigationDelegate: CapturingNavigationDelegate.new, + createAsyncAuthenticationChallengeResponse: ( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: disposition, + credential: credential, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + withUserAsyncURLCredential: ( + String user, + String password, + UrlCredentialPersistence persistence, + ) async { + expect(user, expectedUser); + expect(password, expectedPassword); + expect(persistence, expectedPersistence); + return URLCredential.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + }), ), ); String? callbackHost; String? callbackRealm; - const String user = 'user'; - const String password = 'password'; await iosNavigationDelegate.setOnHttpAuthRequest( (HttpAuthRequest request) { callbackHost = request.host; callbackRealm = request.realm; request.onProceed( - const WebViewCredential(user: user, password: password), + const WebViewCredential( + user: expectedUser, + password: expectedPassword, + ), ); }, ); @@ -544,7 +576,7 @@ void main() { final MockURLAuthenticationChallenge mockChallenge = MockURLAuthenticationChallenge(); - when(mockChallenge.getProtectionSpace()).thenAnswer( + when(mockChallenge.getProtectionSpace()).thenAnswer(expectAsync1( (_) { return Future.value( URLProtectionSpace.pigeon_detached( @@ -556,11 +588,11 @@ void main() { ), ); }, - ); + )); - final List result = await CapturingNavigationDelegate - .lastCreatedDelegate - .didReceiveAuthenticationChallenge( + final AuthenticationChallengeResponse result = + await CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( WKNavigationDelegate.pigeon_detached( pigeon_instanceManager: TestInstanceManager(), decidePolicyForNavigationAction: (_, __, ___) async { @@ -570,10 +602,11 @@ void main() { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ), WKWebView.pigeon_detached( @@ -582,17 +615,237 @@ void main() { mockChallenge, ); - expect(result[0], UrlSessionAuthChallengeDisposition.useCredential); - expect(result[1], containsPair('user', user)); - expect(result[1], containsPair('password', password)); expect( - result[1], - containsPair('persistence', UrlCredentialPersistence.forSession), + result.disposition, + UrlSessionAuthChallengeDisposition.useCredential, ); expect(callbackHost, expectedHost); expect(callbackRealm, expectedRealm); }); + + test('setOnSSlAuthError', () async { + const String exceptionCode = 'code'; + const String exceptionMessage = 'message'; + final Uint8List copiedExceptions = Uint8List(0); + final SecCertificate leafCertificate = SecCertificate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + final Uint8List certificateData = Uint8List(0); + + final WebKitNavigationDelegate iosNavigationDelegate = + WebKitNavigationDelegate( + WebKitNavigationDelegateCreationParams( + webKitProxy: WebKitProxy( + newWKNavigationDelegate: CapturingNavigationDelegate.new, + createAsyncAuthenticationChallengeResponse: ( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: disposition, + credential: credential, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + serverTrustAsyncURLCredential: (_) async { + return URLCredential.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + }, + evaluateWithErrorSecTrust: (_) async { + throw PlatformException( + code: exceptionCode, + message: exceptionMessage, + ); + }, + copyExceptionsSecTrust: (_) async => copiedExceptions, + setExceptionsSecTrust: expectAsync2( + (_, Uint8List? exceptions) async { + expect(exceptions, copiedExceptions); + return true; + }, + ), + getTrustResultSecTrust: (_) async { + return GetTrustResultResponse.pigeon_detached( + result: DartSecTrustResultType.recoverableTrustFailure, + resultCode: 0, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + copyCertificateChainSecTrust: (_) async { + return [leafCertificate]; + }, + copyDataSecCertificate: (_) async => certificateData, + ), + ), + ); + + Completer errorCompleter = + Completer(); + await iosNavigationDelegate.setOnSSlAuthError( + (PlatformSslAuthError error) { + errorCompleter.complete(error); + }, + ); + + const int port = 65; + const String host = 'host'; + + final MockURLAuthenticationChallenge mockChallenge = + MockURLAuthenticationChallenge(); + final SecTrust testTrust = SecTrust.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + when(mockChallenge.getProtectionSpace()).thenAnswer( + (_) async { + final MockURLProtectionSpace mockProtectionSpace = + MockURLProtectionSpace(); + when(mockProtectionSpace.port).thenReturn(port); + when(mockProtectionSpace.host).thenReturn(host); + when(mockProtectionSpace.authenticationMethod).thenReturn( + NSUrlAuthenticationMethod.serverTrust, + ); + when(mockProtectionSpace.getServerTrust()).thenAnswer( + (_) async => testTrust, + ); + return mockProtectionSpace; + }, + ); + + final WKNavigationDelegate testDelegate = + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ); + final WKWebView testWebView = WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + + Future authReplyFuture = + CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( + testDelegate, + testWebView, + mockChallenge, + ); + + WebKitSslAuthError error = + await errorCompleter.future as WebKitSslAuthError; + expect(error.certificate?.data, certificateData); + expect(error.description, '$exceptionCode: $exceptionMessage'); + expect(error.host, host); + expect(error.port, port); + + // Test proceed. + await error.proceed(); + + AuthenticationChallengeResponse authReply = await authReplyFuture; + expect( + authReply.disposition, + UrlSessionAuthChallengeDisposition.useCredential, + ); + + // Test cancel. + errorCompleter = Completer(); + authReplyFuture = CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( + testDelegate, + testWebView, + mockChallenge, + ); + + error = await errorCompleter.future as WebKitSslAuthError; + await error.cancel(); + + authReply = await authReplyFuture; + expect( + authReply.disposition, + UrlSessionAuthChallengeDisposition.cancelAuthenticationChallenge, + ); + }); + + test( + 'didReceiveAuthenticationChallenge calls performDefaultHandling by default', + () async { + WebKitNavigationDelegate( + WebKitNavigationDelegateCreationParams( + webKitProxy: WebKitProxy( + newWKNavigationDelegate: CapturingNavigationDelegate.new, + createAsyncAuthenticationChallengeResponse: ( + UrlSessionAuthChallengeDisposition disposition, + URLCredential? credential, + ) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: disposition, + credential: credential, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ), + ), + ); + + final MockURLAuthenticationChallenge mockChallenge = + MockURLAuthenticationChallenge(); + when(mockChallenge.getProtectionSpace()).thenAnswer( + (_) async { + final MockURLProtectionSpace mockProtectionSpace = + MockURLProtectionSpace(); + when(mockProtectionSpace.authenticationMethod).thenReturn( + NSUrlAuthenticationMethod.httpBasic, + ); + return mockProtectionSpace; + }, + ); + + final WKNavigationDelegate testDelegate = + WKNavigationDelegate.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + decidePolicyForNavigationAction: (_, __, ___) async { + return NavigationActionPolicy.cancel; + }, + decidePolicyForNavigationResponse: (_, __, ___) async { + return NavigationResponsePolicy.cancel; + }, + didReceiveAuthenticationChallenge: (_, __, ___) async { + return AuthenticationChallengeResponse.pigeon_detached( + disposition: + UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); + }, + ); + final WKWebView testWebView = WKWebView.pigeon_detached( + pigeon_instanceManager: TestInstanceManager(), + ); + + final AuthenticationChallengeResponse authReply = + await CapturingNavigationDelegate.lastCreatedDelegate + .didReceiveAuthenticationChallenge( + testDelegate, + testWebView, + mockChallenge, + ); + + expect( + authReply.disposition, + UrlSessionAuthChallengeDisposition.performDefaultHandling, + ); + expect(authReply.credential, isNull); + }); }); } @@ -619,10 +872,10 @@ class CapturingNavigationDelegate extends WKNavigationDelegate { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart index 503c38a6dc5d..b2339f363f67 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.mocks.dart @@ -1,13 +1,13 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:typed_data' as _i4; +import 'dart:typed_data' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; +import 'package:mockito/src/dummies.dart' as _i4; import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; // ignore_for_file: type=lint @@ -26,30 +26,55 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURLProtectionSpace_1 extends _i1.SmartFake implements _i2.URLProtectionSpace { - _FakeURLProtectionSpace_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURLProtectionSpace_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURLAuthenticationChallenge_2 extends _i1.SmartFake implements _i2.URLAuthenticationChallenge { - _FakeURLAuthenticationChallenge_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURLAuthenticationChallenge_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURLRequest_3 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURLRequest_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURL_4 extends _i1.SmartFake implements _i2.URL { - _FakeURL_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURL_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [URLAuthenticationChallenge]. @@ -73,21 +98,32 @@ class MockURLAuthenticationChallenge extends _i1.Mock @override _i3.Future<_i2.URLProtectionSpace> getProtectionSpace() => (super.noSuchMethod( - Invocation.method(#getProtectionSpace, []), - returnValue: _i3.Future<_i2.URLProtectionSpace>.value( - _FakeURLProtectionSpace_1( - this, - Invocation.method(#getProtectionSpace, []), - ), + Invocation.method( + #getProtectionSpace, + [], ), + returnValue: + _i3.Future<_i2.URLProtectionSpace>.value(_FakeURLProtectionSpace_1( + this, + Invocation.method( + #getProtectionSpace, + [], + ), + )), ) as _i3.Future<_i2.URLProtectionSpace>); @override _i2.URLAuthenticationChallenge pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeURLAuthenticationChallenge_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.URLAuthenticationChallenge); @@ -98,15 +134,125 @@ class MockURLAuthenticationChallenge extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); +} + +/// A class which mocks [URLProtectionSpace]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockURLProtectionSpace extends _i1.Mock + implements _i2.URLProtectionSpace { + MockURLProtectionSpace() { + _i1.throwOnMissingStub(this); + } + + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: _i4.dummyValue( + this, + Invocation.getter(#host), + ), + ) as String); + + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future<_i2.SecTrust?> getServerTrust() => (super.noSuchMethod( + Invocation.method( + #getServerTrust, + [], + ), + returnValue: _i3.Future<_i2.SecTrust?>.value(), + ) as _i3.Future<_i2.SecTrust?>); + + @override + _i2.URLProtectionSpace pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeURLProtectionSpace_1( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.URLProtectionSpace); + + @override + _i3.Future addObserver( + _i2.NSObject? observer, + String? keyPath, + List<_i2.KeyValueObservingOptions>? options, + ) => + (super.noSuchMethod( + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => + (super.noSuchMethod( + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -131,40 +277,58 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), + Invocation.method( + #setHttpMethod, + [method], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), + Invocation.method( + #getHttpMethod, + [], + ), returnValue: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future setHttpBody(_i4.Uint8List? body) => (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), + _i3.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( + Invocation.method( + #setHttpBody, + [body], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future<_i4.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method(#getHttpBody, []), - returnValue: _i3.Future<_i4.Uint8List?>.value(), - ) as _i3.Future<_i4.Uint8List?>); + _i3.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( + Invocation.method( + #getHttpBody, + [], + ), + returnValue: _i3.Future<_i5.Uint8List?>.value(), + ) as _i3.Future<_i5.Uint8List?>); @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), + Invocation.method( + #setAllHttpHeaderFields, + [fields], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -172,16 +336,25 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), + Invocation.method( + #getAllHttpHeaderFields, + [], + ), returnValue: _i3.Future?>.value(), ) as _i3.Future?>); @override _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeURLRequest_3( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.URLRequest); @@ -192,15 +365,31 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -225,19 +414,32 @@ class MockURL extends _i1.Mock implements _i2.URL { @override _i3.Future getAbsoluteString() => (super.noSuchMethod( - Invocation.method(#getAbsoluteString, []), - returnValue: _i3.Future.value( - _i5.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), - ), + Invocation.method( + #getAbsoluteString, + [], ), + returnValue: _i3.Future.value(_i4.dummyValue( + this, + Invocation.method( + #getAbsoluteString, + [], + ), + )), ) as _i3.Future); @override _i2.URL pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURL_4(this, Invocation.method(#pigeon_copy, [])), + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeURL_4( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), ) as _i2.URL); @override @@ -247,15 +449,31 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart index c31ee0f790f2..342c18bfcc3c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart @@ -1923,10 +1923,10 @@ class CapturingNavigationDelegate extends WKNavigationDelegate { return NavigationResponsePolicy.cancel; }, didReceiveAuthenticationChallenge: (_, __, ___) async { - return [ - UrlSessionAuthChallengeDisposition.performDefaultHandling, - null, - ]; + return AuthenticationChallengeResponse.pigeon_detached( + disposition: UrlSessionAuthChallengeDisposition.performDefaultHandling, + pigeon_instanceManager: TestInstanceManager(), + ); }, ); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart index 3bbeec9f6c3a..d1788f4bc49c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/webkit_webview_controller_test.dart. // Do not manually edit this file. @@ -26,86 +26,161 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeUIScrollView_1 extends _i1.SmartFake implements _i2.UIScrollView { - _FakeUIScrollView_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIScrollView_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeUIScrollViewDelegate_2 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { - _FakeUIScrollViewDelegate_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIScrollViewDelegate_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURL_3 extends _i1.SmartFake implements _i2.URL { - _FakeURL_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURL_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeURLRequest_4 extends _i1.SmartFake implements _i2.URLRequest { - _FakeURLRequest_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeURLRequest_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKPreferences_5 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKPreferences_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKScriptMessageHandler_6 extends _i1.SmartFake implements _i2.WKScriptMessageHandler { - _FakeWKScriptMessageHandler_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKScriptMessageHandler_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKUserContentController_7 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKUserContentController_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKUserScript_8 extends _i1.SmartFake implements _i2.WKUserScript { - _FakeWKUserScript_8(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKUserScript_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebView_9 extends _i1.SmartFake implements _i2.WKWebView { - _FakeWKWebView_9(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebView_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebsiteDataStore_10 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_10(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebsiteDataStore_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebpagePreferences_11 extends _i1.SmartFake implements _i2.WKWebpagePreferences { - _FakeWKWebpagePreferences_11(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebpagePreferences_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebViewConfiguration_12 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebViewConfiguration_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeUIViewWKWebView_13 extends _i1.SmartFake implements _i2.UIViewWKWebView { - _FakeUIViewWKWebView_13(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIViewWKWebView_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKHTTPCookieStore_14 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_14(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKHTTPCookieStore_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [UIScrollView]. @@ -127,24 +202,44 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i3.Future> getContentOffset() => (super.noSuchMethod( - Invocation.method(#getContentOffset, []), - returnValue: _i3.Future>.value([]), - returnValueForMissingStub: _i3.Future>.value( - [], + Invocation.method( + #getContentOffset, + [], ), + returnValue: _i3.Future>.value([]), + returnValueForMissingStub: _i3.Future>.value([]), ) as _i3.Future>); @override - _i3.Future scrollBy(double? x, double? y) => (super.noSuchMethod( - Invocation.method(#scrollBy, [x, y]), + _i3.Future scrollBy( + double? x, + double? y, + ) => + (super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + x, + y, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future setContentOffset(double? x, double? y) => + _i3.Future setContentOffset( + double? x, + double? y, + ) => (super.noSuchMethod( - Invocation.method(#setContentOffset, [x, y]), + Invocation.method( + #setContentOffset, + [ + x, + y, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -152,35 +247,50 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i3.Future setDelegate(_i2.UIScrollViewDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setDelegate, [delegate]), + Invocation.method( + #setDelegate, + [delegate], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setBounces(bool? value) => (super.noSuchMethod( - Invocation.method(#setBounces, [value]), + Invocation.method( + #setBounces, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setBouncesHorizontally(bool? value) => (super.noSuchMethod( - Invocation.method(#setBouncesHorizontally, [value]), + Invocation.method( + #setBouncesHorizontally, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setBouncesVertically(bool? value) => (super.noSuchMethod( - Invocation.method(#setBouncesVertically, [value]), + Invocation.method( + #setBouncesVertically, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setAlwaysBounceVertical(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceVertical, [value]), + Invocation.method( + #setAlwaysBounceVertical, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -188,34 +298,52 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { @override _i3.Future setAlwaysBounceHorizontal(bool? value) => (super.noSuchMethod( - Invocation.method(#setAlwaysBounceHorizontal, [value]), + Invocation.method( + #setAlwaysBounceHorizontal, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.UIScrollView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeUIScrollView_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeUIScrollView_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIScrollView); @override _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), + Invocation.method( + #setBackgroundColor, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), + Invocation.method( + #setOpaque, + [opaque], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -227,15 +355,31 @@ class MockUIScrollView extends _i1.Mock implements _i2.UIScrollView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -261,14 +405,23 @@ class MockUIScrollViewDelegate extends _i1.Mock @override _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeUIScrollViewDelegate_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeUIScrollViewDelegate_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIScrollViewDelegate); @@ -279,15 +432,31 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -312,28 +481,46 @@ class MockURL extends _i1.Mock implements _i2.URL { @override _i3.Future getAbsoluteString() => (super.noSuchMethod( - Invocation.method(#getAbsoluteString, []), - returnValue: _i3.Future.value( - _i4.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), - ), + Invocation.method( + #getAbsoluteString, + [], ), - returnValueForMissingStub: _i3.Future.value( - _i4.dummyValue( - this, - Invocation.method(#getAbsoluteString, []), + returnValue: _i3.Future.value(_i4.dummyValue( + this, + Invocation.method( + #getAbsoluteString, + [], ), - ), + )), + returnValueForMissingStub: + _i3.Future.value(_i4.dummyValue( + this, + Invocation.method( + #getAbsoluteString, + [], + ), + )), ) as _i3.Future); @override _i2.URL pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), - returnValue: _FakeURL_3(this, Invocation.method(#pigeon_copy, [])), + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeURL_3( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), returnValueForMissingStub: _FakeURL_3( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.URL); @@ -344,15 +531,31 @@ class MockURL extends _i1.Mock implements _i2.URL { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -377,35 +580,50 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setHttpMethod(String? method) => (super.noSuchMethod( - Invocation.method(#setHttpMethod, [method]), + Invocation.method( + #setHttpMethod, + [method], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getHttpMethod() => (super.noSuchMethod( - Invocation.method(#getHttpMethod, []), + Invocation.method( + #getHttpMethod, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setHttpBody(_i5.Uint8List? body) => (super.noSuchMethod( - Invocation.method(#setHttpBody, [body]), + Invocation.method( + #setHttpBody, + [body], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future<_i5.Uint8List?> getHttpBody() => (super.noSuchMethod( - Invocation.method(#getHttpBody, []), + Invocation.method( + #getHttpBody, + [], + ), returnValue: _i3.Future<_i5.Uint8List?>.value(), returnValueForMissingStub: _i3.Future<_i5.Uint8List?>.value(), ) as _i3.Future<_i5.Uint8List?>); @@ -413,7 +631,10 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i3.Future setAllHttpHeaderFields(Map? fields) => (super.noSuchMethod( - Invocation.method(#setAllHttpHeaderFields, [fields]), + Invocation.method( + #setAllHttpHeaderFields, + [fields], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -421,21 +642,33 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { @override _i3.Future?> getAllHttpHeaderFields() => (super.noSuchMethod( - Invocation.method(#getAllHttpHeaderFields, []), + Invocation.method( + #getAllHttpHeaderFields, + [], + ), returnValue: _i3.Future?>.value(), returnValueForMissingStub: _i3.Future?>.value(), ) as _i3.Future?>); @override _i2.URLRequest pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeURLRequest_4( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeURLRequest_4( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.URLRequest); @@ -446,15 +679,31 @@ class MockURLRequest extends _i1.Mock implements _i2.URLRequest { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -479,21 +728,33 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { @override _i3.Future setJavaScriptEnabled(bool? enabled) => (super.noSuchMethod( - Invocation.method(#setJavaScriptEnabled, [enabled]), + Invocation.method( + #setJavaScriptEnabled, + [enabled], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.WKPreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKPreferences_5( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKPreferences_5( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKPreferences); @@ -504,15 +765,31 @@ class MockWKPreferences extends _i1.Mock implements _i2.WKPreferences { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -561,14 +838,23 @@ class MockWKScriptMessageHandler extends _i1.Mock @override _i2.WKScriptMessageHandler pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKScriptMessageHandler_6( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKScriptMessageHandler_6( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKScriptMessageHandler); @@ -579,15 +865,31 @@ class MockWKScriptMessageHandler extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -617,7 +919,13 @@ class MockWKUserContentController extends _i1.Mock String? name, ) => (super.noSuchMethod( - Invocation.method(#addScriptMessageHandler, [handler, name]), + Invocation.method( + #addScriptMessageHandler, + [ + handler, + name, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -625,14 +933,20 @@ class MockWKUserContentController extends _i1.Mock @override _i3.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( - Invocation.method(#removeScriptMessageHandler, [name]), + Invocation.method( + #removeScriptMessageHandler, + [name], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( - Invocation.method(#removeAllScriptMessageHandlers, []), + Invocation.method( + #removeAllScriptMessageHandlers, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -640,28 +954,43 @@ class MockWKUserContentController extends _i1.Mock @override _i3.Future addUserScript(_i2.WKUserScript? userScript) => (super.noSuchMethod( - Invocation.method(#addUserScript, [userScript]), + Invocation.method( + #addUserScript, + [userScript], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future removeAllUserScripts() => (super.noSuchMethod( - Invocation.method(#removeAllUserScripts, []), + Invocation.method( + #removeAllUserScripts, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.WKUserContentController pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKUserContentController_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKUserContentController_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKUserContentController); @@ -672,15 +1001,31 @@ class MockWKUserContentController extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -732,14 +1077,23 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { @override _i2.WKUserScript pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKUserScript_8( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKUserScript_8( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKUserScript); @@ -750,15 +1104,31 @@ class MockWKUserScript extends _i1.Mock implements _i2.WKUserScript { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -783,14 +1153,23 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { @override _i2.WKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebView_9( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKWebView_9( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebView); @@ -801,15 +1180,31 @@ class MockWKWebView extends _i1.Mock implements _i2.WKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -835,10 +1230,12 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future setUserContentController( - _i2.WKUserContentController? controller, - ) => + _i2.WKUserContentController? controller) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), + Invocation.method( + #setUserContentController, + [controller], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -846,26 +1243,36 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method(#getUserContentController, []), + Invocation.method( + #getUserContentController, + [], + ), returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method(#getUserContentController, []), + _FakeWKUserContentController_7( + this, + Invocation.method( + #getUserContentController, + [], ), - ), + )), returnValueForMissingStub: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_7( - this, - Invocation.method(#getUserContentController, []), + _FakeWKUserContentController_7( + this, + Invocation.method( + #getUserContentController, + [], ), - ), + )), ) as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), + Invocation.method( + #setWebsiteDataStore, + [dataStore], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -873,50 +1280,69 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method(#getWebsiteDataStore, []), - returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#getWebsiteDataStore, []), - ), + Invocation.method( + #getWebsiteDataStore, + [], ), - returnValueForMissingStub: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_10( - this, - Invocation.method(#getWebsiteDataStore, []), + returnValue: + _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_10( + this, + Invocation.method( + #getWebsiteDataStore, + [], ), - ), + )), + returnValueForMissingStub: + _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_10( + this, + Invocation.method( + #getWebsiteDataStore, + [], + ), + )), ) as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), + Invocation.method( + #setPreferences, + [preferences], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method(#getPreferences, []), - returnValue: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_5( - this, - Invocation.method(#getPreferences, []), - ), + Invocation.method( + #getPreferences, + [], ), - returnValueForMissingStub: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_5( - this, - Invocation.method(#getPreferences, []), + returnValue: _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_5( + this, + Invocation.method( + #getPreferences, + [], ), - ), + )), + returnValueForMissingStub: + _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_5( + this, + Invocation.method( + #getPreferences, + [], + ), + )), ) as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + Invocation.method( + #setAllowsInlineMediaPlayback, + [allow], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -924,19 +1350,22 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + Invocation.method( + #setLimitsNavigationsToAppBoundDomains, + [limit], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type, - ) => + _i2.AudiovisualMediaType? type) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), + Invocation.method( + #setMediaTypesRequiringUserActionForPlayback, + [type], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -944,31 +1373,47 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( - Invocation.method(#getDefaultWebpagePreferences, []), + Invocation.method( + #getDefaultWebpagePreferences, + [], + ), returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - this, - Invocation.method(#getDefaultWebpagePreferences, []), + _FakeWKWebpagePreferences_11( + this, + Invocation.method( + #getDefaultWebpagePreferences, + [], ), - ), + )), returnValueForMissingStub: _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_11( - this, - Invocation.method(#getDefaultWebpagePreferences, []), + _FakeWKWebpagePreferences_11( + this, + Invocation.method( + #getDefaultWebpagePreferences, + [], ), - ), + )), ) as _i3.Future<_i2.WKWebpagePreferences>); @override _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebViewConfiguration_12( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKWebViewConfiguration_12( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebViewConfiguration); @@ -979,15 +1424,31 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1014,21 +1475,33 @@ class MockWKWebpagePreferences extends _i1.Mock @override _i3.Future setAllowsContentJavaScript(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsContentJavaScript, [allow]), + Invocation.method( + #setAllowsContentJavaScript, + [allow], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.WKWebpagePreferences pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebpagePreferences_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKWebpagePreferences_11( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebpagePreferences); @@ -1039,15 +1512,31 @@ class MockWKWebpagePreferences extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1098,34 +1587,55 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i2.WKWebViewConfiguration pigeonVar_configuration() => (super.noSuchMethod( - Invocation.method(#pigeonVar_configuration, []), + Invocation.method( + #pigeonVar_configuration, + [], + ), returnValue: _FakeWKWebViewConfiguration_12( this, - Invocation.method(#pigeonVar_configuration, []), + Invocation.method( + #pigeonVar_configuration, + [], + ), ), returnValueForMissingStub: _FakeWKWebViewConfiguration_12( this, - Invocation.method(#pigeonVar_configuration, []), + Invocation.method( + #pigeonVar_configuration, + [], + ), ), ) as _i2.WKWebViewConfiguration); @override _i2.UIScrollView pigeonVar_scrollView() => (super.noSuchMethod( - Invocation.method(#pigeonVar_scrollView, []), + Invocation.method( + #pigeonVar_scrollView, + [], + ), returnValue: _FakeUIScrollView_1( this, - Invocation.method(#pigeonVar_scrollView, []), + Invocation.method( + #pigeonVar_scrollView, + [], + ), ), returnValueForMissingStub: _FakeUIScrollView_1( this, - Invocation.method(#pigeonVar_scrollView, []), + Invocation.method( + #pigeonVar_scrollView, + [], + ), ), ) as _i2.UIScrollView); @override _i3.Future setUIDelegate(_i2.WKUIDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setUIDelegate, [delegate]), + Invocation.method( + #setUIDelegate, + [delegate], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1133,93 +1643,144 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i3.Future setNavigationDelegate(_i2.WKNavigationDelegate? delegate) => (super.noSuchMethod( - Invocation.method(#setNavigationDelegate, [delegate]), + Invocation.method( + #setNavigationDelegate, + [delegate], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getUrl() => (super.noSuchMethod( - Invocation.method(#getUrl, []), + Invocation.method( + #getUrl, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getEstimatedProgress() => (super.noSuchMethod( - Invocation.method(#getEstimatedProgress, []), + Invocation.method( + #getEstimatedProgress, + [], + ), returnValue: _i3.Future.value(0.0), returnValueForMissingStub: _i3.Future.value(0.0), ) as _i3.Future); @override _i3.Future load(_i2.URLRequest? request) => (super.noSuchMethod( - Invocation.method(#load, [request]), + Invocation.method( + #load, + [request], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future loadHtmlString(String? string, String? baseUrl) => + _i3.Future loadHtmlString( + String? string, + String? baseUrl, + ) => (super.noSuchMethod( - Invocation.method(#loadHtmlString, [string, baseUrl]), + Invocation.method( + #loadHtmlString, + [ + string, + baseUrl, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future loadFileUrl(String? url, String? readAccessUrl) => + _i3.Future loadFileUrl( + String? url, + String? readAccessUrl, + ) => (super.noSuchMethod( - Invocation.method(#loadFileUrl, [url, readAccessUrl]), + Invocation.method( + #loadFileUrl, + [ + url, + readAccessUrl, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future loadFlutterAsset(String? key) => (super.noSuchMethod( - Invocation.method(#loadFlutterAsset, [key]), + Invocation.method( + #loadFlutterAsset, + [key], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future canGoBack() => (super.noSuchMethod( - Invocation.method(#canGoBack, []), + Invocation.method( + #canGoBack, + [], + ), returnValue: _i3.Future.value(false), returnValueForMissingStub: _i3.Future.value(false), ) as _i3.Future); @override _i3.Future canGoForward() => (super.noSuchMethod( - Invocation.method(#canGoForward, []), + Invocation.method( + #canGoForward, + [], + ), returnValue: _i3.Future.value(false), returnValueForMissingStub: _i3.Future.value(false), ) as _i3.Future); @override _i3.Future goBack() => (super.noSuchMethod( - Invocation.method(#goBack, []), + Invocation.method( + #goBack, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future goForward() => (super.noSuchMethod( - Invocation.method(#goForward, []), + Invocation.method( + #goForward, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future reload() => (super.noSuchMethod( - Invocation.method(#reload, []), + Invocation.method( + #reload, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getTitle() => (super.noSuchMethod( - Invocation.method(#getTitle, []), + Invocation.method( + #getTitle, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1227,14 +1788,20 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i3.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsBackForwardNavigationGestures, [allow]), + Invocation.method( + #setAllowsBackForwardNavigationGestures, + [allow], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( - Invocation.method(#setCustomUserAgent, [userAgent]), + Invocation.method( + #setCustomUserAgent, + [userAgent], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1242,55 +1809,82 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { @override _i3.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( - Invocation.method(#evaluateJavaScript, [javaScriptString]), + Invocation.method( + #evaluateJavaScript, + [javaScriptString], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setInspectable(bool? inspectable) => (super.noSuchMethod( - Invocation.method(#setInspectable, [inspectable]), + Invocation.method( + #setInspectable, + [inspectable], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future getCustomUserAgent() => (super.noSuchMethod( - Invocation.method(#getCustomUserAgent, []), + Invocation.method( + #getCustomUserAgent, + [], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setAllowsLinkPreview(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsLinkPreview, [allow]), + Invocation.method( + #setAllowsLinkPreview, + [allow], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.UIViewWKWebView pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeUIViewWKWebView_13( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeUIViewWKWebView_13( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIViewWKWebView); @override _i3.Future setBackgroundColor(int? value) => (super.noSuchMethod( - Invocation.method(#setBackgroundColor, [value]), + Invocation.method( + #setBackgroundColor, + [value], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method(#setOpaque, [opaque]), + Invocation.method( + #setOpaque, + [opaque], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1302,15 +1896,31 @@ class MockUIViewWKWebView extends _i1.Mock implements _i2.UIViewWKWebView { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -1349,14 +1959,23 @@ class MockWKWebsiteDataStore extends _i1.Mock @override _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), returnValue: _FakeWKHTTPCookieStore_14( this, - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), ), returnValueForMissingStub: _FakeWKHTTPCookieStore_14( this, - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -1366,24 +1985,36 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), + Invocation.method( + #removeDataOfTypes, + [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ], + ), returnValue: _i3.Future.value(false), returnValueForMissingStub: _i3.Future.value(false), ) as _i3.Future); @override _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebsiteDataStore_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), returnValueForMissingStub: _FakeWKWebsiteDataStore_10( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebsiteDataStore); @@ -1394,15 +2025,31 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart index d494fbba2091..ddf329765f33 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart. // Do not manually edit this file. @@ -24,20 +24,35 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakeWKHTTPCookieStore_0 extends _i1.SmartFake implements _i2.WKHTTPCookieStore { - _FakeWKHTTPCookieStore_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKHTTPCookieStore_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakePigeonInstanceManager_1 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebsiteDataStore_2 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebsiteDataStore_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [WKWebsiteDataStore]. @@ -69,10 +84,16 @@ class MockWKWebsiteDataStore extends _i1.Mock @override _i2.WKHTTPCookieStore pigeonVar_httpCookieStore() => (super.noSuchMethod( - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), returnValue: _FakeWKHTTPCookieStore_0( this, - Invocation.method(#pigeonVar_httpCookieStore, []), + Invocation.method( + #pigeonVar_httpCookieStore, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -82,19 +103,28 @@ class MockWKWebsiteDataStore extends _i1.Mock double? modificationTimeInSecondsSinceEpoch, ) => (super.noSuchMethod( - Invocation.method(#removeDataOfTypes, [ - dataTypes, - modificationTimeInSecondsSinceEpoch, - ]), + Invocation.method( + #removeDataOfTypes, + [ + dataTypes, + modificationTimeInSecondsSinceEpoch, + ], + ), returnValue: _i3.Future.value(false), ) as _i3.Future); @override _i2.WKWebsiteDataStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebsiteDataStore_2( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebsiteDataStore); @@ -105,15 +135,31 @@ class MockWKWebsiteDataStore extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -138,17 +184,26 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { @override _i3.Future setCookie(_i2.HTTPCookie? cookie) => (super.noSuchMethod( - Invocation.method(#setCookie, [cookie]), + Invocation.method( + #setCookie, + [cookie], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i2.WKHTTPCookieStore pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKHTTPCookieStore_0( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKHTTPCookieStore); @@ -159,15 +214,31 @@ class MockWKHTTPCookieStore extends _i1.Mock implements _i2.WKHTTPCookieStore { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart index ce4ab60e4a0e..c25e07f617dd 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.6 from annotations // in webview_flutter_wkwebview/test/webkit_webview_widget_test.dart. // Do not manually edit this file. @@ -24,48 +24,88 @@ import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i2; class _FakePigeonInstanceManager_0 extends _i1.SmartFake implements _i2.PigeonInstanceManager { - _FakePigeonInstanceManager_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKUIDelegate_1 extends _i1.SmartFake implements _i2.WKUIDelegate { - _FakeWKUIDelegate_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKUIDelegate_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKUserContentController_2 extends _i1.SmartFake implements _i2.WKUserContentController { - _FakeWKUserContentController_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKUserContentController_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebsiteDataStore_3 extends _i1.SmartFake implements _i2.WKWebsiteDataStore { - _FakeWKWebsiteDataStore_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebsiteDataStore_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKPreferences_4 extends _i1.SmartFake implements _i2.WKPreferences { - _FakeWKPreferences_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKPreferences_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebpagePreferences_5 extends _i1.SmartFake implements _i2.WKWebpagePreferences { - _FakeWKWebpagePreferences_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebpagePreferences_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeWKWebViewConfiguration_6 extends _i1.SmartFake implements _i2.WKWebViewConfiguration { - _FakeWKWebViewConfiguration_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeWKWebViewConfiguration_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeUIScrollViewDelegate_7 extends _i1.SmartFake implements _i2.UIScrollViewDelegate { - _FakeUIScrollViewDelegate_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeUIScrollViewDelegate_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [WKUIDelegate]. @@ -93,8 +133,7 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { _i2.MediaCaptureType type, ) => _i3.Future<_i2.PermissionDecision>.value( - _i2.PermissionDecision.deny, - ), + _i2.PermissionDecision.deny), ) as _i3.Future<_i2.PermissionDecision> Function( _i2.WKUIDelegate, _i2.WKWebView, @@ -136,10 +175,16 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { @override _i2.WKUIDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKUIDelegate_1( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKUIDelegate); @@ -150,15 +195,31 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -184,10 +245,12 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future setUserContentController( - _i2.WKUserContentController? controller, - ) => + _i2.WKUserContentController? controller) => (super.noSuchMethod( - Invocation.method(#setUserContentController, [controller]), + Invocation.method( + #setUserContentController, + [controller], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -195,19 +258,27 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKUserContentController> getUserContentController() => (super.noSuchMethod( - Invocation.method(#getUserContentController, []), + Invocation.method( + #getUserContentController, + [], + ), returnValue: _i3.Future<_i2.WKUserContentController>.value( - _FakeWKUserContentController_2( - this, - Invocation.method(#getUserContentController, []), + _FakeWKUserContentController_2( + this, + Invocation.method( + #getUserContentController, + [], ), - ), + )), ) as _i3.Future<_i2.WKUserContentController>); @override _i3.Future setWebsiteDataStore(_i2.WKWebsiteDataStore? dataStore) => (super.noSuchMethod( - Invocation.method(#setWebsiteDataStore, [dataStore]), + Invocation.method( + #setWebsiteDataStore, + [dataStore], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -215,38 +286,53 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKWebsiteDataStore> getWebsiteDataStore() => (super.noSuchMethod( - Invocation.method(#getWebsiteDataStore, []), - returnValue: _i3.Future<_i2.WKWebsiteDataStore>.value( - _FakeWKWebsiteDataStore_3( - this, - Invocation.method(#getWebsiteDataStore, []), - ), + Invocation.method( + #getWebsiteDataStore, + [], ), + returnValue: + _i3.Future<_i2.WKWebsiteDataStore>.value(_FakeWKWebsiteDataStore_3( + this, + Invocation.method( + #getWebsiteDataStore, + [], + ), + )), ) as _i3.Future<_i2.WKWebsiteDataStore>); @override _i3.Future setPreferences(_i2.WKPreferences? preferences) => (super.noSuchMethod( - Invocation.method(#setPreferences, [preferences]), + Invocation.method( + #setPreferences, + [preferences], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future<_i2.WKPreferences> getPreferences() => (super.noSuchMethod( - Invocation.method(#getPreferences, []), - returnValue: _i3.Future<_i2.WKPreferences>.value( - _FakeWKPreferences_4( - this, - Invocation.method(#getPreferences, []), - ), + Invocation.method( + #getPreferences, + [], ), + returnValue: _i3.Future<_i2.WKPreferences>.value(_FakeWKPreferences_4( + this, + Invocation.method( + #getPreferences, + [], + ), + )), ) as _i3.Future<_i2.WKPreferences>); @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( - Invocation.method(#setAllowsInlineMediaPlayback, [allow]), + Invocation.method( + #setAllowsInlineMediaPlayback, + [allow], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -254,19 +340,22 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( - Invocation.method(#setLimitsNavigationsToAppBoundDomains, [limit]), + Invocation.method( + #setLimitsNavigationsToAppBoundDomains, + [limit], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override _i3.Future setMediaTypesRequiringUserActionForPlayback( - _i2.AudiovisualMediaType? type, - ) => + _i2.AudiovisualMediaType? type) => (super.noSuchMethod( - Invocation.method(#setMediaTypesRequiringUserActionForPlayback, [ - type, - ]), + Invocation.method( + #setMediaTypesRequiringUserActionForPlayback, + [type], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -274,21 +363,32 @@ class MockWKWebViewConfiguration extends _i1.Mock @override _i3.Future<_i2.WKWebpagePreferences> getDefaultWebpagePreferences() => (super.noSuchMethod( - Invocation.method(#getDefaultWebpagePreferences, []), + Invocation.method( + #getDefaultWebpagePreferences, + [], + ), returnValue: _i3.Future<_i2.WKWebpagePreferences>.value( - _FakeWKWebpagePreferences_5( - this, - Invocation.method(#getDefaultWebpagePreferences, []), + _FakeWKWebpagePreferences_5( + this, + Invocation.method( + #getDefaultWebpagePreferences, + [], ), - ), + )), ) as _i3.Future<_i2.WKWebpagePreferences>); @override _i2.WKWebViewConfiguration pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeWKWebViewConfiguration_6( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.WKWebViewConfiguration); @@ -299,15 +399,31 @@ class MockWKWebViewConfiguration extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @@ -333,10 +449,16 @@ class MockUIScrollViewDelegate extends _i1.Mock @override _i2.UIScrollViewDelegate pigeon_copy() => (super.noSuchMethod( - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), returnValue: _FakeUIScrollViewDelegate_7( this, - Invocation.method(#pigeon_copy, []), + Invocation.method( + #pigeon_copy, + [], + ), ), ) as _i2.UIScrollViewDelegate); @@ -347,15 +469,31 @@ class MockUIScrollViewDelegate extends _i1.Mock List<_i2.KeyValueObservingOptions>? options, ) => (super.noSuchMethod( - Invocation.method(#addObserver, [observer, keyPath, options]), + Invocation.method( + #addObserver, + [ + observer, + keyPath, + options, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - _i3.Future removeObserver(_i2.NSObject? observer, String? keyPath) => + _i3.Future removeObserver( + _i2.NSObject? observer, + String? keyPath, + ) => (super.noSuchMethod( - Invocation.method(#removeObserver, [observer, keyPath]), + Invocation.method( + #removeObserver, + [ + observer, + keyPath, + ], + ), returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future);