Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

  • Updates path_provider_android to use DI to inject the fake Pigeon API implementation, instead of the Dart test generator, following the pattern of newer plugins in the repo.
  • Does the same for path_provider_foundation, and also replaces the use of mockito with a trivial fake, to simplify test maintenance.

Part of flutter/flutter#159886

Pre-Review Checklist

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

@stuartmorgan-g stuartmorgan-g added the override: no versioning needed Override the check requiring version bumps for most changes label Oct 29, 2025
@stuartmorgan-g stuartmorgan-g added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Oct 29, 2025
- Updates `path_provider_android` to use DI to inject the fake Pigeon
  API implementation, instead of the Dart test generator, following the
  pattern of newer plugins in the repo.
- Does the same for `path_provider_foundation`, and also replaces the
  use of mockito with a trivial fake, to simplify test maintenance.

Part of flutter/flutter#159886
@stuartmorgan-g stuartmorgan-g force-pushed the pigeon-dart-test-cleanup-path-provider branch from 4f503c7 to 0a53933 Compare October 29, 2025 18:08
@stuartmorgan-g
Copy link
Collaborator Author

CHANGELOG/version overrides: While technically there is a production code change here, it's just adding an optional, visibible-only-for-tests parameter, and moving one ivar initialization from the declaration to the constructor, so it's pretty clearly a no-op.

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 refactors the tests for path_provider_android and path_provider_foundation to no longer use Pigeon's Dart test generator. Instead, it uses dependency injection to provide a fake API implementation for testing. For path_provider_foundation, it also removes the dependency on mockito in favor of a simpler manual fake. The changes align with modern practices in the repository and simplify test maintenance. I have one suggestion to improve the test clarity in path_provider_android by adopting the more explicit fake implementation pattern used in path_provider_foundation.

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

Android changes LGTM!

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 override: no versioning needed Override the check requiring version bumps for most changes p: path_provider platform-android platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants