First public contribution.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef __SSNDTESTSTEP_H__
22 #define __SSNDTESTSTEP_H__
24 #include <test/testexecutestepbase.h>
27 /** CResetDbStep class resets the system sound
28 repository to factory default condition which is
31 _LIT(KResetDb, "ResetDb");
32 class CResetDbStep : public CTestStep
36 virtual TVerdict doTestStepL(void);
39 /** This base class is common to teststeps which
40 need to read sound data from the TEF ini file to
41 construct the sound for testing.
43 class CSsndBaseStep : public CTestStep
46 void ConstructSoundL(void);
49 /** sound created with input from TEF ini file */
50 TBaSystemSoundInfo iSound;
54 CGetSoundStep class reads a sound instance from CentRep
55 and compares with expected values.
57 _LIT(KGetSound, "GetSound");
58 class CGetSoundStep : public CSsndBaseStep
62 virtual TVerdict doTestStepL(void);
65 /** sound data read from CentRep */
66 TBaSystemSoundInfo iReadFromRep;
69 /** CSetSoundStep class sets a sound in repository.
71 _LIT(KSetSound, "SetSound");
72 class CSetSoundStep : public CSsndBaseStep
76 virtual TVerdict doTestStepL(void);
80 CCorruptSoundStep class tests GetSound able to detect
81 corruption of the soundtype, sound cat. and path length fields.
83 _LIT(KCorruptSound, "CorruptSound");
84 class CCorruptSoundStep : public CSsndBaseStep
88 virtual TVerdict doTestStepL(void);
91 /** sound data read from CentRep */
92 TBaSystemSoundInfo iReadFromRep;
95 /** CSystemSoundFileTestStep class exercise the SystemSoundFile API.
97 _LIT(KSystemSoundFileTest, "SystemSoundFileTest");
98 class CSystemSoundFileTestStep : public CTestStep
101 CSystemSoundFileTestStep();
102 virtual TVerdict doTestStepL(void);
105 /** CGapTestStep class tests BaSystemSound can detect rogue
106 applications created entries which will interfere with SetSoundL.
108 _LIT(KGapTest, "GapTest");
109 class CGapTestStep : public CTestStep
113 virtual TVerdict doTestStepL(void);
116 /** CSoundFileNoPathTestStep class tests BaSystemSound can detect rogue
117 applications created entries which will interfere with SetSoundL.
119 _LIT(KSoundFileNoPathTest, "SoundFileNoPathTest");
120 class CSoundFileNoPathTestStep : public CTestStep
123 CSoundFileNoPathTestStep();
124 virtual TVerdict doTestStepL(void);
127 /** CLockoutTestStep class exercise the SetSoundL
128 and CBaSystemSoundArray::RestoreL APIs while backup/restore
129 is in progress to verify server lockout is handled correctly.
131 _LIT(KLockoutTest, "LockoutTest");
132 class CLockoutTestStep : public CTestStep
136 virtual TVerdict doTestStepL(void);
138 void addSoundInstanceL(TInt32 aSequence);
139 void readSoundsBackL();
142 /** TWorkerData struct is provided for concurrent SetSound threads
143 to record their results.
147 inline TWorkerData() : iTranFailCount(0), iKey(0), iDone(EFalse) {}
149 /** how many times the set sound transaction commit fail */
152 /** the CentRep key used by (assigned to) the sound */
155 /** indicates to the master thread that the worker has
156 completed the set sound task */
160 /** CConcurrentStep class tests multiple threads calling
161 SetSoundL simultaneously. One of the threads running in paraellel
162 is assigned the master role. It does not call SetSoundL. It just
163 waits for the other threads to complete their calls and tallies
166 _LIT(KConcurrentSetSound, "ConcurrentSetSound");
167 class CConcurrentStep : public CSsndBaseStep
171 virtual TVerdict doTestStepL();
172 virtual TVerdict doTestStepPostambleL();
175 void DoMasterTaskL(TInt aNumWorkers, TBool aSsndIdAreSame);
178 /** Id of the worker threads. Also used as index to store test
179 results in the global array of TWorkerData.