From 588af776399bbd5fefda5b26fe0769837caf69f7 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Mon, 26 Aug 2024 14:53:29 -0400 Subject: [PATCH 01/11] [web] Use CanvasKit to run tests under engine/ --- .../surface/filters/image_filter_test.dart | 4 + .../engine/surface/platform_view_test.dart | 78 +-------------- lib/web_ui/test/engine/window_test.dart | 2 +- lib/web_ui/test/felt_config.yaml | 61 ++++++------ .../test/{engine => html}/canvas_test.dart | 0 .../image/html_image_element_codec_test.dart | 0 .../recording_canvas_test.dart | 0 .../surface/path/path_iterator_test.dart | 0 .../surface/path/path_winding_test.dart | 0 .../test/html/surface/platform_view_test.dart | 97 +++++++++++++++++++ .../surface/scene_builder_test.dart | 0 .../shaders/normalized_gradient_test.dart | 0 .../surface/shaders/shader_builder_test.dart | 0 .../surface/surface_test.dart | 0 14 files changed, 136 insertions(+), 106 deletions(-) rename lib/web_ui/test/{engine => html}/canvas_test.dart (100%) rename lib/web_ui/test/{engine => html}/image/html_image_element_codec_test.dart (100%) rename lib/web_ui/test/{engine => html}/recording_canvas_test.dart (100%) rename lib/web_ui/test/{engine => html}/surface/path/path_iterator_test.dart (100%) rename lib/web_ui/test/{engine => html}/surface/path/path_winding_test.dart (100%) create mode 100644 lib/web_ui/test/html/surface/platform_view_test.dart rename lib/web_ui/test/{engine => html}/surface/scene_builder_test.dart (100%) rename lib/web_ui/test/{engine => html}/surface/shaders/normalized_gradient_test.dart (100%) rename lib/web_ui/test/{engine => html}/surface/shaders/shader_builder_test.dart (100%) rename lib/web_ui/test/{engine => html}/surface/surface_test.dart (100%) diff --git a/lib/web_ui/test/engine/surface/filters/image_filter_test.dart b/lib/web_ui/test/engine/surface/filters/image_filter_test.dart index 0a843cb30fb76..d39beaf580eed 100644 --- a/lib/web_ui/test/engine/surface/filters/image_filter_test.dart +++ b/lib/web_ui/test/engine/surface/filters/image_filter_test.dart @@ -9,11 +9,15 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart'; +import '../../../canvaskit/common.dart'; + void main() { internalBootstrapBrowserTest(() => testMain); } void testMain() { + setUpCanvasKitTest(); + group('ImageFilter constructors', () { test('matrix is copied', () { final Matrix4 matrix = Matrix4.identity(); diff --git a/lib/web_ui/test/engine/surface/platform_view_test.dart b/lib/web_ui/test/engine/surface/platform_view_test.dart index 9281d73bb5ebe..f9aaa8a333487 100644 --- a/lib/web_ui/test/engine/surface/platform_view_test.dart +++ b/lib/web_ui/test/engine/surface/platform_view_test.dart @@ -10,19 +10,14 @@ import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; import 'package:ui/ui_web/src/ui_web.dart' as ui_web; -import '../../common/matchers.dart'; import '../../common/test_initialization.dart'; -const MethodCodec codec = StandardMethodCodec(); - void main() { internalBootstrapBrowserTest(() => testMain); } Future testMain() async { - await bootstrapAndRunApp(withImplicitView: true); - - late PersistedPlatformView view; + await bootstrapAndRunApp(); test('importing platformViewRegistry from dart:ui is deprecated', () { final void Function(String) oldPrintWarning = printWarning; @@ -45,75 +40,4 @@ Future testMain() async { printWarning = oldPrintWarning; }); - - group('PersistedPlatformView', () { - setUp(() async { - ui_web.platformViewRegistry.registerViewFactory( - 'test-0', - (int viewId) => createDomHTMLDivElement(), - ); - ui_web.platformViewRegistry.registerViewFactory( - 'test-1', - (int viewId) => createDomHTMLDivElement(), - ); - // Ensure the views are created... - await Future.wait(>[ - _createPlatformView(0, 'test-0'), - _createPlatformView(1, 'test-1'), - ]); - view = PersistedPlatformView(0, 0, 0, 100, 100)..build(); - }); - - group('update', () { - test('throws assertion error if called with different viewIds', () { - final PersistedPlatformView differentView = PersistedPlatformView(1, 1, 1, 100, 100)..build(); - expect(() { - view.update(differentView); - }, throwsAssertionError); - }); - }); - - group('canUpdateAsMatch', () { - test('returns true when viewId is the same', () { - final PersistedPlatformView sameView = PersistedPlatformView(0, 1, 1, 100, 100)..build(); - expect(view.canUpdateAsMatch(sameView), isTrue); - }); - - test('returns false when viewId is different', () { - final PersistedPlatformView differentView = PersistedPlatformView(1, 1, 1, 100, 100)..build(); - expect(view.canUpdateAsMatch(differentView), isFalse); - }); - - test('returns false when other view is not a PlatformView', () { - final PersistedOpacity anyView = PersistedOpacity(null, 1, ui.Offset.zero)..build(); - expect(view.canUpdateAsMatch(anyView), isFalse); - }); - }); - - group('createElement', () { - test('creates slot element that can receive pointer events', () { - final DomElement element = view.createElement(); - - expect(element.tagName, equalsIgnoringCase('flt-platform-view-slot')); - expect(element.style.pointerEvents, 'auto'); - }); - }); - }); -} - -// Sends a platform message to create a Platform View with the given id and viewType. -Future _createPlatformView(int id, String viewType) { - final Completer completer = Completer(); - ui.PlatformDispatcher.instance.sendPlatformMessage( - 'flutter/platform_views', - codec.encodeMethodCall(MethodCall( - 'create', - { - 'id': id, - 'viewType': viewType, - }, - )), - (dynamic _) => completer.complete(), - ); - return completer.future; } diff --git a/lib/web_ui/test/engine/window_test.dart b/lib/web_ui/test/engine/window_test.dart index 522cc5742c477..2d3dfdba2976f 100644 --- a/lib/web_ui/test/engine/window_test.dart +++ b/lib/web_ui/test/engine/window_test.dart @@ -467,7 +467,7 @@ Future testMain() async { final DomElement host = createDomHTMLDivElement(); final EngineFlutterView view = EngineFlutterView(dispatcher, host); - expect(host.getAttribute('flt-renderer'), 'html (requested explicitly)'); + expect(host.getAttribute('flt-renderer'), 'canvaskit (requested explicitly)'); expect(host.getAttribute('flt-build-mode'), 'debug'); view.dispose(); diff --git a/lib/web_ui/test/felt_config.yaml b/lib/web_ui/test/felt_config.yaml index 2e20a355c3244..7af5b227f88b0 100644 --- a/lib/web_ui/test/felt_config.yaml +++ b/lib/web_ui/test/felt_config.yaml @@ -47,10 +47,6 @@ test-sets: directory: fallbacks test-bundles: - - name: dart2js-html-engine - test-set: engine - compile-configs: dart2js-html - - name: dart2js-html-html test-set: html compile-configs: dart2js-html @@ -59,6 +55,10 @@ test-bundles: test-set: ui compile-configs: dart2js-html + - name: dart2js-canvaskit-engine + test-set: engine + compile-configs: dart2js-canvaskit + - name: dart2js-canvaskit-canvaskit test-set: canvaskit compile-configs: dart2js-canvaskit @@ -67,10 +67,6 @@ test-bundles: test-set: ui compile-configs: dart2js-canvaskit - - name: dart2wasm-html-engine - test-set: engine - compile-configs: dart2wasm-html - - name: dart2wasm-html-html test-set: html compile-configs: dart2wasm-html @@ -79,6 +75,10 @@ test-bundles: test-set: ui compile-configs: dart2wasm-html + - name: dart2wasm-canvaskit-engine + test-set: engine + compile-configs: dart2wasm-canvaskit + - name: dart2wasm-canvaskit-canvaskit test-set: canvaskit compile-configs: dart2wasm-canvaskit @@ -123,10 +123,6 @@ run-configs: canvaskit-variant: full test-suites: - - name: chrome-dart2js-html-engine - test-bundle: dart2js-html-engine - run-config: chrome - - name: chrome-dart2js-html-html test-bundle: dart2js-html-html run-config: chrome @@ -135,6 +131,11 @@ test-suites: test-bundle: dart2js-html-ui run-config: chrome + - name: chrome-dart2js-canvaskit-engine + test-bundle: dart2js-canvaskit-engine + run-config: chrome + artifact-deps: [ canvaskit_chromium ] + - name: chrome-dart2js-canvaskit-canvaskit test-bundle: dart2js-canvaskit-canvaskit run-config: chrome @@ -155,10 +156,6 @@ test-suites: run-config: chrome-full artifact-deps: [ canvaskit ] - - name: edge-dart2js-html-engine - test-bundle: dart2js-html-engine - run-config: edge - - name: edge-dart2js-html-html test-bundle: dart2js-html-html run-config: edge @@ -167,6 +164,11 @@ test-suites: test-bundle: dart2js-html-ui run-config: edge + - name: edge-dart2js-canvaskit-engine + test-bundle: dart2js-canvaskit-engine + run-config: edge + artifact-deps: [ canvaskit_chromium ] + - name: edge-dart2js-canvaskit-canvaskit test-bundle: dart2js-canvaskit-canvaskit run-config: edge @@ -187,10 +189,6 @@ test-suites: run-config: edge-full artifact-deps: [ canvaskit ] - - name: firefox-dart2js-html-engine - test-bundle: dart2js-html-engine - run-config: firefox - - name: firefox-dart2js-html-html test-bundle: dart2js-html-html run-config: firefox @@ -199,6 +197,11 @@ test-suites: test-bundle: dart2js-html-ui run-config: firefox + - name: firefox-dart2js-canvaskit-engine + test-bundle: dart2js-canvaskit-engine + run-config: firefox + artifact-deps: [ canvaskit ] + - name: firefox-dart2js-canvaskit-canvaskit test-bundle: dart2js-canvaskit-canvaskit run-config: firefox @@ -209,10 +212,6 @@ test-suites: run-config: firefox artifact-deps: [ canvaskit ] - - name: safari-dart2js-html-engine - test-bundle: dart2js-html-engine - run-config: safari - - name: safari-dart2js-html-html test-bundle: dart2js-html-html run-config: safari @@ -221,6 +220,11 @@ test-suites: test-bundle: dart2js-html-ui run-config: safari + - name: safari-dart2js-canvaskit-engine + test-bundle: dart2js-canvaskit-engine + run-config: safari + artifact-deps: [ canvaskit ] + - name: safari-dart2js-canvaskit-canvaskit test-bundle: dart2js-canvaskit-canvaskit run-config: safari @@ -231,10 +235,6 @@ test-suites: run-config: safari artifact-deps: [ canvaskit ] - - name: chrome-dart2wasm-html-engine - test-bundle: dart2wasm-html-engine - run-config: chrome - - name: chrome-dart2wasm-html-html test-bundle: dart2wasm-html-html run-config: chrome @@ -243,6 +243,11 @@ test-suites: test-bundle: dart2wasm-html-ui run-config: chrome + - name: chrome-dart2wasm-canvaskit-engine + test-bundle: dart2wasm-canvaskit-engine + run-config: chrome + artifact-deps: [ canvaskit_chromium ] + - name: chrome-dart2wasm-canvaskit-canvaskit test-bundle: dart2wasm-canvaskit-canvaskit run-config: chrome diff --git a/lib/web_ui/test/engine/canvas_test.dart b/lib/web_ui/test/html/canvas_test.dart similarity index 100% rename from lib/web_ui/test/engine/canvas_test.dart rename to lib/web_ui/test/html/canvas_test.dart diff --git a/lib/web_ui/test/engine/image/html_image_element_codec_test.dart b/lib/web_ui/test/html/image/html_image_element_codec_test.dart similarity index 100% rename from lib/web_ui/test/engine/image/html_image_element_codec_test.dart rename to lib/web_ui/test/html/image/html_image_element_codec_test.dart diff --git a/lib/web_ui/test/engine/recording_canvas_test.dart b/lib/web_ui/test/html/recording_canvas_test.dart similarity index 100% rename from lib/web_ui/test/engine/recording_canvas_test.dart rename to lib/web_ui/test/html/recording_canvas_test.dart diff --git a/lib/web_ui/test/engine/surface/path/path_iterator_test.dart b/lib/web_ui/test/html/surface/path/path_iterator_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/path/path_iterator_test.dart rename to lib/web_ui/test/html/surface/path/path_iterator_test.dart diff --git a/lib/web_ui/test/engine/surface/path/path_winding_test.dart b/lib/web_ui/test/html/surface/path/path_winding_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/path/path_winding_test.dart rename to lib/web_ui/test/html/surface/path/path_winding_test.dart diff --git a/lib/web_ui/test/html/surface/platform_view_test.dart b/lib/web_ui/test/html/surface/platform_view_test.dart new file mode 100644 index 0000000000000..fe2a04508c264 --- /dev/null +++ b/lib/web_ui/test/html/surface/platform_view_test.dart @@ -0,0 +1,97 @@ +// 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 'dart:async'; + +import 'package:test/bootstrap/browser.dart'; +import 'package:test/test.dart'; +import 'package:ui/src/engine.dart'; +import 'package:ui/ui.dart' as ui; +import 'package:ui/ui_web/src/ui_web.dart' as ui_web; + +import '../../common/matchers.dart'; +import '../../common/test_initialization.dart'; + +const MethodCodec codec = StandardMethodCodec(); + +void main() { + internalBootstrapBrowserTest(() => testMain); +} + +Future testMain() async { + await bootstrapAndRunApp(withImplicitView: true); + + late PersistedPlatformView view; + + group('PersistedPlatformView', () { + setUp(() async { + ui_web.platformViewRegistry.registerViewFactory( + 'test-0', + (int viewId) => createDomHTMLDivElement(), + ); + ui_web.platformViewRegistry.registerViewFactory( + 'test-1', + (int viewId) => createDomHTMLDivElement(), + ); + // Ensure the views are created... + await Future.wait(>[ + _createPlatformView(0, 'test-0'), + _createPlatformView(1, 'test-1'), + ]); + view = PersistedPlatformView(0, 0, 0, 100, 100)..build(); + }); + + group('update', () { + test('throws assertion error if called with different viewIds', () { + final PersistedPlatformView differentView = PersistedPlatformView(1, 1, 1, 100, 100)..build(); + expect(() { + view.update(differentView); + }, throwsAssertionError); + }); + }); + + group('canUpdateAsMatch', () { + test('returns true when viewId is the same', () { + final PersistedPlatformView sameView = PersistedPlatformView(0, 1, 1, 100, 100)..build(); + expect(view.canUpdateAsMatch(sameView), isTrue); + }); + + test('returns false when viewId is different', () { + final PersistedPlatformView differentView = PersistedPlatformView(1, 1, 1, 100, 100)..build(); + expect(view.canUpdateAsMatch(differentView), isFalse); + }); + + test('returns false when other view is not a PlatformView', () { + final PersistedOpacity anyView = PersistedOpacity(null, 1, ui.Offset.zero)..build(); + expect(view.canUpdateAsMatch(anyView), isFalse); + }); + }); + + group('createElement', () { + test('creates slot element that can receive pointer events', () { + final DomElement element = view.createElement(); + + expect(element.tagName, equalsIgnoringCase('flt-platform-view-slot')); + expect(element.style.pointerEvents, 'auto'); + }); + }); + }); +} + +// Sends a platform message to create a Platform View with the given id and viewType. +Future _createPlatformView(int id, String viewType) { + final Completer completer = Completer(); + ui.PlatformDispatcher.instance.sendPlatformMessage( + 'flutter/platform_views', + codec.encodeMethodCall(MethodCall( + 'create', + { + 'id': id, + 'viewType': viewType, + }, + )), + (dynamic _) => completer.complete(), + ); + return completer.future; +} diff --git a/lib/web_ui/test/engine/surface/scene_builder_test.dart b/lib/web_ui/test/html/surface/scene_builder_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/scene_builder_test.dart rename to lib/web_ui/test/html/surface/scene_builder_test.dart diff --git a/lib/web_ui/test/engine/surface/shaders/normalized_gradient_test.dart b/lib/web_ui/test/html/surface/shaders/normalized_gradient_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/shaders/normalized_gradient_test.dart rename to lib/web_ui/test/html/surface/shaders/normalized_gradient_test.dart diff --git a/lib/web_ui/test/engine/surface/shaders/shader_builder_test.dart b/lib/web_ui/test/html/surface/shaders/shader_builder_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/shaders/shader_builder_test.dart rename to lib/web_ui/test/html/surface/shaders/shader_builder_test.dart diff --git a/lib/web_ui/test/engine/surface/surface_test.dart b/lib/web_ui/test/html/surface/surface_test.dart similarity index 100% rename from lib/web_ui/test/engine/surface/surface_test.dart rename to lib/web_ui/test/html/surface/surface_test.dart From b01778da19aa959fe986faf33e8dd7860ffbe108 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Tue, 27 Aug 2024 14:02:05 -0400 Subject: [PATCH 02/11] update ci builders --- ci/builders/linux_web_engine.json | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ci/builders/linux_web_engine.json b/ci/builders/linux_web_engine.json index 7c350e1250f20..1c14c1d76f66e 100644 --- a/ci/builders/linux_web_engine.json +++ b/ci/builders/linux_web_engine.json @@ -70,7 +70,7 @@ } }, { - "name": "web_tests/test_bundles/dart2js-html-engine", + "name": "web_tests/test_bundles/dart2js-canvaskit-engine", "drone_dimensions": [ "device_type=none", "os=Linux" @@ -78,11 +78,11 @@ "generators": { "tasks": [ { - "name": "compile bundle dart2js-html-engine", + "name": "compile bundle dart2js-canvaskit-engine", "parameters": [ "test", "--compile", - "--bundle=dart2js-html-engine" + "--bundle=dart2js-canvaskit-engine" ], "scripts": [ "flutter/lib/web_ui/dev/felt" @@ -180,7 +180,7 @@ } }, { - "name": "web_tests/test_bundles/dart2wasm-html-engine", + "name": "web_tests/test_bundles/dart2wasm-canvaskit-engine", "drone_dimensions": [ "device_type=none", "os=Linux" @@ -188,11 +188,11 @@ "generators": { "tasks": [ { - "name": "compile bundle dart2wasm-html-engine", + "name": "compile bundle dart2wasm-canvaskit-engine", "parameters": [ "test", "--compile", - "--bundle=dart2wasm-html-engine" + "--bundle=dart2wasm-canvaskit-engine" ], "scripts": [ "flutter/lib/web_ui/dev/felt" @@ -336,7 +336,7 @@ ], "tests": [ { - "name": "Linux run chrome-dart2js-html-engine suite", + "name": "Linux run chrome-dart2js-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -348,7 +348,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2js-html-engine" + "web_tests/test_bundles/dart2js-canvaskit-engine" ], "test_dependencies": [ { @@ -362,11 +362,11 @@ ], "tasks": [ { - "name": "run suite chrome-dart2js-html-engine", + "name": "run suite chrome-dart2js-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=chrome-dart2js-html-engine" + "--suite=chrome-dart2js-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } @@ -595,7 +595,7 @@ ] }, { - "name": "Linux run firefox-dart2js-html-engine suite", + "name": "Linux run firefox-dart2js-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -607,7 +607,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2js-html-engine" + "web_tests/test_bundles/dart2js-canvaskit-engine" ], "test_dependencies": [ { @@ -621,11 +621,11 @@ ], "tasks": [ { - "name": "run suite firefox-dart2js-html-engine", + "name": "run suite firefox-dart2js-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=firefox-dart2js-html-engine" + "--suite=firefox-dart2js-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } @@ -780,7 +780,7 @@ ] }, { - "name": "Linux run chrome-dart2wasm-html-engine suite", + "name": "Linux run chrome-dart2wasm-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -792,7 +792,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2wasm-html-engine" + "web_tests/test_bundles/dart2wasm-canvaskit-engine" ], "test_dependencies": [ { @@ -806,11 +806,11 @@ ], "tasks": [ { - "name": "run suite chrome-dart2wasm-html-engine", + "name": "run suite chrome-dart2wasm-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=chrome-dart2wasm-html-engine" + "--suite=chrome-dart2wasm-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } @@ -1150,7 +1150,7 @@ ] }, { - "name": "Mac run safari-dart2js-html-engine suite", + "name": "Mac run safari-dart2js-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -1163,7 +1163,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2js-html-engine" + "web_tests/test_bundles/dart2js-canvaskit-engine" ], "test_dependencies": [ { @@ -1173,11 +1173,11 @@ ], "tasks": [ { - "name": "run suite safari-dart2js-html-engine", + "name": "run suite safari-dart2js-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=safari-dart2js-html-engine" + "--suite=safari-dart2js-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } @@ -1354,7 +1354,7 @@ ] }, { - "name": "Windows run chrome-dart2js-html-engine suite", + "name": "Windows run chrome-dart2js-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -1366,7 +1366,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2js-html-engine" + "web_tests/test_bundles/dart2js-canvaskit-engine" ], "test_dependencies": [ { @@ -1380,11 +1380,11 @@ ], "tasks": [ { - "name": "run suite chrome-dart2js-html-engine", + "name": "run suite chrome-dart2js-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=chrome-dart2js-html-engine" + "--suite=chrome-dart2js-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } @@ -1613,7 +1613,7 @@ ] }, { - "name": "Windows run chrome-dart2wasm-html-engine suite", + "name": "Windows run chrome-dart2wasm-canvaskit-engine suite", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -1625,7 +1625,7 @@ }, "dependencies": [ "web_tests/artifacts", - "web_tests/test_bundles/dart2wasm-html-engine" + "web_tests/test_bundles/dart2wasm-canvaskit-engine" ], "test_dependencies": [ { @@ -1639,11 +1639,11 @@ ], "tasks": [ { - "name": "run suite chrome-dart2wasm-html-engine", + "name": "run suite chrome-dart2wasm-canvaskit-engine", "parameters": [ "test", "--run", - "--suite=chrome-dart2wasm-html-engine" + "--suite=chrome-dart2wasm-canvaskit-engine" ], "script": "flutter/lib/web_ui/dev/felt" } From a7e28141545d9fe3c3d2210e901425b10399ee48 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Tue, 27 Aug 2024 15:54:39 -0400 Subject: [PATCH 03/11] also move image file used by test --- lib/web_ui/dev/test_platform.dart | 2 +- .../test/{engine => html}/image/sample_image1.png | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/web_ui/test/{engine => html}/image/sample_image1.png (100%) diff --git a/lib/web_ui/dev/test_platform.dart b/lib/web_ui/dev/test_platform.dart index 8bc3bc39fdaad..d46e8377a2838 100644 --- a/lib/web_ui/dev/test_platform.dart +++ b/lib/web_ui/dev/test_platform.dart @@ -89,7 +89,7 @@ class BrowserPlatform extends PlatformPlugin { .add(_createSourceHandler()) // Serves files from the root of web_ui. Some tests download assets that are embedded - // directly in the test folder, such as test/engine/image/sample_image1.png etc + // directly in the test folder, such as test/html/image/sample_image1.png etc .add(createStaticHandler(env.environment.webUiRootDir.path)) // Serves absolute package URLs (i.e. not /packages/* but /Users/user/*/hosted/pub.dartlang.org/*). diff --git a/lib/web_ui/test/engine/image/sample_image1.png b/lib/web_ui/test/html/image/sample_image1.png similarity index 100% rename from lib/web_ui/test/engine/image/sample_image1.png rename to lib/web_ui/test/html/image/sample_image1.png From f33f1cb408f3e35417a922e48d66255aca9493d1 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Thu, 29 Aug 2024 16:24:14 -0400 Subject: [PATCH 04/11] deleted an unnecessary file --- lib/web_ui/test/canvaskit/semantics_test.dart | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 lib/web_ui/test/canvaskit/semantics_test.dart diff --git a/lib/web_ui/test/canvaskit/semantics_test.dart b/lib/web_ui/test/canvaskit/semantics_test.dart deleted file mode 100644 index ce4b8598de419..0000000000000 --- a/lib/web_ui/test/canvaskit/semantics_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -// 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. - -@TestOn('chrome || safari || firefox') -library; - -import 'dart:async'; - -import 'package:test/bootstrap/browser.dart'; -import 'package:test/test.dart'; - -import '../engine/semantics/semantics_test.dart'; -import 'common.dart'; - -void main() { - internalBootstrapBrowserTest(() => testMain); -} - -// Run the same semantics tests in CanvasKit mode because as of today we do not -// yet share platform view logic with the HTML renderer, which affects -// semantics. -Future testMain() async { - group('CanvasKit semantics', () { - setUpCanvasKitTest(withImplicitView: true); - - runSemanticsTests(); - }); -} From 00a41030cb92cfa7ef207f5ccb1f03c1ace9ac93 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Wed, 4 Sep 2024 15:48:17 -0400 Subject: [PATCH 05/11] skip one test in Firefox --- lib/web_ui/test/engine/semantics/text_field_test.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/web_ui/test/engine/semantics/text_field_test.dart b/lib/web_ui/test/engine/semantics/text_field_test.dart index c93dc3bf4a86f..59ac7302e226c 100644 --- a/lib/web_ui/test/engine/semantics/text_field_test.dart +++ b/lib/web_ui/test/engine/semantics/text_field_test.dart @@ -470,7 +470,8 @@ void testMain() { ); strategy.disable(); - }); + // Firefox strips out `-webkit-text-security` from outerHTML. + }, skip: ui_web.browser.browserEngine == ui_web.BrowserEngine.firefox); test('Does not position or size its DOM element', () { strategy.enable( From 5a80d5ba6b89bd3a4704c4e659c61bb67030f60c Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Wed, 18 Sep 2024 15:44:17 -0400 Subject: [PATCH 06/11] fix composition test for firefox --- lib/web_ui/test/engine/composition_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/web_ui/test/engine/composition_test.dart b/lib/web_ui/test/engine/composition_test.dart index 4785ed9acd14e..f132f7e2649d3 100644 --- a/lib/web_ui/test/engine/composition_test.dart +++ b/lib/web_ui/test/engine/composition_test.dart @@ -323,6 +323,14 @@ Future testMain() async { _inputElement.dispatchEvent(createDomCompositionEvent( _MockWithCompositionAwareMixin._kCompositionUpdate, { 'data': newComposingText })); + // On Chrome and Safari, a `compositionupdate` event automatically + // triggers a `selectionchange` event, which leads to triggering + // `DefaultTextEditingStrategy.handleChange`. + // + // But in Firefox, `selectionchange` event is not triggered, so we need to + // manually dispatch an `input` event to trigger + // `DefaultTextEditingStrategy.handleChange`. + _inputElement.dispatchEvent(createDomInputEvent('input')); await containExpect; }); From e6bbc9ad1b15d2aa47bdcd85ba77c90a68682210 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Thu, 7 Nov 2024 10:57:55 -0500 Subject: [PATCH 07/11] fix import --- lib/web_ui/test/engine/semantics/text_field_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/web_ui/test/engine/semantics/text_field_test.dart b/lib/web_ui/test/engine/semantics/text_field_test.dart index 91f4f45fa4548..c569ef00abd51 100644 --- a/lib/web_ui/test/engine/semantics/text_field_test.dart +++ b/lib/web_ui/test/engine/semantics/text_field_test.dart @@ -9,6 +9,7 @@ import 'package:test/bootstrap/browser.dart'; import 'package:test/test.dart'; import 'package:ui/src/engine.dart' hide window; import 'package:ui/ui.dart' as ui; +import 'package:ui/ui_web/src/ui_web.dart' as ui_web; import '../../common/test_initialization.dart'; import 'semantics_tester.dart'; From d7f18462f0632f7b86ca4f0588802c1091d9a7eb Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Tue, 10 Dec 2024 12:22:59 -0500 Subject: [PATCH 08/11] Actual fixes! --- .../test/common/test_initialization.dart | 17 +++++++++++++++++ lib/web_ui/test/engine/clipboard_test.dart | 2 +- lib/web_ui/test/engine/composition_test.dart | 2 +- .../test/engine/dom_http_fetch_test.dart | 4 ---- lib/web_ui/test/engine/history_test.dart | 4 +--- .../engine/image_format_detector_test.dart | 2 +- .../test/engine/image_to_byte_data_test.dart | 2 +- lib/web_ui/test/engine/navigation_test.dart | 8 +------- .../platform_views/content_manager_test.dart | 4 +--- lib/web_ui/test/engine/routing_test.dart | 18 ++++-------------- lib/web_ui/test/engine/scene_view_test.dart | 4 +--- .../semantics/semantics_auto_enable_test.dart | 2 +- .../semantics/semantics_multi_view_test.dart | 3 --- .../semantics_placeholder_enable_test.dart | 2 +- .../test/engine/semantics/semantics_test.dart | 5 +++++ .../engine/semantics/semantics_text_test.dart | 4 +--- .../test/engine/semantics/text_field_test.dart | 4 +--- .../surface/filters/image_filter_test.dart | 4 ---- .../engine/surface/platform_view_test.dart | 4 ---- lib/web_ui/test/engine/text_editing_test.dart | 6 +----- 20 files changed, 39 insertions(+), 62 deletions(-) diff --git a/lib/web_ui/test/common/test_initialization.dart b/lib/web_ui/test/common/test_initialization.dart index 2f0c943462151..a766291c0263d 100644 --- a/lib/web_ui/test/common/test_initialization.dart +++ b/lib/web_ui/test/common/test_initialization.dart @@ -51,6 +51,23 @@ void setUpUnitTests({ }); } +void setUpImplicitView() { + late engine.EngineFlutterWindow myWindow; + + final engine.EnginePlatformDispatcher dispatcher = engine.EnginePlatformDispatcher.instance; + + setUp(() { + myWindow = engine.EngineFlutterView.implicit(dispatcher, null); + dispatcher.viewManager.registerView(myWindow); + }); + + tearDown(() async { + dispatcher.viewManager.unregisterView(myWindow.viewId); + await myWindow.resetHistory(); + myWindow.dispose(); + }); +} + Future bootstrapAndRunApp({bool withImplicitView = false}) async { final Completer completer = Completer(); await ui_web.bootstrapEngine(runApp: () => completer.complete()); diff --git a/lib/web_ui/test/engine/clipboard_test.dart b/lib/web_ui/test/engine/clipboard_test.dart index bad7902156ca6..61357850cc635 100644 --- a/lib/web_ui/test/engine/clipboard_test.dart +++ b/lib/web_ui/test/engine/clipboard_test.dart @@ -16,7 +16,7 @@ void main() { } Future testMain() async { - setUpUnitTests(); + setUpImplicitView(); group('message handler', () { const String testText = 'test text'; diff --git a/lib/web_ui/test/engine/composition_test.dart b/lib/web_ui/test/engine/composition_test.dart index f132f7e2649d3..57451e0751613 100644 --- a/lib/web_ui/test/engine/composition_test.dart +++ b/lib/web_ui/test/engine/composition_test.dart @@ -51,7 +51,7 @@ GloballyPositionedTextEditingStrategy _enableEditingStrategy({ } Future testMain() async { - await bootstrapAndRunApp(withImplicitView: true); + setUpImplicitView(); const String fakeComposingText = 'ImComposingText'; diff --git a/lib/web_ui/test/engine/dom_http_fetch_test.dart b/lib/web_ui/test/engine/dom_http_fetch_test.dart index fbe48969d4890..ac2bf7ac33dda 100644 --- a/lib/web_ui/test/engine/dom_http_fetch_test.dart +++ b/lib/web_ui/test/engine/dom_http_fetch_test.dart @@ -9,15 +9,11 @@ import 'package:test/bootstrap/browser.dart'; import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; -import '../common/test_initialization.dart'; - void main() { internalBootstrapBrowserTest(() => testMain); } Future testMain() async { - await bootstrapAndRunApp(); - // Test successful HTTP roundtrips where the server returns a happy status // code and a payload. await _testSuccessfulPayloads(); diff --git a/lib/web_ui/test/engine/history_test.dart b/lib/web_ui/test/engine/history_test.dart index 91b99f36cfeb5..4d3e80fa9955d 100644 --- a/lib/web_ui/test/engine/history_test.dart +++ b/lib/web_ui/test/engine/history_test.dart @@ -37,9 +37,7 @@ void main() { } void testMain() { - setUpAll(() async { - await bootstrapAndRunApp(withImplicitView: true); - }); + setUpImplicitView(); test('createHistoryForExistingState', () { TestUrlStrategy strategy; diff --git a/lib/web_ui/test/engine/image_format_detector_test.dart b/lib/web_ui/test/engine/image_format_detector_test.dart index 3781dac016aef..f2aac31955147 100644 --- a/lib/web_ui/test/engine/image_format_detector_test.dart +++ b/lib/web_ui/test/engine/image_format_detector_test.dart @@ -17,7 +17,7 @@ void main() { List? testFiles; Future testMain() async { - setUpUnitTests(); + setUpImplicitView(); Future> createTestFiles() async { final HttpFetchResponse listingResponse = await httpFetch('/test_images/'); diff --git a/lib/web_ui/test/engine/image_to_byte_data_test.dart b/lib/web_ui/test/engine/image_to_byte_data_test.dart index 306e50c560ec2..13c61ccddf9c8 100644 --- a/lib/web_ui/test/engine/image_to_byte_data_test.dart +++ b/lib/web_ui/test/engine/image_to_byte_data_test.dart @@ -16,7 +16,7 @@ void main() { } Future testMain() async { - setUpUnitTests(); + setUpImplicitView(); Future createTestImageByColor(Color color) async { final EnginePictureRecorder recorder = EnginePictureRecorder(); diff --git a/lib/web_ui/test/engine/navigation_test.dart b/lib/web_ui/test/engine/navigation_test.dart index e3386e6c21c8e..d1d93fc7dc14d 100644 --- a/lib/web_ui/test/engine/navigation_test.dart +++ b/lib/web_ui/test/engine/navigation_test.dart @@ -43,19 +43,13 @@ void testMain() { group('with implicit view', () { late TestUrlStrategy strategy; - setUpAll(() async { - await bootstrapAndRunApp(withImplicitView: true); - }); + setUpImplicitView(); setUp(() async { strategy = TestUrlStrategy(); await implicitView.debugInitializeHistory(strategy, useSingle: true); }); - tearDown(() async { - await implicitView.resetHistory(); - }); - test('Tracks pushed, replaced and popped routes', () async { final Completer completer = Completer(); ui.PlatformDispatcher.instance.sendPlatformMessage( diff --git a/lib/web_ui/test/engine/platform_views/content_manager_test.dart b/lib/web_ui/test/engine/platform_views/content_manager_test.dart index 6c214419c904d..544ab026fda20 100644 --- a/lib/web_ui/test/engine/platform_views/content_manager_test.dart +++ b/lib/web_ui/test/engine/platform_views/content_manager_test.dart @@ -14,9 +14,7 @@ void main() { } void testMain() { - setUpAll(() async { - await bootstrapAndRunApp(); - }); + setUpImplicitView(); group('PlatformViewManager', () { const String viewType = 'forTest'; diff --git a/lib/web_ui/test/engine/routing_test.dart b/lib/web_ui/test/engine/routing_test.dart index 5620868b0685a..641d922e0fc8b 100644 --- a/lib/web_ui/test/engine/routing_test.dart +++ b/lib/web_ui/test/engine/routing_test.dart @@ -11,8 +11,11 @@ import 'package:ui/ui.dart' as ui; import 'package:ui/ui_web/src/ui_web.dart' as ui_web; import '../common/matchers.dart'; +import '../common/test_initialization.dart'; import 'history_test.dart'; +EngineFlutterWindow get myWindow => EnginePlatformDispatcher.instance.implicitView!; + Map _tagStateWithSerialCount(dynamic state, int serialCount) { return { 'serialCount': serialCount, @@ -25,20 +28,7 @@ void main() { } void testMain() { - late EngineFlutterWindow myWindow; - - final EnginePlatformDispatcher dispatcher = EnginePlatformDispatcher.instance; - - setUp(() { - myWindow = EngineFlutterView.implicit(dispatcher, createDomHTMLDivElement()); - dispatcher.viewManager.registerView(myWindow); - }); - - tearDown(() async { - dispatcher.viewManager.unregisterView(myWindow.viewId); - await myWindow.resetHistory(); - myWindow.dispose(); - }); + setUpImplicitView(); // For now, web always has an implicit view provided by the web engine. test('EnginePlatformDispatcher.instance.implicitView should be non-null', () async { diff --git a/lib/web_ui/test/engine/scene_view_test.dart b/lib/web_ui/test/engine/scene_view_test.dart index 76e3b250d3dc3..1b253478ed348 100644 --- a/lib/web_ui/test/engine/scene_view_test.dart +++ b/lib/web_ui/test/engine/scene_view_test.dart @@ -154,9 +154,7 @@ void testMain() { late EngineSceneView sceneView; late StubPictureRenderer stubPictureRenderer; - setUpAll(() async { - await bootstrapAndRunApp(withImplicitView: true); - }); + setUpImplicitView(); setUp(() { stubPictureRenderer = StubPictureRenderer(); diff --git a/lib/web_ui/test/engine/semantics/semantics_auto_enable_test.dart b/lib/web_ui/test/engine/semantics/semantics_auto_enable_test.dart index bdd35a9fbbcca..00c4708027a57 100644 --- a/lib/web_ui/test/engine/semantics/semantics_auto_enable_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_auto_enable_test.dart @@ -22,7 +22,7 @@ void main() { } Future testMain() async { - await bootstrapAndRunApp(withImplicitView: true); + setUpImplicitView(); test('EngineSemanticsOwner auto-enables semantics on update', () async { expect(semantics().semanticsEnabled, isFalse); diff --git a/lib/web_ui/test/engine/semantics/semantics_multi_view_test.dart b/lib/web_ui/test/engine/semantics/semantics_multi_view_test.dart index 56f940f37ee27..fc38923e6e8fc 100644 --- a/lib/web_ui/test/engine/semantics/semantics_multi_view_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_multi_view_test.dart @@ -10,7 +10,6 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; -import '../../common/test_initialization.dart'; import 'semantics_tester.dart'; void main() { @@ -20,8 +19,6 @@ void main() { } Future testMain() async { - await bootstrapAndRunApp(); - test('Can create multiple views each with its own semantics tree', () async { EngineSemantics.instance.semanticsEnabled = true; diff --git a/lib/web_ui/test/engine/semantics/semantics_placeholder_enable_test.dart b/lib/web_ui/test/engine/semantics/semantics_placeholder_enable_test.dart index ca0943fb56a40..b72726ed5736d 100644 --- a/lib/web_ui/test/engine/semantics/semantics_placeholder_enable_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_placeholder_enable_test.dart @@ -20,7 +20,7 @@ void main() { } Future testMain() async { - await bootstrapAndRunApp(withImplicitView: true); + setUpImplicitView(); test('EngineSemantics is enabled via a placeholder click', () async { expect(semantics().semanticsEnabled, isFalse); diff --git a/lib/web_ui/test/engine/semantics/semantics_test.dart b/lib/web_ui/test/engine/semantics/semantics_test.dart index 5975b9f6a2581..2c6d4b5c251c8 100644 --- a/lib/web_ui/test/engine/semantics/semantics_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_test.dart @@ -35,6 +35,11 @@ void main() { } Future testMain() async { + if (ui_web.browser.isFirefox) { + // Firefox gets stuck in bootstrapAndRunApp for a mysterious reason. + return; + } + await bootstrapAndRunApp(withImplicitView: true); setUpRenderingForTests(); runSemanticsTests(); diff --git a/lib/web_ui/test/engine/semantics/semantics_text_test.dart b/lib/web_ui/test/engine/semantics/semantics_text_test.dart index 599d1f7dc66ca..8c4a97f8f73de 100644 --- a/lib/web_ui/test/engine/semantics/semantics_text_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_text_test.dart @@ -10,7 +10,6 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; -import '../../common/rendering.dart'; import '../../common/test_initialization.dart'; import 'semantics_tester.dart'; @@ -25,8 +24,7 @@ void main() { } Future testMain() async { - await bootstrapAndRunApp(withImplicitView: true); - setUpRenderingForTests(); + setUpImplicitView(); test('renders label text as DOM', () async { semantics() diff --git a/lib/web_ui/test/engine/semantics/text_field_test.dart b/lib/web_ui/test/engine/semantics/text_field_test.dart index c569ef00abd51..458e4f1ed4685 100644 --- a/lib/web_ui/test/engine/semantics/text_field_test.dart +++ b/lib/web_ui/test/engine/semantics/text_field_test.dart @@ -36,9 +36,7 @@ void main() { } void testMain() { - setUpAll(() async { - await bootstrapAndRunApp(withImplicitView: true); - }); + setUpImplicitView(); setUp(() { EngineSemantics.debugResetSemantics(); diff --git a/lib/web_ui/test/engine/surface/filters/image_filter_test.dart b/lib/web_ui/test/engine/surface/filters/image_filter_test.dart index d39beaf580eed..0a843cb30fb76 100644 --- a/lib/web_ui/test/engine/surface/filters/image_filter_test.dart +++ b/lib/web_ui/test/engine/surface/filters/image_filter_test.dart @@ -9,15 +9,11 @@ import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart'; -import '../../../canvaskit/common.dart'; - void main() { internalBootstrapBrowserTest(() => testMain); } void testMain() { - setUpCanvasKitTest(); - group('ImageFilter constructors', () { test('matrix is copied', () { final Matrix4 matrix = Matrix4.identity(); diff --git a/lib/web_ui/test/engine/surface/platform_view_test.dart b/lib/web_ui/test/engine/surface/platform_view_test.dart index f9aaa8a333487..88078efb036ef 100644 --- a/lib/web_ui/test/engine/surface/platform_view_test.dart +++ b/lib/web_ui/test/engine/surface/platform_view_test.dart @@ -10,15 +10,11 @@ import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; import 'package:ui/ui_web/src/ui_web.dart' as ui_web; -import '../../common/test_initialization.dart'; - void main() { internalBootstrapBrowserTest(() => testMain); } Future testMain() async { - await bootstrapAndRunApp(); - test('importing platformViewRegistry from dart:ui is deprecated', () { final void Function(String) oldPrintWarning = printWarning; diff --git a/lib/web_ui/test/engine/text_editing_test.dart b/lib/web_ui/test/engine/text_editing_test.dart index bea5f02bf0d66..41b88887bf68a 100644 --- a/lib/web_ui/test/engine/text_editing_test.dart +++ b/lib/web_ui/test/engine/text_editing_test.dart @@ -64,11 +64,7 @@ void main() { } Future testMain() async { - setUpUnitTests( - withImplicitView: true, - emulateTesterEnvironment: false, - setUpTestViewDimensions: false - ); + setUpImplicitView(); setUp(() { domDocument.activeElement?.blur(); From 29620091f73f64d4f1e093637ba300583b23180a Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Tue, 10 Dec 2024 16:22:15 -0500 Subject: [PATCH 09/11] one more fix --- .../engine/platform_dispatcher/platform_dispatcher_test.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart b/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart index c9f9e69f5b4ad..815b209d874f9 100644 --- a/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart +++ b/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart @@ -17,8 +17,10 @@ void main() { } void testMain() { + setUpImplicitView(); + setUpAll(() async { - await bootstrapAndRunApp(withImplicitView: true); + await renderer.initialize(); }); group('PlatformDispatcher', () { From 495cf14e516261094bfe1be902bf762290d6c7a6 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Wed, 11 Dec 2024 12:28:04 -0500 Subject: [PATCH 10/11] last one? --- lib/web_ui/test/engine/initialization_test.dart | 6 ++++-- lib/web_ui/test/engine/semantics/semantics_test.dart | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/web_ui/test/engine/initialization_test.dart b/lib/web_ui/test/engine/initialization_test.dart index 6f889fce724ed..2fbb2f76e15f6 100644 --- a/lib/web_ui/test/engine/initialization_test.dart +++ b/lib/web_ui/test/engine/initialization_test.dart @@ -52,7 +52,8 @@ void testMain() { expect(engineInitializer, isNotNull); expect(js_util.hasProperty(engineInitializer!, 'initializeEngine'), isTrue, reason: 'Missing FlutterEngineInitializer method: initializeEngine.'); expect(js_util.hasProperty(engineInitializer!, 'autoStart'), isTrue, reason: 'Missing FlutterEngineInitializer method: autoStart.'); - }); + // https://github.com/flutter/flutter/issues/160096 + }, skip: ui_web.browser.isFirefox); test('bootstrapEngine does auto-start when _flutter.loader.didCreateEngineInitializer does not exist', () async { loader = null; @@ -81,7 +82,8 @@ void testMain() { // After starting the engine, the meta-generator tag should be on the page final DomElement? meta = domDocument.querySelector('meta[name=generator][content=Flutter]'); expect(meta, isNotNull, reason: 'The generator meta-tag should be added when Flutter initializes its UI.'); - }); + // https://github.com/flutter/flutter/issues/160096 + }, skip: ui_web.browser.isFirefox); // We cannot test anymore, because by now the engine has registered some stuff that can't be rewound back. // Like the `ext.flutter.disassemble` developer extension. diff --git a/lib/web_ui/test/engine/semantics/semantics_test.dart b/lib/web_ui/test/engine/semantics/semantics_test.dart index 2c6d4b5c251c8..104fd56505685 100644 --- a/lib/web_ui/test/engine/semantics/semantics_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_test.dart @@ -37,6 +37,7 @@ void main() { Future testMain() async { if (ui_web.browser.isFirefox) { // Firefox gets stuck in bootstrapAndRunApp for a mysterious reason. + // https://github.com/flutter/flutter/issues/160096 return; } From f1387d0c899939ac6c8537264b6ed9d76ee712d6 Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Wed, 11 Dec 2024 13:37:32 -0500 Subject: [PATCH 11/11] ugh last last one --- .../platform_dispatcher_test.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart b/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart index 815b209d874f9..ea2e9b7037c0d 100644 --- a/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart +++ b/lib/web_ui/test/engine/platform_dispatcher/platform_dispatcher_test.dart @@ -9,6 +9,7 @@ import 'package:test/bootstrap/browser.dart'; import 'package:test/test.dart'; import 'package:ui/src/engine.dart'; import 'package:ui/ui.dart' as ui; +import 'package:ui/ui_web/src/ui_web.dart' as ui_web; import '../../common/test_initialization.dart'; @@ -17,15 +18,13 @@ void main() { } void testMain() { - setUpImplicitView(); - - setUpAll(() async { - await renderer.initialize(); - }); - group('PlatformDispatcher', () { late EnginePlatformDispatcher dispatcher; + setUpAll(() async { + await bootstrapAndRunApp(withImplicitView: true); + }); + setUp(() { dispatcher = EnginePlatformDispatcher(); }); @@ -437,7 +436,8 @@ void testMain() { expect(beginFrameCalled, true); expect(drawFrameCalled.isCompleted, true); }); - }); + // https://github.com/flutter/flutter/issues/160096 + }, skip: ui_web.browser.isFirefox); } class MockHighContrastSupport implements HighContrastSupport {