Skip to content

Commit b803c4d

Browse files
authored
Merge branch 'main' into main
2 parents e3ce3c1 + d0c7d1f commit b803c4d

59 files changed

Lines changed: 446 additions & 513 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/sync_release_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
1515

16-
- name: Create Pull Request
16+
- name: Create Pull Request
1717
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79
1818
with:
1919
token: ${{ secrets.GITHUB_TOKEN }}

packages/camera/camera_avfoundation/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.9.22+9
2+
3+
* Migrates `FLTSavePhotoDelegate`, `FLTWritableData`, and `FLTImageStreamHandler` classes to Swift.
4+
* Migrates `CameraProperties` and `QueueUtils` helpers to Swift.
5+
16
## 0.9.22+8
27

38
* Migrates `FLTPermissionServicing` and `FLTCameraPermissionManager` classes to Swift.

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraPermissionTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import AVFoundation
6+
import Flutter
67
import XCTest
78

89
@testable import camera_avfoundation

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraPropertiesTests.swift

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,68 +19,60 @@ final class CameraPropertiesTests: XCTestCase {
1919
func testGetAVCaptureFlashModeForPigeonFlashMode() {
2020
XCTAssertEqual(
2121
AVCaptureDevice.FlashMode.off,
22-
FCPGetAVCaptureFlashModeForPigeonFlashMode(FCPPlatformFlashMode.off))
22+
getAVCaptureFlashMode(for: .off))
2323
XCTAssertEqual(
2424
AVCaptureDevice.FlashMode.auto,
25-
FCPGetAVCaptureFlashModeForPigeonFlashMode(FCPPlatformFlashMode.auto))
25+
getAVCaptureFlashMode(for: .auto))
2626
XCTAssertEqual(
2727
AVCaptureDevice.FlashMode.on,
28-
FCPGetAVCaptureFlashModeForPigeonFlashMode(FCPPlatformFlashMode.always))
29-
30-
// TODO(FirentisTFW): Migrate implementation to throw Swift error in this case.
31-
let exception = ExceptionCatcher.catchException {
32-
_ = FCPGetAVCaptureFlashModeForPigeonFlashMode(.torch)
33-
}
34-
XCTAssertNotNil(exception)
28+
getAVCaptureFlashMode(for: .always))
3529
}
3630

3731
// MARK: - Video Format Tests
3832

3933
func testGetPixelFormatForPigeonFormat() {
4034
XCTAssertEqual(
4135
kCVPixelFormatType_32BGRA,
42-
FCPGetPixelFormatForPigeonFormat(FCPPlatformImageFormatGroup.bgra8888))
36+
getPixelFormat(for: .bgra8888))
4337
XCTAssertEqual(
4438
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange,
45-
FCPGetPixelFormatForPigeonFormat(FCPPlatformImageFormatGroup.yuv420))
39+
getPixelFormat(for: .yuv420))
4640
}
4741

4842
// MARK: - Device Orientation Tests
4943

5044
func testGetUIDeviceOrientationForPigeonDeviceOrientation() {
5145
XCTAssertEqual(
5246
UIDeviceOrientation.portraitUpsideDown,
53-
FCPGetUIDeviceOrientationForPigeonDeviceOrientation(FCPPlatformDeviceOrientation.portraitDown)
47+
getUIDeviceOrientation(for: .portraitDown)
5448
)
5549
XCTAssertEqual(
5650
UIDeviceOrientation.landscapeLeft,
57-
FCPGetUIDeviceOrientationForPigeonDeviceOrientation(
58-
FCPPlatformDeviceOrientation.landscapeLeft))
51+
getUIDeviceOrientation(for: .landscapeLeft))
5952
XCTAssertEqual(
6053
UIDeviceOrientation.landscapeRight,
61-
FCPGetUIDeviceOrientationForPigeonDeviceOrientation(
62-
FCPPlatformDeviceOrientation.landscapeRight))
54+
getUIDeviceOrientation(for: .landscapeRight))
6355
XCTAssertEqual(
6456
UIDeviceOrientation.portrait,
65-
FCPGetUIDeviceOrientationForPigeonDeviceOrientation(FCPPlatformDeviceOrientation.portraitUp))
57+
getUIDeviceOrientation(for: .portraitUp))
6658
}
6759

6860
func testGetPigeonDeviceOrientationForUIDeviceOrientation() {
6961
XCTAssertEqual(
7062
FCPPlatformDeviceOrientation.portraitDown,
71-
FCPGetPigeonDeviceOrientationForOrientation(UIDeviceOrientation.portraitUpsideDown))
63+
getPigeonDeviceOrientation(for: .portraitUpsideDown))
7264
XCTAssertEqual(
7365
FCPPlatformDeviceOrientation.landscapeLeft,
74-
FCPGetPigeonDeviceOrientationForOrientation(UIDeviceOrientation.landscapeLeft))
66+
getPigeonDeviceOrientation(for: .landscapeLeft))
7567
XCTAssertEqual(
7668
FCPPlatformDeviceOrientation.landscapeRight,
77-
FCPGetPigeonDeviceOrientationForOrientation(UIDeviceOrientation.landscapeRight))
69+
getPigeonDeviceOrientation(for: .landscapeRight))
7870
XCTAssertEqual(
7971
FCPPlatformDeviceOrientation.portraitUp,
80-
FCPGetPigeonDeviceOrientationForOrientation(UIDeviceOrientation.portrait))
72+
getPigeonDeviceOrientation(for: .portrait))
8173
// Test default case.
8274
XCTAssertEqual(
8375
FCPPlatformDeviceOrientation.portraitUp,
84-
FCPGetPigeonDeviceOrientationForOrientation(UIDeviceOrientation.unknown))
76+
getPigeonDeviceOrientation(for: .unknown))
8577
}
8678
}

packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraTestUtils.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
56
import XCTest
67

78
@testable import camera_avfoundation

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockAssetWriter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
6+
57
@testable import camera_avfoundation
68

79
// Import Objective-C part of the implementation when SwiftPM is used.

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockAssetWriterInput.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
6+
57
@testable import camera_avfoundation
68

79
// Import Objective-C part of the implementation when SwiftPM is used.

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockAssetWriterInputPixelBufferAdaptor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
6+
57
@testable import camera_avfoundation
68

79
// Import Objective-C part of the implementation when SwiftPM is used.

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockCamera.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
6+
import Flutter
7+
58
@testable import camera_avfoundation
69

710
// Import Objective-C part of the implementation when SwiftPM is used.

packages/camera/camera_avfoundation/example/ios/RunnerTests/Mocks/MockCameraDeviceDiscoverer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import AVFoundation
6+
57
@testable import camera_avfoundation
68

79
// Import Objective-C part of the implementation when SwiftPM is used.

0 commit comments

Comments
 (0)