45
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 - 2007 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".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Test AknBitmapAnimation.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <stiftestinterface.h>
|
|
22 |
#include <settingserverclient.h>
|
|
23 |
#include <coeaui.h>
|
|
24 |
|
|
25 |
#include "testsdkanimation.h"
|
|
26 |
|
|
27 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
28 |
|
|
29 |
// -----------------------------------------------------------------------------
|
|
30 |
// CTestSDKAnimation::CTestSDKAnimation
|
|
31 |
// C++ default constructor can NOT contain any code, that
|
|
32 |
// might leave.
|
|
33 |
// -----------------------------------------------------------------------------
|
|
34 |
CTestSDKAnimation::CTestSDKAnimation( CTestModuleIf& aTestModuleIf ):
|
|
35 |
CScriptBase( aTestModuleIf )
|
|
36 |
{
|
|
37 |
}
|
|
38 |
|
|
39 |
// -----------------------------------------------------------------------------
|
|
40 |
// CTestSDKAnimation::ConstructL
|
|
41 |
// Symbian 2nd phase constructor can leave.
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
void CTestSDKAnimation::ConstructL()
|
|
44 |
{
|
|
45 |
//Read logger settings to check whether test case name is to be
|
|
46 |
//appended to log file name.
|
|
47 |
RSettingServer settingServer;
|
|
48 |
CleanupClosePushL( settingServer );
|
|
49 |
TInt ret = settingServer.Connect();
|
|
50 |
if(ret != KErrNone)
|
|
51 |
{
|
|
52 |
User::Leave(ret);
|
|
53 |
}
|
|
54 |
// Struct to StifLogger settigs.
|
|
55 |
TLoggerSettings loggerSettings;
|
|
56 |
// Parse StifLogger defaults from STIF initialization file.
|
|
57 |
ret = settingServer.GetLoggerSettings(loggerSettings);
|
|
58 |
if(ret != KErrNone)
|
|
59 |
{
|
|
60 |
User::Leave(ret);
|
|
61 |
}
|
|
62 |
// Close Setting server session
|
|
63 |
CleanupStack::PopAndDestroy( &settingServer );
|
|
64 |
|
|
65 |
TFileName logFileName;
|
|
66 |
|
|
67 |
if(loggerSettings.iAddTestCaseTitle)
|
|
68 |
{
|
|
69 |
TName title;
|
|
70 |
TestModuleIf().GetTestCaseTitleL(title);
|
|
71 |
logFileName.Format(KtestsdkanimationLogFileWithTitle, &title);
|
|
72 |
}
|
|
73 |
else
|
|
74 |
{
|
|
75 |
logFileName.Copy(KtestsdkanimationLogFile);
|
|
76 |
}
|
|
77 |
|
|
78 |
iLog = CStifLogger::NewL( KtestsdkanimationLogPath,
|
|
79 |
logFileName,
|
|
80 |
CStifLogger::ETxt,
|
|
81 |
CStifLogger::EFile,
|
|
82 |
EFalse );
|
|
83 |
_LIT( KFile, "C:\\resource\\testsdkanimation.rsc" );
|
|
84 |
iOffset = CCoeEnv::Static()->AddResourceFileL( KFile );
|
|
85 |
SendTestClassVersion();
|
|
86 |
}
|
|
87 |
|
|
88 |
// -----------------------------------------------------------------------------
|
|
89 |
// CTestSDKAnimation::NewL
|
|
90 |
// Two-phased constructor.
|
|
91 |
// -----------------------------------------------------------------------------
|
|
92 |
CTestSDKAnimation* CTestSDKAnimation::NewL( CTestModuleIf& aTestModuleIf )
|
|
93 |
{
|
|
94 |
CTestSDKAnimation* self = new( ELeave ) CTestSDKAnimation( aTestModuleIf );
|
|
95 |
|
|
96 |
CleanupStack::PushL( self );
|
|
97 |
self->ConstructL();
|
|
98 |
CleanupStack::Pop( self );
|
|
99 |
|
|
100 |
return self;
|
|
101 |
|
|
102 |
}
|
|
103 |
|
|
104 |
// Destructor
|
|
105 |
CTestSDKAnimation::~CTestSDKAnimation()
|
|
106 |
{
|
|
107 |
|
|
108 |
// Delete resources allocated from test methods
|
|
109 |
Delete();
|
|
110 |
|
|
111 |
// Delete logger
|
|
112 |
delete iLog;
|
|
113 |
|
|
114 |
CCoeEnv::Static()->DeleteResourceFile( iOffset );
|
|
115 |
}
|
|
116 |
|
|
117 |
//-----------------------------------------------------------------------------
|
|
118 |
// CTestSDKAnimation::SendTestClassVersion
|
|
119 |
// Method used to send version of test class
|
|
120 |
//-----------------------------------------------------------------------------
|
|
121 |
void CTestSDKAnimation::SendTestClassVersion()
|
|
122 |
{
|
|
123 |
TVersion moduleVersion;
|
|
124 |
moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
|
|
125 |
moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
|
|
126 |
moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
|
|
127 |
|
|
128 |
_LIT( KName, "testsdka.dll" );
|
|
129 |
TFileName moduleName( KName );
|
|
130 |
|
|
131 |
TBool newVersionOfMethod = ETrue;
|
|
132 |
TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
|
|
133 |
}
|
|
134 |
|
|
135 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
|
136 |
|
|
137 |
// -----------------------------------------------------------------------------
|
|
138 |
// LibEntryL is a polymorphic Dll entry point.
|
|
139 |
// Returns: CScriptBase: New CScriptBase derived object
|
|
140 |
// -----------------------------------------------------------------------------
|
|
141 |
EXPORT_C CScriptBase* LibEntryL(
|
|
142 |
CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
|
|
143 |
{
|
|
144 |
|
|
145 |
return ( CScriptBase* ) CTestSDKAnimation::NewL( aTestModuleIf );
|
|
146 |
|
|
147 |
}
|
|
148 |
// End of File
|