|
1 // Copyright (c) 2005-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 // Contains declaration of CTestBookmarksBaseStep class |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __TEST_BOOKMARKS_BASE_STEP_H__ |
|
19 #define __TEST_BOOKMARKS_BASE_STEP_H__ |
|
20 |
|
21 // System Include |
|
22 #include <bookmarkdatabase.h> |
|
23 |
|
24 // User Include |
|
25 #include "TestBookmarksServer.h" |
|
26 |
|
27 /** |
|
28 The base test step from which all other test steps are derived |
|
29 @internalTechnology |
|
30 @test |
|
31 */ |
|
32 class CTestBookmarksBaseStep : public CTestStep |
|
33 { |
|
34 public: |
|
35 // Construction |
|
36 CTestBookmarksBaseStep(CTestBookmarksServer& aTestServer); |
|
37 |
|
38 //Destruction |
|
39 ~CTestBookmarksBaseStep(); |
|
40 |
|
41 // TEF virtuals |
|
42 virtual enum TVerdict doTestStepPreambleL(); |
|
43 |
|
44 // TEF pure virtual |
|
45 virtual enum TVerdict doTestStepL(); |
|
46 |
|
47 protected: |
|
48 // Utility functions used by the test steps |
|
49 void CommitDb(); |
|
50 TInt GetArrayIndex(const TPtrC& aTitle); |
|
51 TInt GetParentFolder(const TPtrC& aParent, RBkFolder& aParentFolder); |
|
52 TInt GetBkNode(const TPtrC& aTitle, const TPtrC& aTypeOfItem, RBkNode& aBkNode); |
|
53 Bookmark::TItemId GetItemFromTreeL(const TDesC& aName, RBkFolder aFolder); |
|
54 TVerdict CompareTUints(const TUint32& aTUint32Val1, const TUint32& aTUint32Val2); |
|
55 TVerdict CompareBools(const TBool& aBoolVal1, const TBool& aBoolVal2); |
|
56 TVerdict CompareStrings(const TPtrC& aStrVal1, const TPtrC& aStrVal2); |
|
57 TVerdict CompareTInts(const TInt& aTIntVal1, const TInt& aTIntVal2); |
|
58 TVerdict CompareTReals(const TReal& aTRealVal1, const TReal& aTRealVal2); |
|
59 TVerdict CompareTTimes(const TTime& aTTimeVal1, const TTime& aTTimeVal2); |
|
60 void CheckErrorAndCommit(const TInt& aError); |
|
61 void CheckErrorAndVerdict(const TInt& aError, const TVerdict& aVerdict); |
|
62 |
|
63 private: |
|
64 Bookmark::TVisibility GetDbOpenMode(const TPtrC& aMode); |
|
65 |
|
66 protected: |
|
67 |
|
68 /** Database handle */ |
|
69 RBkDatabase iBkDb; |
|
70 |
|
71 /** Test server reference for sharing data between test steps */ |
|
72 CTestBookmarksServer& iTestServer; |
|
73 }; |
|
74 |
|
75 /*@{*/ |
|
76 // Literal constant defined for identifying step name |
|
77 _LIT(KTestBookmarksBaseStep, "TestBookmarksBaseStep"); |
|
78 /*@}*/ |
|
79 |
|
80 #endif // __TEST_BOOKMARKS_BASE_STEP_H__ |