From 9d63521b3e117d159589830e147c1a992fa64497 Mon Sep 17 00:00:00 2001 From: Christopher Fujino Date: Wed, 8 Jan 2025 16:33:14 -0800 Subject: [PATCH 1/3] Update Dart SDK to 1bf43bfd314768e235f6e5618842469bab6494bd --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index eb091429de1f3..5cc1fadc6b9eb 100644 --- a/DEPS +++ b/DEPS @@ -56,7 +56,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'ae7ca5199a0559db0ae60533e9cedd3ce0d6ab04', + 'dart_revision': '1bf43bfd314768e235f6e5618842469bab6494bd', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py From d65125bdf9573e93058f1d5bc2174df321faa4c5 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Mon, 28 Oct 2024 11:06:55 -0700 Subject: [PATCH 2/3] Switch some mac_unopt tests from intel to arm hosts (#55882) --- ci/builders/mac_unopt.json | 124 ++++++++++++------------------------- 1 file changed, 39 insertions(+), 85 deletions(-) diff --git a/ci/builders/mac_unopt.json b/ci/builders/mac_unopt.json index 3a95e217f5670..1f9a942362030 100644 --- a/ci/builders/mac_unopt.json +++ b/ci/builders/mac_unopt.json @@ -5,8 +5,7 @@ "drone_dimensions": [ "device_type=none", "os=Mac-13|Mac-14", - "cpu=x86", - "mac_model=Macmini8,1" + "cpu=arm64" ], "gclient_variables": { "download_android_deps": false, @@ -15,9 +14,11 @@ }, "gn": [ "--target-dir", - "ci/host_debug_tests", + "ci/host_debug_arm64_tests", "--runtime-mode", "debug", + "--mac-cpu", + "arm64", "--no-lto", "--prebuilt-dart-sdk", "--build-embedder-examples", @@ -25,12 +26,11 @@ "--rbe", "--no-goma", "--xcode-symlinks" - ], - "name": "ci/host_debug_tests", - "description": "Produces debug mode x64 macOS host-side tooling and builds host-side unit tests for x64 macOS.", + "name": "ci/host_debug_arm64_tests", + "description": "Produces debug mode arm64 macOS host-side tooling and builds host-side unit tests for arm64 macOS.", "ninja": { - "config": "ci/host_debug_tests", + "config": "ci/host_debug_arm64_tests", "targets": [] }, "properties": { @@ -44,8 +44,9 @@ "name": "Host Tests for host_debug", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", - "ci/host_debug_tests", + "ci/host_debug_arm64_tests", "--type", "dart,dart-host,engine", "--engine-capture-core-dump" @@ -58,8 +59,7 @@ "drone_dimensions": [ "device_type=none", "os=Mac-13|Mac-14", - "cpu=x86", - "mac_model=Macmini8,1" + "cpu=arm64" ], "gclient_variables": { "download_android_deps": false, @@ -67,9 +67,11 @@ }, "gn": [ "--target-dir", - "ci/host_profile_tests", + "ci/host_profile_arm64_tests", "--runtime-mode", "profile", + "--mac-cpu", + "arm64", "--no-lto", "--prebuilt-dart-sdk", "--build-embedder-examples", @@ -77,10 +79,10 @@ "--no-goma", "--xcode-symlinks" ], - "name": "ci/host_profile_tests", - "description": "Produces profile mode x64 macOS host-side tooling and builds host-side unit tests for x64 macOS.", + "name": "ci/host_profile_arm64_tests", + "description": "Produces profile mode arm64 macOS host-side tooling and builds host-side unit tests for arm64 macOS.", "ninja": { - "config": "ci/host_profile_tests", + "config": "ci/host_profile_arm64_tests", "targets": [] }, "properties": { @@ -94,8 +96,9 @@ "name": "Host Tests for host_profile", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", - "ci/host_profile_tests", + "ci/host_profile_arm64_tests", "--type", "dart,dart-host,engine", "--engine-capture-core-dump" @@ -108,14 +111,7 @@ "drone_dimensions": [ "device_type=none", "os=Mac-13|Mac-14", - "cpu=x86", - "mac_model=Macmini8,1" - ], - "dependencies": [ - { - "dependency": "goldctl", - "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd" - } + "cpu=arm64" ], "gclient_variables": { "download_android_deps": false, @@ -123,9 +119,11 @@ }, "gn": [ "--target-dir", - "ci/host_release_tests", + "ci/host_release_arm64_tests", "--runtime-mode", "release", + "--mac-cpu", + "arm64", "--no-lto", "--prebuilt-dart-sdk", "--build-embedder-examples", @@ -134,10 +132,10 @@ "--no-goma", "--xcode-symlinks" ], - "name": "ci/host_release_tests", - "description": "Produces release mode x64 macOS host-side tooling and builds host-side unit tests for x64 macOS.", + "name": "ci/host_release_arm64_tests", + "description": "Produces release mode arm64 macOS host-side tooling and builds host-side unit tests for arm64 macOS.", "ninja": { - "config": "ci/host_release_tests", + "config": "ci/host_release_arm64_tests", "targets": [] }, "properties": { @@ -148,11 +146,12 @@ "tests": [ { "language": "python3", - "name": "Impeller-golden, dart and engine tests for host_release", + "name": "Dart and engine tests for host_release", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", - "ci/host_release_tests", + "ci/host_release_arm64_tests", "--type", "dart,dart-host,engine" ] @@ -208,6 +207,7 @@ "name": "Impeller-golden for host_release", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", "ci/mac_release_arm64_tests", "--type", @@ -216,62 +216,6 @@ } ] }, - { - "cas_archive": false, - "drone_dimensions": [ - "device_type=none", - "os=Mac-13|Mac-14", - "cpu=x86", - "mac_model=Macmini8,1" - ], - "gclient_variables": { - "download_android_deps": false, - "use_rbe": true - }, - "gn": [ - "--target-dir", - "ci/host_debug_unopt", - "--runtime-mode", - "debug", - "--unoptimized", - "--no-lto", - "--prebuilt-dart-sdk", - "--enable-impeller-3d", - "--rbe", - "--no-goma", - "--xcode-symlinks" - ], - "name": "ci/host_debug_unopt", - "description": "Builds a debug mode unopt x64 macOS engine and runs host-side tests.", - "ninja": { - "config": "ci/host_debug_unopt", - "targets": [] - }, - "properties": { - "$flutter/osx_sdk": { - "sdk_version": "15a240d" - } - }, - "tests": [ - { - "language": "python3", - "name": "Host Tests for host_debug_unopt", - "script": "flutter/testing/run_tests.py", - "parameters": [ - "--variant", - "ci/host_debug_unopt", - "--type", - "dart,dart-host,engine", - "--engine-capture-core-dump" - ] - }, - { - "name": "Tests of tools/gn", - "language": "python3", - "script": "flutter/tools/gn_test.py" - } - ] - }, { "cas_archive": false, "properties": { @@ -318,6 +262,7 @@ "name": "Tests for ios_debug_unopt_sim", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", "ci/ios_debug_unopt_sim", "--type", @@ -358,6 +303,7 @@ "--prebuilt-dart-sdk", "--mac-cpu", "arm64", + "--enable-impeller-3d", "--rbe", "--no-goma", "--xcode-symlinks", @@ -381,6 +327,7 @@ "name": "Host Tests for host_debug_unopt_arm64", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", "ci/host_debug_unopt_arm64", "--type", @@ -388,6 +335,11 @@ "--engine-capture-core-dump", "--no-skia-gold" ] + }, + { + "name": "Tests of tools/gn", + "language": "python3", + "script": "flutter/tools/gn_test.py" } ] }, @@ -439,6 +391,7 @@ "name": "Tests for ios_debug_unopt_sim_arm64", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", "ci/ios_debug_unopt_sim_arm64", "--type", @@ -507,6 +460,7 @@ "name": "Tests for ios_debug_unopt_sim_arm64_extension_safe", "script": "flutter/testing/run_tests.py", "parameters": [ + "--quiet", "--variant", "ci/ios_debug_unopt_sim_arm64_extension_safe", "--type", From 00318ab4b9b01c30ff35718521f830c8271793db Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:11:35 -0700 Subject: [PATCH 3/3] Fixes crash in testTrackpadGesturesAreSentToFramework (#55990) fixes https://github.com/flutter/flutter/issues/157205 This crashed because ocmock was storing references to rvalues for its mocked arguments. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --- .../Source/FlutterViewControllerTest.mm | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm b/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm index b63cf439c96a1..2eff3d715677b 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTest.mm @@ -21,6 +21,9 @@ #pragma mark - Test Helper Classes +static const FlutterPointerEvent kDefaultFlutterPointerEvent = {}; +static const FlutterKeyEvent kDefaultFlutterKeyEvent = {}; + // A wrap to convert FlutterKeyEvent to a ObjC class. @interface KeyEventWrapper : NSObject @property(nonatomic) FlutterKeyEvent* data; @@ -339,7 +342,7 @@ - (bool)testKeyEventsAreSentToFramework:(id)engineMock { OCMStub( // NOLINT(google-objc-avoid-throwing-exception) [engineMock binaryMessenger]) .andReturn(binaryMessengerMock); - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andCall([FlutterViewControllerTestObjC class], @@ -375,7 +378,7 @@ - (bool)testKeyEventsAreSentToFramework:(id)engineMock { - (bool)testCtrlTabKeyEventIsPropagated:(id)engineMock { __block bool called = false; __block FlutterKeyEvent last_event; - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andDo((^(NSInvocation* invocation) { @@ -419,7 +422,7 @@ - (bool)testCtrlTabKeyEventIsPropagated:(id)engineMock { - (bool)testKeyEquivalentIsPassedToTextInputPlugin:(id)engineMock { __block bool called = false; __block FlutterKeyEvent last_event; - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andDo((^(NSInvocation* invocation) { @@ -471,7 +474,7 @@ - (bool)testKeyEventsArePropagatedIfNotHandled:(id)engineMock { OCMStub( // NOLINT(google-objc-avoid-throwing-exception) [engineMock binaryMessenger]) .andReturn(binaryMessengerMock); - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andCall([FlutterViewControllerTestObjC class], @@ -545,7 +548,7 @@ - (bool)testFlagsChangedEventsArePropagatedIfNotHandled:(id)engineMock { OCMStub( // NOLINT(google-objc-avoid-throwing-exception) [engineMock binaryMessenger]) .andReturn(binaryMessengerMock); - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andCall([FlutterViewControllerTestObjC class], @@ -598,7 +601,7 @@ - (bool)testKeyEventsAreNotPropagatedIfHandled:(id)engineMock { OCMStub( // NOLINT(google-objc-avoid-throwing-exception) [engineMock binaryMessenger]) .andReturn(binaryMessengerMock); - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andCall([FlutterViewControllerTestObjC class], @@ -655,7 +658,7 @@ - (bool)testKeyboardIsRestartedOnEngineRestart:(id)engineMock { .andReturn(binaryMessengerMock); __block bool called = false; __block FlutterKeyEvent last_event; - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andDo((^(NSInvocation* invocation) { @@ -715,7 +718,7 @@ - (bool)testTrackpadGesturesAreSentToFramework:(id)engineMock { OCMStub([engineMock renderer]).andReturn(renderer_); __block bool called = false; __block FlutterPointerEvent last_event; - OCMStub([[engineMock ignoringNonObjectArgs] sendPointerEvent:FlutterPointerEvent{}]) + OCMStub([[engineMock ignoringNonObjectArgs] sendPointerEvent:kDefaultFlutterPointerEvent]) .andDo((^(NSInvocation* invocation) { FlutterPointerEvent* event; [invocation getArgument:&event atIndex:2]; @@ -1139,7 +1142,7 @@ - (bool)testModifierKeysAreSynthesizedOnMouseMove:(id)engineMock { // Capture calls to sendKeyEvent __block NSMutableArray* events = [NSMutableArray array]; - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent callback:nil userData:nil]) .andDo((^(NSInvocation* invocation) {