|
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: Test Tools. |
|
15 * |
|
16 */ |
|
17 //////////////////////////////////////////////////////////////////////// |
|
18 // T_ProfileTestTools.h |
|
19 // |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <CNTDEF.H> |
|
24 #include <Profile.hrh> |
|
25 |
|
26 //CONSTS |
|
27 |
|
28 // default profile names |
|
29 _LIT( KProfileGeneralName, "General" ); |
|
30 _LIT( KProfileSilentName, "Silent" ); |
|
31 _LIT( KProfileMeetingName, "Meeting" ); |
|
32 _LIT( KProfileOutdoorName, "Outdoor" ); |
|
33 _LIT( KProfilePagerName, "Pager" ); |
|
34 #ifdef __OFFLINE_MODE |
|
35 _LIT( KProfileOfflineName, "Off-line" ); |
|
36 #endif |
|
37 #ifdef __DRIVE_MODE |
|
38 _LIT( KProfileDriveName, "Drive" ); |
|
39 #endif |
|
40 _LIT( KProfileInvalidName, "Invalid" ); |
|
41 _LIT( KProfileDynamicName, "New profile" ); |
|
42 |
|
43 // default tone settings |
|
44 _LIT( KProfileNokiaTune, "z:\\data\\sounds\\digital\\nokia tune.aac" ); |
|
45 _LIT( KProfileMessageTone, "z:\\data\\sounds\\digital\\message 1.aac" ); |
|
46 _LIT( KProfileIMMessageTone, "z:\\data\\sounds\\digital\\Chat alert.aac" ); |
|
47 _LIT( KProfileBeep, "z:\\data\\sounds\\simple\\beep.rng" ); |
|
48 _LIT( KProfileBeepTwice, "z:\\data\\sounds\\simple\\beep twice.rng" ); |
|
49 _LIT( KProfileNoSound, "z:\\resource\\no_sound.wav" ); |
|
50 |
|
51 // Tone size limit testing uses two different sized files. |
|
52 // They should be selected according to currently used limit. Initially 600kB. |
|
53 _LIT( KProEngMTTestToneSizeOk, "C:\\data\\sounds\\digital\\mt_below_limit.mp3" ); |
|
54 _LIT( KProEngMTTestToneSizeTooBig, "C:\\data\\sounds\\digital\\mt_over_limit.mp3" ); |
|
55 |
|
56 #ifdef __WINS__ |
|
57 _LIT( KProEngMTTestTone, "C:\\Data\\Sounds\\Digital\\flow.aac" ); |
|
58 #else |
|
59 _LIT( KProEngMTTestTone, "Z:\\Data\\Sounds\\Digital\\flow.aac" ); |
|
60 #endif |
|
61 |
|
62 #ifdef __WINS__ |
|
63 // combined delivery |
|
64 _LIT( KProEngMTTestDRM_CD_StartEndTone, "C:\\Data\\encrypted\\bee-boogie_start_end.dm" ); |
|
65 _LIT( KProEngMTTestDRM_CD_5TimesTone, "C:\\Data\\encrypted\\bee-boogie_5times.dm" ); |
|
66 _LIT( KProEngMTTestDRM_CD_FutureTone, "C:\\Data\\encrypted\\bee-boogie_future.dm" ); |
|
67 _LIT( KProEngMTTestDRM_CD_1YearTone, "C:\\Data\\encrypted\\bee-boogie_1year.dm" ); |
|
68 // separate delivery |
|
69 _LIT( KProEngMTTestDRM_SD_StartEndTone, "C:\\Data\\encrypted\\bee-boogie_sd_start_end.dcf" ); |
|
70 _LIT( KProEngMTTestDRM_SD_5TimesTone, "C:\\Data\\encrypted\\bee-boogie_sd_5times.dcf" ); |
|
71 _LIT( KProEngMTTestDRM_SD_1YearTone, "C:\\Data\\encrypted\\bee-boogie_sd_1year.dcf" ); |
|
72 _LIT( KProEngMTTestDRM_SD_DisplayOnly, "C:\\Data\\encrypted\\bee-boogie_sd_display_only.dcf" ); |
|
73 #else |
|
74 // Note, that these files must be always downloaded first from |
|
75 // http://trsrv42.wirelessfuture.com/content/s60/index.wml |
|
76 // combined delivery |
|
77 _LIT( KProEngMTTestDRM_CD_StartEndTone, "C:\\Data\\sounds\\digital\\DDCD_TestTrack2MT.dcf" ); |
|
78 _LIT( KProEngMTTestDRM_CD_5TimesTone, "C:\\Data\\sounds\\digital\\DDCD_11KHz_55b_MP4_LC.dcf" ); |
|
79 _LIT( KProEngMTTestDRM_CD_FutureTone, "C:\\Data\\sounds\\digital\\DDCD_mp3FutureRo.dcf" ); |
|
80 _LIT( KProEngMTTestDRM_CD_1YearTone, "C:\\Data\\sounds\\digital\\DDCD_TestTrack_3_MT.dcf" ); |
|
81 // separate delivery |
|
82 _LIT( KProEngMTTestDRM_SD_StartEndTone, "C:\\Data\\sounds\\digital\\DDSD_TestTrack2MT.dcf" ); |
|
83 _LIT( KProEngMTTestDRM_SD_5TimesTone, "C:\\Data\\sounds\\digital\\DDSD_11KHz_55b_MP4_LC.dcf" ); |
|
84 _LIT( KProEngMTTestDRM_SD_1YearTone, "C:\\Data\\sounds\\digital\\DDSD_TestTrack_3_MT.dcf" ); |
|
85 _LIT( KProEngMTTestDRM_SD_DisplayOnly, "C:\\Data\\sounds\\digital\\SD_unusable_RO.dcf" ); |
|
86 #endif |
|
87 |
|
88 _LIT( KProEngMTTestName, "Test Profile" ); |
|
89 const TProfileRingingType KProEngMTTestRingingType( EProfileRingingTypeAscending ); |
|
90 const TProfileKeypadVolume KProEngMTTestKeypadVolume( EProfileKeypadVolumeLevel1 ); |
|
91 const TProfileRingingVolume KProEngMTTestRingingVolume( EProfileRingingVolumeLevel5 ); |
|
92 |
|
93 |
|
94 _LIT( KProfileEmpty, "" ); |
|
95 _LIT( KProfileMinName, "Z" ); |
|
96 _LIT( KProfileMaxName, "1234567890123456789012345678901234567890123456789012345678901234" ); // 64 |
|
97 //_LIT( KProfileTooLongProfileName, "1234567890123456789012345678901234567890123456789012345678901234567890" ); // 70 |
|
98 _LIT( KProfileMaxFileName, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" ); // 256 |
|
99 _LIT( KProfileTooLongFileName, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" ); // 257 |
|
100 _LIT( KProfileMaxStatusMessage, "1234567890123456789012345678901234567890" ); // 40 |
|
101 _LIT( KProfileMaxCallObjectText, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" ); // 1000 |
|
102 _LIT( KProfileTooLongCallObjectText, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" ); // 1001 |
|
103 |
|
104 const TInt KMaxNumberOfDynamicProfiles( 20 ); |
|
105 |
|
106 |
|
107 // FORWARD DECLARATION |
|
108 class RFs; |
|
109 class MProfile; |
|
110 class MProEngProfile; |
|
111 class MProEngProfileNameArray; |
|
112 class MProfilesNamesArray; |
|
113 struct TProfileToneSettings; |
|
114 class CPbkContactEngine; |
|
115 |
|
116 /** |
|
117 * Test Tools |
|
118 */ |
|
119 class T_ProfileTestTools |
|
120 { |
|
121 public: |
|
122 static void ResetRepository(); |
|
123 static TBool CompareArrays( const TArray<TContactItemId>& aArray1, const TArray<TContactItemId>& aArray2 ); |
|
124 static TBool CompareNameArrays( const MProEngProfileNameArray& aArray1, |
|
125 const MProfilesNamesArray& aArray2 ); |
|
126 static TBool CompareProfiles( MProEngProfile& ap1, MProfile& ap2 ); |
|
127 static TBool CheckArray( const MProfilesNamesArray& aArray ); |
|
128 static const TDesC& ProfileName( TInt aId ); |
|
129 static const TDesC& ProfileRingingTone( TInt aId ); |
|
130 static const TDesC& ProfileMessageAlertTone( TInt aId ); |
|
131 static const TDesC& ProfileIMMessageAlertTone( TInt aId ); |
|
132 static const TDesC& ProfileEmailAlertTone( TInt aId ); |
|
133 static const TDesC& ProfileVideoCallRingingTone( TInt aId ); |
|
134 static TBool CheckToneSettings( TInt aId, const TProfileToneSettings& aSettings ); |
|
135 static void CreateContactGroupsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine ); |
|
136 static void DeleteContactGroups( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine ); |
|
137 static void CreateContactsL( TInt aNumber, RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine ); |
|
138 static void DeleteContacts( RArray<TContactItemId>& aArray, CPbkContactEngine& aContactEngine ); |
|
139 static void WriteAlertForIdsToCenrepL( TInt aProfileId, RArray<TContactItemId>& aArray ); |
|
140 static void DeleteAlertForIdsFromCenrep( TInt aProfileId ); |
|
141 static TBool IsCenrepFeatureEnabledL( TUid aUid, TUint32 aKey ); |
|
142 }; |