Update contrib.
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
3 // All rights reserved.
4 // This component and the accompanying materials are made available
5 // under the terms of "Eclipse Public License v1.0"
6 // which accompanies this distribution, and is available
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
17 #include "ECamAdvTest.h"
19 #include <ecam/ecamplugin.h>
20 #include <ecamuids.hrh>
22 #include <ecom/ecomresolverparams.h>
23 #include "ECamUnitTestPluginUids.hrh"
25 const TInt KEmptyKeyValue = 0;
30 RECamTest* RECamTest::NewL(TBool aAllocTest)
32 RECamTest* self = new (ELeave) RECamTest(aAllocTest);
36 RECamTest::RECamTest(TBool /*aAllocTest*/)
38 iTestStepName = _L("MM-ECM-ADV-U-003-HP");
41 TVerdict RECamTest::DoTestStepL()
43 TVerdict result = EPass;
44 CCamera* camera = NULL;
45 MCameraObserver* observer = NULL;
46 MCameraObserver2* observer2 = NULL;
47 TInt error = KErrNone;
49 INFO_PRINTF1(_L("Check Opening CCam gives KErrNone"));
51 INFO_PRINTF1(_L("Checking basic CCamera::NewL()"));
53 TRAP(error, camera = CCamera::NewL(*observer, 0));
56 INFO_PRINTF2(_L("Unexpected %d return from CCamera::NewL()"), error);
71 INFO_PRINTF1(_L("Checking basic CCamera::NewDuplicateL()"));
73 TRAP(error, camera = CCamera::NewDuplicateL(*observer, 0));
76 INFO_PRINTF2(_L("Unexpected %d return from CCamera::NewDuplicateL()"), error);
91 INFO_PRINTF1(_L("Checking additional \"ChunkAPI\" factory functions"));
92 INFO_PRINTF1(_L("Checking CCamera::New2L()"));
94 TRAP(error, camera = CCamera::New2L(*observer2, 0, 0));
97 INFO_PRINTF2(_L("Unexpected %d return from CCamera::New2L()"), error);
112 INFO_PRINTF1(_L("Checking CCamera::NewDuplicate2L()"));
116 TRAP(error, camera = CCamera::NewDuplicate2L(*observer2, 0));
119 INFO_PRINTF2(_L("Unexpected %d return from CCamera::NewDuplicate2L()"), error);
141 RECamInnerTest* RECamInnerTest::NewL(TBool aAllocTest)
143 RECamInnerTest* self = new (ELeave) RECamInnerTest(aAllocTest);
147 RECamInnerTest::RECamInnerTest(TBool /*aAllocTest*/)
149 iTestStepName = _L("MM-ECM-ADV-U-004-LP");
152 TVerdict RECamInnerTest::DoTestStepL()
154 INFO_PRINTF1(_L("Check can actually open ECam plugin"));
155 TVerdict result = EPass;
157 INFO_PRINTF1(_L("Open stub plugin directly"));
160 TUid implementationUid = {KUidCameraUnitTestPlugin};
161 TUid destructorKey = {KEmptyKeyValue};
162 CCamera* camera = NULL;
165 camera = static_cast<CCamera*>
166 (REComSession::CreateImplementationL(implementationUid, destructorKey)));
168 if (error != KErrNone)
170 INFO_PRINTF2(_L("CreateImplementationL() failed - %d"), error);
176 REComSession::DestroyedImplementation(destructorKey);
177 REComSession::FinalClose();