Update contrib.
4 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
5 // All rights reserved.
6 // This component and the accompanying materials are made available
7 // under the terms of "Eclipse Public License v1.0"
8 // which accompanies this distribution, and is available
9 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
11 // Initial Contributors:
12 // Nokia Corporation - initial contribution.
19 #include <ecamuids.hrh>
20 #include "ECamInfoAdvTest.h"
22 #include <ecam/ecamplugin.h>
23 #include <ecam/ecaminfoplugin.h>
24 #include <ecom/ecomresolverparams.h>
25 #include "ECamUnitTestPluginUids.hrh"
27 const TInt KInvalidNumberOfCameras = -1;
28 const TInt KEmptyKeyValue = 0;
33 RECamInfoTest* RECamInfoTest::NewL(TBool aAllocTest)
35 RECamInfoTest* self = new (ELeave) RECamInfoTest(aAllocTest);
39 RECamInfoTest::RECamInfoTest(TBool /*aAllocTest*/)
41 iTestStepName = _L("MM-ECM-ADV-U-001-HP");
44 TVerdict RECamInfoTest::DoTestStepL()
46 INFO_PRINTF1(_L("Check CCamera::CamerasAvailable"));
47 INFO_PRINTF1(_L("using static function call"));
49 TInt numCameras = CCamera::CamerasAvailable();
54 INFO_PRINTF2(_L("Error %d returned"), numCameras);
57 INFO_PRINTF2(_L("Available cameras %d returned"), numCameras);
64 RECamInnerInfoTest* RECamInnerInfoTest::NewL(TBool aAllocTest)
66 RECamInnerInfoTest* self = new (ELeave) RECamInnerInfoTest(aAllocTest);
70 RECamInnerInfoTest::RECamInnerInfoTest(TBool /*aAllocTest*/)
72 iTestStepName = _L("MM-ECM-ADV-U-002-LP");
75 TVerdict RECamInnerInfoTest::DoTestStepL()
77 INFO_PRINTF1(_L("Check CCameraInfoPlugin"));
78 INFO_PRINTF1(_L("Use CCamera::CamerasAvailable"));
79 TInt numCameras = KInvalidNumberOfCameras;
80 TVerdict result = EPass;
82 INFO_PRINTF1(_L("Open set plugin directly"));
85 TUid implementationUid = {KUidCameraUnitTestInfo};
86 TUid destructorKey = {KEmptyKeyValue};
87 CCameraInfoPlugin* info = NULL;
88 TRAPD(error, info = static_cast<CCameraInfoPlugin*>
89 (REComSession::CreateImplementationL(implementationUid, destructorKey)));
91 if (error != KErrNone)
93 INFO_PRINTF3(_L("CreateImplementationL InfoPlugin %x failed %d"), KUidCameraUnitTestInfo, error);
98 INFO_PRINTF2(_L("CreateImplementationL InfoPlugin %x is OK"), destructorKey.iUid);
100 numCameras = info->CamerasAvailable();
101 INFO_PRINTF2(_L("Available cameras %d returned"), numCameras);
103 REComSession::DestroyedImplementation(destructorKey);
104 REComSession::FinalClose();
110 INFO_PRINTF2(_L("Error - camera %d returned"), numCameras);