diff --git a/packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart b/packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart index 3060089bef40..eab518ce3b23 100644 --- a/packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart +++ b/packages/camera/camera_platform_interface/test/camera_platform_interface_test.dart @@ -18,7 +18,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { CameraPlatform.instance = ImplementsCameraPlatform(); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/platform_interface/google_maps_flutter_platform_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/platform_interface/google_maps_flutter_platform_test.dart index d185aabe1a5c..d1dba2b75b55 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/platform_interface/google_maps_flutter_platform_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/platform_interface/google_maps_flutter_platform_test.dart @@ -27,7 +27,14 @@ void main() { expect(() { GoogleMapsFlutterPlatform.instance = ImplementsGoogleMapsFlutterPlatform(); - }, throwsA(isInstanceOf())); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be mocked with `implements`', () { diff --git a/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart b/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart index bf960abc7375..6ffa85fa1e4b 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/test/google_sign_in_platform_interface_test.dart @@ -18,7 +18,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { GoogleSignInPlatform.instance = ImplementsGoogleSignInPlatform(); - }, throwsA(isA())); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/test/in_app_purchase_platform_test.dart b/packages/in_app_purchase/in_app_purchase_platform_interface/test/in_app_purchase_platform_test.dart index 9c0f2dc00020..879ad9c4c633 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/test/in_app_purchase_platform_test.dart +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/test/in_app_purchase_platform_test.dart @@ -14,7 +14,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { InAppPurchasePlatform.instance = ImplementsInAppPurchasePlatform(); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { @@ -126,7 +133,7 @@ void main() { InAppPurchasePlatformAddition.instance = null; }); - test('Cannot be implemented with `implements`', () { + test('Default instance is null', () { expect(InAppPurchasePlatformAddition.instance, isNull); }); diff --git a/packages/quick_actions/quick_actions_platform_interface/test/quick_actions_platform_interface_test.dart b/packages/quick_actions/quick_actions_platform_interface/test/quick_actions_platform_interface_test.dart index b9655dc56a3c..ab3299b0cc14 100644 --- a/packages/quick_actions/quick_actions_platform_interface/test/quick_actions_platform_interface_test.dart +++ b/packages/quick_actions/quick_actions_platform_interface/test/quick_actions_platform_interface_test.dart @@ -21,7 +21,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { QuickActionsPlatform.instance = ImplementsQuickActionsPlatform(); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/url_launcher/url_launcher_platform_interface/test/method_channel_url_launcher_test.dart b/packages/url_launcher/url_launcher_platform_interface/test/method_channel_url_launcher_test.dart index e44e80bab02c..c8ec08c53095 100644 --- a/packages/url_launcher/url_launcher_platform_interface/test/method_channel_url_launcher_test.dart +++ b/packages/url_launcher/url_launcher_platform_interface/test/method_channel_url_launcher_test.dart @@ -24,7 +24,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { UrlLauncherPlatform.instance = ImplementsUrlLauncherPlatform(); - }, throwsA(isInstanceOf())); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes + // throw a `NoSuchMethodError` and other times throw an + // `AssertionError`. After the issue is fixed, an `AssertionError` will + // always be thrown. For the purpose of this test, we don't really care + // what exception is thrown, so just allow any exception. + }, throwsA(anything)); }); test('Can be mocked with `implements`', () { diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_navigation_delegate_test.dart index 5674c1522408..dd4a26c4faf9 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_navigation_delegate_test.dart @@ -23,7 +23,14 @@ void main() { expect(() { PlatformNavigationDelegate(params); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes throw + // a `NoSuchMethodError` and other times throw an `AssertionError`. After + // the issue is fixed, an `AssertionError` will always be thrown. For the + // purpose of this test, we don't really care what exception is thrown, so + // just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_controller_test.dart index b6d043cac9c8..32374fb04484 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_controller_test.dart @@ -28,7 +28,14 @@ void main() { expect(() { PlatformWebViewController( const PlatformWebViewControllerCreationParams()); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes throw + // a `NoSuchMethodError` and other times throw an `AssertionError`. After + // the issue is fixed, an `AssertionError` will always be thrown. For the + // purpose of this test, we don't really care what exception is thrown, so + // just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_widget_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_widget_test.dart index 30fa52ece24a..ede16c162413 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/platform_webview_widget_test.dart @@ -27,7 +27,14 @@ void main() { expect(() { PlatformWebViewWidget(params); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes throw + // a `NoSuchMethodError` and other times throw an `AssertionError`. After + // the issue is fixed, an `AssertionError` will always be thrown. For the + // purpose of this test, we don't really care what exception is thrown, so + // just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () { diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/webview_platform_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/webview_platform_test.dart index f09156919512..4ab6d587b879 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/webview_platform_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/src/v4/webview_platform_test.dart @@ -22,7 +22,14 @@ void main() { test('Cannot be implemented with `implements`', () { expect(() { WebViewPlatform.instance = ImplementsWebViewPlatform(); - }, throwsNoSuchMethodError); + // In versions of `package:plugin_platform_interface` prior to fixing + // https://github.com/flutter/flutter/issues/109339, an attempt to + // implement a platform interface using `implements` would sometimes throw + // a `NoSuchMethodError` and other times throw an `AssertionError`. After + // the issue is fixed, an `AssertionError` will always be thrown. For the + // purpose of this test, we don't really care what exception is thrown, so + // just allow any exception. + }, throwsA(anything)); }); test('Can be extended', () {