24
|
1 |
// Copyright (c) 2008-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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// functional unit of the Common TSY Dispatcher.
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file The TEFUnit header file which tests the Phonebook
|
|
21 |
*/
|
|
22 |
|
|
23 |
/**
|
|
24 |
@file
|
|
25 |
@internalAll
|
|
26 |
*/
|
|
27 |
|
|
28 |
#ifndef CCTSYPHONEBOOKFU_H
|
|
29 |
#define CCTSYPHONEBOOKFU_H
|
|
30 |
|
|
31 |
#include <test/tefunit.h>
|
|
32 |
|
|
33 |
#include <etelmm.h>
|
|
34 |
#include <etelmmcs.h>
|
|
35 |
|
|
36 |
#include "cctsycomponenttestbase.h"
|
|
37 |
|
|
38 |
#include <ctsy/ltsy/cctsydispatchercallback.h>
|
|
39 |
#include <ctsy/ltsy/mltsydispatchphonebookinterface.h>
|
|
40 |
|
|
41 |
#include <ctsy/rmmcustomapi.h>
|
|
42 |
|
|
43 |
class CPhoneBookEntry;
|
|
44 |
|
|
45 |
class CCTsyPhonebookFU : public CCtsyComponentTestBase
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
// Create a suite of all the tests
|
|
49 |
static CTestSuite* CreateSuiteL(const TDesC& aName);
|
|
50 |
|
|
51 |
public:
|
|
52 |
// use-case tests
|
|
53 |
void TestUseCase0001L();
|
|
54 |
void TestUseCase0002L();
|
|
55 |
void TestUseCase0003L();
|
|
56 |
void TestUseCase0004L();
|
|
57 |
void TestUseCase0005L();
|
|
58 |
void TestUseCase0006L();
|
|
59 |
void TestUseCase0007L();
|
|
60 |
void TestUseCase0008L();
|
|
61 |
void TestUseCase0009L();
|
|
62 |
void TestUseCase0010L();
|
|
63 |
void TestUseCase0011L();
|
|
64 |
void TestUseCase0012L();
|
|
65 |
void TestUseCase0013L();
|
|
66 |
void TestUseCase0014L();
|
|
67 |
|
|
68 |
//other unit tests
|
|
69 |
void TestUnit0001L();
|
|
70 |
void TestUnit0002L();
|
|
71 |
void TestUnit0003L();
|
|
72 |
void TestUnit0004L();
|
|
73 |
void TestUnit0005L();
|
|
74 |
void TestUnit0006L();
|
|
75 |
void TestUnit0007L();
|
|
76 |
void TestUnit0008L();
|
|
77 |
void TestUnit0009L();
|
|
78 |
void TestUnit0010L();
|
|
79 |
void TestUnit0011L();
|
|
80 |
void TestUnit0012L();
|
|
81 |
|
|
82 |
protected:
|
|
83 |
virtual void OpenNonCachingPhoneBookL(DispatcherPhonebook::TPhonebook aPhonebook, RMobilePhoneBookStore& aPhoneBookStore, TInt aError);
|
|
84 |
virtual void OpenCachingPhoneBookL(DispatcherPhonebook::TPhonebook aPhonebook, RMobilePhoneBookStore& aPhoneBookStore, TInt aError);
|
|
85 |
virtual void DoCleanup();
|
|
86 |
|
|
87 |
private:
|
|
88 |
|
|
89 |
void CreateTlvFromEntryL(const CPhoneBookEntry& aPhoneBookEntry, RBuf8& aBuf);
|
|
90 |
void CreateTlvFromPhonebookL(const RPointerArray<CPhoneBookEntry>& aPhonebook, RBuf8& aBuf);
|
|
91 |
|
|
92 |
void FillPhonebookEntryArrayFromTlvL(const TDesC8& aEntry, RPointerArray<CPhoneBookEntry>& aPhoneBook);
|
|
93 |
|
|
94 |
void TestTlvWriteReadL(const CPhoneBookEntry& aPhoneBookEntry);
|
|
95 |
|
|
96 |
void CreateEntriesAndStoreDataL();
|
|
97 |
|
|
98 |
void OpenPhoneBookL(DispatcherPhonebook::TPhonebook aPhonebook, RMobilePhoneBookStore& aPhoneBookStore, RMmCustomAPI& aCustomApi);
|
|
99 |
void OpenPhoneBookWithInitialisationL(DispatcherPhonebook::TPhonebook aPhonebook, RMobilePhoneBookStore& aPhoneBookStore, TInt aError);
|
|
100 |
void CompleteCacheL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aError, TBool aIsRefresh);
|
|
101 |
TBool InitialisationRequired(DispatcherPhonebook::TPhonebook aPhonebook) const;
|
|
102 |
TBool CachingPhonebook(DispatcherPhonebook::TPhonebook aPhonebook) const;
|
|
103 |
|
|
104 |
void ReadL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aError);
|
|
105 |
void ReadL(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhonebookStore, TInt aError);
|
|
106 |
|
|
107 |
void CacheReadL(const RMobilePhoneBookStore& aPhoneBookStore, TInt aIndex, TInt aNumberOfSlots);
|
|
108 |
void NonCacheReadL(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhoneBookStore, TInt aIndex, TInt aNumberOfSlots, TInt aError);
|
|
109 |
void ExpectNonCacheReadL(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhoneBookStore, TInt aIndex, TInt aNumberOfSlots, TRequestStatus& aRequestStatus, TDes8& aReadData);
|
|
110 |
void CompleteNonCacheReadL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aIndex, TInt aNumberOfSlots, TRequestStatus& aRequestStatus, const TDesC8& aReadData, TInt aError);
|
|
111 |
|
|
112 |
void DeleteL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aIndexToDelete, TInt aError);
|
|
113 |
void DeleteAllL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aError);
|
|
114 |
|
|
115 |
void WriteL(DispatcherPhonebook::TPhonebook aPhonebook, const CPhoneBookEntry& aPhoneBookEntry, TInt aError);
|
|
116 |
void WriteL(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhonebookStore, const CPhoneBookEntry& aPhoneBookEntry, TInt aError);
|
|
117 |
|
|
118 |
void CheckPhonebookDetailsL(DispatcherPhonebook::TPhonebook aPhonebook,const RMobilePhoneBookStore& aPhonebookStore, TInt aEntries, TInt aError);
|
|
119 |
|
|
120 |
void GetInfoL(DispatcherPhonebook::TPhonebook aPhonebook, TInt aError);
|
|
121 |
void GetInfoFromCtsy(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhonebookStore, TInt aUsedEntries);
|
|
122 |
void GetInfoFromLtsyL(DispatcherPhonebook::TPhonebook aPhonebook, const RMobilePhoneBookStore& aPhonebookStore, TInt aUsedEntries, TInt aError);
|
|
123 |
|
|
124 |
void SetFdnInfoL(RMobilePhoneBookStore& aPhoneBookStore, TInt aError);
|
|
125 |
|
|
126 |
void RefreshL(DispatcherPhonebook::TPhonebook aPhonebook);
|
|
127 |
|
|
128 |
TName PhonebookName(DispatcherPhonebook::TPhonebook aPhonebook) const;
|
|
129 |
|
|
130 |
static void PhoneBookEntryArrayCleanup(TAny* aArray);
|
|
131 |
|
|
132 |
void OpenSmsStoreL(RMobileSmsMessaging& aSmsMessaging, RMobileSmsStore& aSmsStore, const TDesC& aSmsStoreName);
|
|
133 |
|
|
134 |
private:
|
|
135 |
|
|
136 |
DispatcherPhonebook::TPhonebookStoreInfoV1 iPhonebookStoreData;
|
|
137 |
|
|
138 |
RPointerArray<CPhoneBookEntry> iEntries;
|
|
139 |
|
|
140 |
TBool iInititalised;
|
|
141 |
|
|
142 |
}; // class CCTsyPhonebookFU
|
|
143 |
|
|
144 |
#endif // CCTSYPHONEBOOKENFU_H
|
|
145 |
|