From 4bcb1b77472780acff73084ace310a473a41bf15 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Thu, 9 Apr 2026 11:37:53 -0400 Subject: [PATCH 1/2] [url_launcher_web] Re-enable flaky test (not flaky anymore) --- .../integration_test/link_widget_test.dart | 139 +++++++++--------- 1 file changed, 68 insertions(+), 71 deletions(-) diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart index 05e9ce3ba148..80410bcfd12e 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart @@ -38,83 +38,80 @@ void main() { }); group('Link Widget', () { - testWidgets( - 'creates anchor with correct attributes', - (WidgetTester tester) async { - final Uri uri = Uri.parse('http://foobar/example?q=1'); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebLinkDelegate( - TestLinkInfo( - uri: uri, - target: LinkTarget.blank, - builder: (BuildContext context, FollowLink? followLink) { - return const SizedBox(width: 100, height: 100); - }, - ), + testWidgets('creates anchor with correct attributes', ( + WidgetTester tester, + ) async { + final Uri uri = Uri.parse('http://foobar/example?q=1'); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebLinkDelegate( + TestLinkInfo( + uri: uri, + target: LinkTarget.blank, + builder: (BuildContext context, FollowLink? followLink) { + return const SizedBox(width: 100, height: 100); + }, ), ), - ); - // Platform view creation happens asynchronously. - await tester.pumpAndSettle(); - await tester.pump(); - - final html.Element anchor = _findSingleAnchor(); - expect(anchor.getAttribute('href'), uri.toString()); - expect(anchor.getAttribute('target'), '_blank'); - - final Uri uri2 = Uri.parse('http://foobar2/example?q=2'); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebLinkDelegate( - TestLinkInfo( - uri: uri2, - target: LinkTarget.self, - builder: (BuildContext context, FollowLink? followLink) { - return const SizedBox(width: 100, height: 100); - }, - ), + ), + ); + // Platform view creation happens asynchronously. + await tester.pumpAndSettle(); + await tester.pump(); + + final html.Element anchor = _findSingleAnchor(); + expect(anchor.getAttribute('href'), uri.toString()); + expect(anchor.getAttribute('target'), '_blank'); + + final Uri uri2 = Uri.parse('http://foobar2/example?q=2'); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebLinkDelegate( + TestLinkInfo( + uri: uri2, + target: LinkTarget.self, + builder: (BuildContext context, FollowLink? followLink) { + return const SizedBox(width: 100, height: 100); + }, ), ), - ); - await tester.pumpAndSettle(); - await tester.pump(); - - // Check that the same anchor has been updated. - expect(anchor.getAttribute('href'), uri2.toString()); - expect(anchor.getAttribute('target'), '_self'); - - final Uri uri3 = Uri.parse('/foobar'); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: WebLinkDelegate( - TestLinkInfo( - uri: uri3, - target: LinkTarget.self, - builder: (BuildContext context, FollowLink? followLink) { - return const SizedBox(width: 100, height: 100); - }, - ), + ), + ); + await tester.pumpAndSettle(); + await tester.pump(); + + // Check that the same anchor has been updated. + expect(anchor.getAttribute('href'), uri2.toString()); + expect(anchor.getAttribute('target'), '_self'); + + final Uri uri3 = Uri.parse('/foobar'); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: WebLinkDelegate( + TestLinkInfo( + uri: uri3, + target: LinkTarget.self, + builder: (BuildContext context, FollowLink? followLink) { + return const SizedBox(width: 100, height: 100); + }, ), ), - ); - await tester.pumpAndSettle(); - await tester.pump(); - - // Check that internal route properly prepares using the default - // [UrlStrategy] - expect( - anchor.getAttribute('href'), - ui_web.urlStrategy?.prepareExternalUrl(uri3.toString()), - ); - expect(anchor.getAttribute('target'), '_self'); - }, - // Flaky under WASM: https://github.com/flutter/flutter/issues/182844 - skip: true, - ); + ), + ); + await tester.pumpAndSettle(); + await tester.pump(); + + // Check that internal route properly prepares using the default + // [UrlStrategy] + expect( + anchor.getAttribute('href'), + ui_web.urlStrategy?.prepareExternalUrl(uri3.toString()), + ); + expect(anchor.getAttribute('target'), '_self'); + }); testWidgets('sizes itself correctly', (WidgetTester tester) async { final Key containerKey = GlobalKey(); From 834d767aebb8939df81d3f7834bbf9848ee98861 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Thu, 9 Apr 2026 11:43:15 -0400 Subject: [PATCH 2/2] re-enable another test --- ...isabled.dart => flexible_size_html_element_view_test.dart} | 4 ---- 1 file changed, 4 deletions(-) rename packages/google_sign_in/google_sign_in_web/example/integration_test/{flexible_size_html_element_view_test_disabled.dart => flexible_size_html_element_view_test.dart} (97%) diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test_disabled.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart similarity index 97% rename from packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test_disabled.dart rename to packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart index 15ce3d63bb4d..b99975256164 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test_disabled.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart @@ -11,10 +11,6 @@ import 'package:google_sign_in_web/src/flexible_size_html_element_view.dart'; import 'package:integration_test/integration_test.dart'; import 'package:web/web.dart' as web; -// TODO(stuartmorgan): Re-enable this test, by renaming it not to end with -// _disabled. It is currently extremely flaky on WASM, see -// https://github.com/flutter/flutter/issues/176299 - /// Used to keep track of the number of HtmlElementView factories the test has registered. int widgetFactoryNumber = 0;