1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/imagingandcamerafws/cameraunittest/src/TSU_ECM_ADV/ecamextendedfunctest.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,237 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef ECAMEXTENDEDFUNCTEST_H
1.20 +#define ECAMEXTENDEDFUNCTEST_H
1.21 +
1.22 +#include <testframework.h>
1.23 +#include "ECamObserverTest.h"
1.24 +#include "extended_functionality.h"
1.25 +
1.26 +class RECamClientViewFinderTest : public RTestStep
1.27 + {
1.28 +public:
1.29 + static RECamClientViewFinderTest* NewL(const TDesC& aTestStep);
1.30 +
1.31 +protected:
1.32 + // from RTestStep;
1.33 + TVerdict DoTestStepL();
1.34 +
1.35 + // new
1.36 + TVerdict DoTestStep_50L();
1.37 +
1.38 + TVerdict DoClientVFTestStepL();
1.39 +
1.40 +private:
1.41 + RECamClientViewFinderTest(const TDesC& aTestStep);
1.42 + };
1.43 +
1.44 +class RECamClientVFNotificationTest : public RECamObserverTest, public MClientViewFinderObserver
1.45 + {
1.46 +public:
1.47 + static RECamClientVFNotificationTest* NewL(TBool aAllocTest);
1.48 +
1.49 +protected:
1.50 + // from RTestStep;
1.51 + TVerdict DoTestStepL();
1.52 + TVerdict DoTestStepL_51L();
1.53 + void ConstructL();
1.54 +
1.55 +private:
1.56 + RECamClientVFNotificationTest(TBool aAllocTest);
1.57 +
1.58 + //MClientViewFinderObserver
1.59 + void ViewFinderBufferReady(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, TInt aErrorCode);
1.60 + void DirectHistogramDisplayed(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, CCamera::CCameraV2Histogram& aDirectHistogramDisplayed, TInt aErrorCode);
1.61 + void ClientHistogramReady(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode);
1.62 + void ImageProcessingFailed(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, TInt aErrorCode);
1.63 + TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface);
1.64 +
1.65 + void CheckViewFinderNegNotification(TInt aVFHandle, TVerdict& aResult);
1.66 +
1.67 +private:
1.68 +
1.69 + TInt iVFHandle;
1.70 + TInt iError;
1.71 + TUid iInputEventUid;
1.72 + };
1.73 +
1.74 +class RECamV2DirectViewFinderTest : public RTestStep
1.75 + {
1.76 +public:
1.77 + static RECamV2DirectViewFinderTest* NewL(const TDesC& aTestStep);
1.78 +
1.79 +protected:
1.80 + // from RTestStep;
1.81 + TVerdict DoTestStepL();
1.82 +
1.83 + // new
1.84 + TVerdict DoTestStep_52L();
1.85 +
1.86 + TVerdict DoV2DirectVFTestStepL();
1.87 +
1.88 +private:
1.89 + RECamV2DirectViewFinderTest(const TDesC& aTestStep);
1.90 + };
1.91 +
1.92 +class RECamV2DirectVFNotificationTest : public RECamObserverTest, public MDirectViewFinderObserver
1.93 + {
1.94 +public:
1.95 + static RECamV2DirectVFNotificationTest* NewL(TBool aAllocTest);
1.96 +
1.97 +protected:
1.98 + // from RTestStep;
1.99 + TVerdict DoTestStepL();
1.100 + TVerdict DoTestStep_53L();
1.101 +
1.102 + void ConstructL();
1.103 +
1.104 +private:
1.105 + RECamV2DirectVFNotificationTest(TBool aAllocTest);
1.106 +
1.107 + //MDirectViewFinderObserver
1.108 + void DirectViewFinderFirstFrameDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, TInt aErrorCode);
1.109 + void DirectHistogramDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, CCamera::CCameraV2Histogram& aDirectHistogramDisplayed, TInt aErrorCode);
1.110 + void ClientHistogramReady(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode);
1.111 + void DirectViewFinderFailed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, TInt aErrorCode);
1.112 + void DirectSnapshotForImageDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode);
1.113 + TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface);
1.114 +
1.115 + void CheckViewFinderNegNotification(TInt aVFHandle, TVerdict& aResult);
1.116 +
1.117 +private:
1.118 +
1.119 + TInt iVFHandle;
1.120 + TInt iError;
1.121 + TUid iInputEventUid;
1.122 + };
1.123 +
1.124 +class RECamPreImgCaptureNotificationTest : public RECamObserverTest, public MPreImageCaptureControlObserver
1.125 + {
1.126 +public:
1.127 + static RECamPreImgCaptureNotificationTest* NewL(TBool aAllocTest);
1.128 +
1.129 +protected:
1.130 + // from RTestStep;
1.131 + TVerdict DoTestStepL();
1.132 + TVerdict DoPreImgCaptureTestStepL();
1.133 +
1.134 +private:
1.135 + RECamPreImgCaptureNotificationTest(TBool aAllocTest);
1.136 +
1.137 + //MPreImageCaptureControlObserver
1.138 + void PrepareImageComplete(CCamera::CCameraImageCapture* aCaptureImageHandle, TInt aErrorCode);
1.139 + TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface);
1.140 +
1.141 + void CheckCaptureNotification(CCamera::CCameraImageCapture*& aImageCapture, TVerdict& aResult);
1.142 +
1.143 +private:
1.144 + CCamera::CCameraImageCapture* iCaptureImageHandle;
1.145 + TInt iError;
1.146 + TUid iInputEventUid;
1.147 + };
1.148 +
1.149 +class RECamImgCaptureNotificationTest : public RECamObserverTest, public MPreImageCaptureControlObserver, MCaptureImageObserver
1.150 + {
1.151 +public:
1.152 + static RECamImgCaptureNotificationTest* NewL(TBool aAllocTest);
1.153 +
1.154 +protected:
1.155 + // from RTestStep;
1.156 + TVerdict DoTestStepL();
1.157 + TVerdict DoImgCaptureAdvFuncConstruction();
1.158 +
1.159 +private:
1.160 + RECamImgCaptureNotificationTest(TBool aAllocTest);
1.161 +
1.162 + //MPreImageCaptureControlObserver
1.163 + void PrepareImageComplete(CCamera::CCameraImageCapture* aCaptureImageHandle, TInt aErrorCode);
1.164 + TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface);
1.165 +
1.166 + void CheckPreCaptureNotification(CCamera::CCameraImageCapture*& aImageCapture, TVerdict& aResult);
1.167 +
1.168 + //MCaptureImageObserver
1.169 + void IndividualImageControlHandle(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId);
1.170 + void ImageBufferReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode);
1.171 + void ClientSnapshotForImageReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MCameraBuffer2* aSnapshotBuffer, TInt aErrorCode);
1.172 + void DirectSnapshotForImageDisplayed(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode);
1.173 + void CutDownImageDirectSavingCompleted(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode);
1.174 + void ImageDirectSavingCompleted(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode);
1.175 + void ImageCaptureComplete(CCamera::CCameraImageCapture& aCaptureImageHandle, TInt aErrorCode);
1.176 + void ClientHistogramForImageReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode);
1.177 + void ClientHistogramForSnapshotReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode);
1.178 + void DirectHistogramForSnapshotDisplayed(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, CCamera::CCameraV2Histogram& aDirectHistogramDisplayed, TInt aErrorCode);
1.179 + void ProcessingFailed(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TUint aProcessingTypes, TInt aErrorCode);
1.180 +
1.181 + void CheckCaptureNotification(CCamera::CCameraImageCapture*& aImageCapture, TPostCaptureControlId& aPostCaptureControlId, TVerdict& aResult);
1.182 + void CheckCaptureCompletion(CCamera::CCameraImageCapture*& aImageCapture, TVerdict& aResult);
1.183 +
1.184 +private:
1.185 + CCamera::CCameraImageCapture* iCaptureImageHandle;
1.186 + TPostCaptureControlId iPostCaptureControlId;
1.187 + TUint iProcessingTypes;
1.188 + TInt iError;
1.189 + TUid iInputEventUid;
1.190 + };
1.191 +
1.192 +class RECamVideoCaptureControlTest : public RTestStep
1.193 + {
1.194 +public:
1.195 + static RECamVideoCaptureControlTest* NewL(const TDesC& aTestStep);
1.196 +
1.197 +protected:
1.198 + // from RTestStep;
1.199 + TVerdict DoTestStepL();
1.200 +
1.201 + // new
1.202 + TVerdict DoTestStep_56L();
1.203 +
1.204 + TVerdict DoVideoCaptureTestStepL();
1.205 +
1.206 +private:
1.207 + RECamVideoCaptureControlTest(const TDesC& aTestStep);
1.208 + };
1.209 +
1.210 +class RECamVideoCaptureNotificationTest : public RECamObserverTest, public MCaptureVideoObserver
1.211 + {
1.212 +public:
1.213 + static RECamVideoCaptureNotificationTest* NewL(TBool aAllocTest);
1.214 +
1.215 +protected:
1.216 + // from RTestStep;
1.217 + TVerdict DoTestStepL();
1.218 + void ConstructL();
1.219 +
1.220 +private:
1.221 + RECamVideoCaptureNotificationTest(TBool aAllocTest);
1.222 +
1.223 + //MCaptureVideoObserver
1.224 + void VideoBufferReady(MCameraBuffer2* aVideoBuffer, TInt aErrorCode);
1.225 + void ClientSnapshotReady(MCameraBuffer2* aSnapshotBuffer, TInt aErrorCode);
1.226 + void ClientHistogramReady(MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode);
1.227 + void ImageProcessingFailed(TInt aErrorCode);
1.228 + void DirectVideoCaptureFailed(TInt aErrorCode);
1.229 + TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface);
1.230 +
1.231 + void CheckVideoCaptureNegNotification(TInt aErrorCode, TVerdict& aResult);
1.232 +
1.233 +private:
1.234 +
1.235 + TInt iError;
1.236 + TUid iInputEventUid;
1.237 + };
1.238 +
1.239 +#endif // ECAMEXTENDEDFUNCTEST_H
1.240 +