Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jan 10, 2026

Part of flutter/flutter#180787

◇ Test run started.
↳ Testing Library Version: 102 (arm64-apple-ios13.0-simulator)
◇ Suite QuickActionsPluginTests started.
◇ Test applicationDidBecomeActiveLaunchWithShortcut() started.
◇ Test handleMethodCallClearShortcutItems() started.
◇ Test applicationDidBecomeActiveLaunchWithoutShortcut() started.
◇ Test applicationPerformActionForShortcutItem() started.
◇ Test applicationDidBecomeActiveLaunchWithShortcutBecomeActiveTwice() started.
◇ Test applicationDidFinishLaunchingWithOptionsLaunchWithoutShortcut() started.
◇ Test handleMethodCallSetShortcutItems() started.
◇ Test applicationDidFinishLaunchingWithOptionsLaunchWithShortcut() started.
✔ Test applicationDidBecomeActiveLaunchWithShortcutBecomeActiveTwice() passed after 0.003 seconds.
✔ Test applicationDidBecomeActiveLaunchWithShortcut() passed after 0.003 seconds.
✔ Test applicationPerformActionForShortcutItem() passed after 0.003 seconds.
✔ Test applicationDidFinishLaunchingWithOptionsLaunchWithShortcut() passed after 0.003 seconds.
✔ Test applicationDidFinishLaunchingWithOptionsLaunchWithoutShortcut() passed after 0.003 seconds.
✔ Test handleMethodCallSetShortcutItems() passed after 0.003 seconds.
✔ Test handleMethodCallClearShortcutItems() passed after 0.003 seconds.
✔ Test applicationDidBecomeActiveLaunchWithoutShortcut() passed after 0.003 seconds.
✔ Suite QuickActionsPluginTests passed after 0.025 seconds.
✔ Test run with 8 tests passed after 0.026 seconds.

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8692855180982743569/+/u/Run_package_tests/native_test/stdout

Adding CHANGELOG override per #10761 (comment)

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the iOS quick actions plugin tests from XCTest to the new Swift Testing framework. The changes involve updating the test file QuickActionsPluginTests.swift to use the new @Test macros, #expect assertions, and async testing features. The project's Swift version is also updated to 6.0 to support Swift Testing.

The migration is well-executed. I have one suggestion to improve the robustness of an asynchronous test to better align with the original test's logic and be less dependent on the mock's implementation details.

@jmagman
Copy link
Member Author

jmagman commented Jan 10, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the iOS quick actions example tests from XCTest to the new Swift Testing framework. The changes are generally correct and follow the new testing patterns. I've identified a few areas for improvement in the test file: some assertion messages that were present in the original tests have been lost, and one test can be made more robust to match its descriptive name. My detailed comments provide suggestions to address these points.

waitForExpectations(timeout: 1)

XCTAssertEqual(invokeMethodCount, 1, "shortcut should only be handled once per launch.")
#expect(invokeMethodCount == 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This test's name implies that applicationDidBecomeActive is called twice, but it's only called once. To make the test align with its name and more robustly check that the shortcut is handled only once, consider calling applicationDidBecomeActive a second time. Additionally, the descriptive message from the original assertion was lost and should be restored.

// Call a second time to ensure the shortcut is not handled again.
plugin.applicationDidBecomeActive(UIApplication.shared)
#expect(invokeMethodCount == 1, "shortcut should only be handled once per launch.")

@jmagman jmagman added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: quick_actions platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant