From 8ce2fc1448fb4d92480059957cb6c0b76896b59e Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Tue, 20 Dec 2022 18:45:06 +0100 Subject: [PATCH] Add back lost RotationCamera tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lost in https://webrtc.googlesource.com/src/+/c8a6fb2bb8762de17008dee97c5fb6e762f7e056 Bug: webrtc:8382 Change-Id: Ic9abd5d2b5d2593354e759c328b423ba272c8b9b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288700 Reviewed-by: Daniel.L (Byoungchan) Lee Reviewed-by: Kári Helgason Commit-Queue: Daniel.L (Byoungchan) Lee Cr-Commit-Position: refs/heads/main@{#38991} --- .../unittests/RTCCameraVideoCapturerTests.mm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sdk/objc/unittests/RTCCameraVideoCapturerTests.mm b/sdk/objc/unittests/RTCCameraVideoCapturerTests.mm index 4285eb5ca2..aaea515bae 100644 --- a/sdk/objc/unittests/RTCCameraVideoCapturerTests.mm +++ b/sdk/objc/unittests/RTCCameraVideoCapturerTests.mm @@ -210,6 +210,7 @@ CMSampleBufferRef createTestSampleBufferRef() { #endif } +// The XCTest framework considers functions that don't take arguments tests. This is a helper. - (void)testRotationCamera:(AVCaptureDevicePosition)camera withOrientation:(UIDeviceOrientation)deviceOrientation { #if TARGET_OS_IPHONE @@ -264,6 +265,26 @@ CMSampleBufferRef createTestSampleBufferRef() { #endif } +- (void)testRotationCameraBackLandscapeLeft { + [self testRotationCamera:AVCaptureDevicePositionBack + withOrientation:UIDeviceOrientationLandscapeLeft]; +} + +- (void)testRotationCameraFrontLandscapeLeft { + [self testRotationCamera:AVCaptureDevicePositionFront + withOrientation:UIDeviceOrientationLandscapeLeft]; +} + +- (void)testRotationCameraBackLandscapeRight { + [self testRotationCamera:AVCaptureDevicePositionBack + withOrientation:UIDeviceOrientationLandscapeRight]; +} + +- (void)testRotationCameraFrontLandscapeRight { + [self testRotationCamera:AVCaptureDevicePositionFront + withOrientation:UIDeviceOrientationLandscapeRight]; +} + - (void)setExif:(CMSampleBufferRef)sampleBuffer { rtc::ScopedCFTypeRef exif(CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));