-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker] Refactored tests to expose private interface in separate test header. #4722
[image_picker] Refactored tests to expose private interface in separate test header. #4722
Conversation
12a3e7c
to
bd955e9
Compare
packages/image_picker/image_picker/ios/Classes/FLTImagePickerPlugin_Test.h
Show resolved
Hide resolved
packages/image_picker/image_picker/ios/Classes/image_picker-umbrella.h
Outdated
Show resolved
Hide resolved
packages/image_picker/image_picker/ios/Classes/image_picker-umbrella.h
Outdated
Show resolved
Hide resolved
Refactored the existing unit tests to expose private interfaces in a separate test header instead of an inline interface. This was first introduced in the google_sign_in plugin (flutter#4157) and after that also applied in the camera plugin (flutter#4426) and the webview_flutter plugin (flutter#4480).
3921f8d
to
ce306e7
Compare
@@ -6,6 +6,7 @@ | |||
|
|||
@import image_picker; | |||
@import XCTest; | |||
#import <image_picker/FLTImagePickerImageUtil.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this still relying on the bug in the framework (that it includes this header in the packaged framework at all)?
Pre module-map I would expect this to just be #import "FLTImagePickerImageUtil.h"
with appropriate include paths for the target. I expect there's probably a cleaner way using the Test module though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvanbeusekom i think you can put this header under the submodule Test
that you've created, and just do @import image_picker.Test;
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution proposed by @hellohuanlin worked like a charm. Thanks
ce306e7
to
31442f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for getting into the weeds with this.
@stuartmorgan this needs another review since you requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'm sold on the specific things being exposed in the test header here, but we can tune that in the test PR if necessary; since the important thing is the structural change here, LGTM.
… in separate test header. (flutter/plugins#4722)
Refactored the existing unit tests to expose private interfaces in a separate test header instead of an inline interface. This was first introduced in the google_sign_in plugin (#4157) and after that also applied in the camera plugin (#4426) and the webview_flutter plugin (#4480).
I have moved this refactoring out of the changes I am working on for issue flutter/flutter#96903 and PR #4718.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).