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