Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nit
  • Loading branch information
camsim99 committed Feb 19, 2025
commit 7d0df1edc54ca2608996368fd40d491e88fff5fb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class AndroidCameraCameraX extends CameraPlatform {
@visibleForTesting
late double sensorOrientationDegrees;

/// Whether or not the Android Surface producer automatically handles
/// Whether or not the Android surface producer automatically handles
/// correcting the rotation of camera previews for the device this plugin runs on.
@visibleForTesting
Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to not inspect the internal state of these variables as the test (in other words, not make them @visibleForTesting and make them private instead), and instead inspect the output of the widget tree. I'll leave more comments on the test itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left these as visible so that we can set them directly in the preview_rotation_test.dart. These values being fetched as expected is tested in android_camera_camerax_test.dart.

Copy link
Contributor

Choose a reason for hiding this comment

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

Left these as visible so that we can set them directly in the preview_rotation_test.dart.

Is it possible to write that test without setting these variables directly? By setting them directly, we are bypassing the logic that is initially used to set them (in createCameraWithSettings) which if I remember correctly was a significant source of difficulty.

late bool handlesCropAndRotation;
Expand Down