Skip to content

[camera_avfoundation] Migrate tests to Swift - part 2 - #8613

Merged
auto-submit[bot] merged 24 commits into
flutter:mainfrom
leancodepl:feature/camera-swift-test-migration-part2
Feb 18, 2025
Merged

[camera_avfoundation] Migrate tests to Swift - part 2#8613
auto-submit[bot] merged 24 commits into
flutter:mainfrom
leancodepl:feature/camera-swift-test-migration-part2

Conversation

@FirentisTFW

@FirentisTFWFirentisTFW commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

This PR migrates some of Objective-C tests to Swift as a part of Swift migration: flutter/flutter/issues/119109.

I kept the names of test cases the same.

Tests migrated in this PR:

  • CameraCaptureSessionQueueRaceConditionTests
  • CameraMethodChannelTests
  • CameraOrientationTests
  • CameraSettingsTests
  • CameraSessionPresetsTests

Pre-launch Checklist

Comment on lines +90 to +96
// AVAssetWriterInput needs these three keys, otherwise it throws.
var outputSettingsWithRequiredKeys = outputSettings ?? [:]
outputSettingsWithRequiredKeys[AVVideoCodecKey] = AVVideoCodecType.h264
outputSettingsWithRequiredKeys[AVVideoWidthKey] = 1280
outputSettingsWithRequiredKeys[AVVideoHeightKey] = 720

return AVAssetWriterInput(mediaType: .video, outputSettings: outputSettingsWithRequiredKeys)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

In Objective-C it worked without these three keys, although the documentation still says that they're needed. For Swift, I had to add them here, otherwise AVAssetWriterInput constructor throws, as per the documentation:

When using this initializer, a video settings dictionary must be fully specified, meaning that it must contain AVVideoCodecKey, AVVideoWidthKey, and AVVideoHeightKey.

and

This method throws an exception for any of the following reasons:
...
- for video inputs, the output settings do not contain a required key (AVVideoCodecKey, AVVideoWidthKey, AVVideoHeightKey)

And in this test we only have AVVideoCompressionPropertiesKey in options here.

@FirentisTFW
FirentisTFWforce-pushed the feature/camera-swift-test-migration-part2 branch from 3227f58 to 612c425CompareFebruary 13, 2025 15:26
@FirentisTFW
FirentisTFW marked this pull request as ready for review February 13, 2025 15:43

@hellohuanlinhellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some nits

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This file was migrated to Swift in the previous PR, but I did not remove the ObjectiveC version - now it's done.

@FirentisTFW

Copy link
Copy Markdown
ContributorAuthor

@stuartmorgan Would you like to do a secondary review or can I land it?

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

I only skimmed it, since it doesn't need a second full review, but other than the missing test file this looks good to land.

@FirentisTFWFirentisTFW added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 18, 2025
@auto-submit
auto-submitBot merged commit 89f6e93 into flutter:mainFeb 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 18, 2025
github-merge-queueBot pushed a commit to flutter/flutter that referenced this pull request Feb 18, 2025
flutter/packages@8542af3...cb4fb13
2025-02-18 56475207+Dan-Crane@users.noreply.github.com
[shared_preferences] Fix JSON parsing issue with _decodeValue
(flutter/packages#8211)
2025-02-18 pawel.jakubowski@leancode.pl [camera_avfoundation] Migrate
tests to Swift - part 2 (flutter/packages#8613)
2025-02-18 stuartmorgan@google.com [google_sign_in] Adopt task queues
for Android (flutter/packages#8622)
2025-02-17 engine-flutter-autoroll@skia.org Roll Flutter from
892f9c1 to e8f34a9 (71 revisions) (flutter/packages#8614)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
This PR migrates some of Objective-C tests to Swift as a part of Swift migration: [flutter/flutter/issues/119109](flutter/flutter#119109).
I kept the names of test cases the same.
Tests migrated in this PR:
- CameraCaptureSessionQueueRaceConditionTests
- CameraMethodChannelTests
- CameraOrientationTests
- CameraSettingsTests
- CameraSessionPresetsTests
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
This PR migrates some of Objective-C tests to Swift as a part of Swift migration: [flutter/flutter/issues/119109](flutter/flutter#119109).
I kept the names of test cases the same.
Tests migrated in this PR:
- CameraCaptureSessionQueueRaceConditionTests
- CameraMethodChannelTests
- CameraOrientationTests
- CameraSettingsTests
- CameraSessionPresetsTests
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
This PR migrates some of Objective-C tests to Swift as a part of Swift migration: [flutter/flutter/issues/119109](flutter/flutter#119109).
I kept the names of test cases the same.
Tests migrated in this PR:
- CameraCaptureSessionQueueRaceConditionTests
- CameraMethodChannelTests
- CameraOrientationTests
- CameraSettingsTests
- CameraSessionPresetsTests
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
This PR migrates some of Objective-C tests to Swift as a part of Swift migration: [flutter/flutter/issues/119109](flutter/flutter#119109).
I kept the names of test cases the same.
Tests migrated in this PR:
- CameraCaptureSessionQueueRaceConditionTests
- CameraMethodChannelTests
- CameraOrientationTests
- CameraSettingsTests
- CameraSessionPresetsTests
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: cameraplatform-iosplatform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@FirentisTFW@stuartmorgan-g@hellohuanlin