Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70b41e1

Browse files
authored
[camera_avfoundation] Migrate tests to Swift - part 3 (#8661)
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:- PhotoCaptureTests- SampleBufferTests- StramingTests- ThreadSafeEventChannelTestsI also migrated two Mock classes to Swift, but I think that for most of mocks it'd be easier to migrate them when migrating the actual implementation to Swift.
1 parent043e804 commit70b41e1

20 files changed

+756
-925
lines changed

‎packages/camera/camera_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj‎

Lines changed: 27 additions & 34 deletions
Large diffs are not rendered by default.

‎packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraTestUtils.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ extern CMSampleBufferRef FLTCreateTestSampleBuffer(void);
3030
/// @return a test audio sample buffer.
3131
externCMSampleBufferRefFLTCreateTestAudioSampleBuffer(void);
3232

33+
/// Calls `dispatch_queue_set_specific` with a key that is used to identify the queue.
34+
/// This method is needed for comaptibility of Swift tests with Objective-C code.
35+
/// In Swift, the API for settinng key-value pairs on a queue is different, so Swift tests
36+
/// need to call this method to set the key-value pair on the queue in a way that's
37+
/// compatible withn the existing Objective-C code.
38+
externvoidFLTdispatchQueueSetSpecific(dispatch_queue_tqueue,constvoid*key);
39+
3340
NS_ASSUME_NONNULL_END

‎packages/camera/camera_avfoundation/example/ios/RunnerTests/CameraTestUtils.m‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ CMSampleBufferRef FLTCreateTestAudioSampleBuffer(void) {
127127
CFRelease(formatDescription);
128128
return sampleBuffer;
129129
}
130+
131+
voidFLTdispatchQueueSetSpecific(dispatch_queue_t queue,constvoid *key) {
132+
dispatch_queue_set_specific(queue, key, (void *)key,NULL);
133+
}

‎packages/camera/camera_avfoundation/example/ios/RunnerTests/FLTCamPhotoCaptureTests.m‎

Lines changed: 0 additions & 216 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp