|
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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #include "T_DataMappingPersistenceB.h" |
|
22 |
|
23 /** |
|
24 * Constructor |
|
25 */ |
|
26 CT_DataMappingPersistenceBTestStep::CT_DataMappingPersistenceBTestStep() |
|
27 { |
|
28 // Call base class method to set up the human readable name for logging |
|
29 SetTestStepName(KT_DataMappingPersistenceBStep); |
|
30 } |
|
31 |
|
32 /** |
|
33 * Destructor |
|
34 */ |
|
35 CT_DataMappingPersistenceBTestStep::~CT_DataMappingPersistenceBTestStep() |
|
36 { |
|
37 iSession.Close(); |
|
38 } |
|
39 |
|
40 /** |
|
41 * @return - TVerdict code |
|
42 * Override of base class virtual |
|
43 */ |
|
44 TVerdict CT_DataMappingPersistenceBTestStep::doTestStepPreambleL() |
|
45 { |
|
46 SetTestStepResult(EPass); |
|
47 TInt error = iSession.Connect(); |
|
48 TEST(error==KErrNone); |
|
49 return TestStepResult(); |
|
50 } |
|
51 |
|
52 /** |
|
53 * @return - TVerdict code |
|
54 * Override of base class virtual |
|
55 */ |
|
56 TVerdict CT_DataMappingPersistenceBTestStep::doTestStepPostambleL() |
|
57 { |
|
58 return TestStepResult(); |
|
59 } |
|
60 |
|
61 TVerdict CT_DataMappingPersistenceBTestStep::doTestStepL() |
|
62 { |
|
63 INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceB Test Cases Running...")); |
|
64 |
|
65 |
|
66 TRAPD(ret,RunTestCasesL()) |
|
67 TEST(ret==KErrNone); |
|
68 |
|
69 INFO_PRINTF1(_L("...T_DataMappingPersistenceB Test Cases Completed.")); |
|
70 |
|
71 return TestStepResult(); |
|
72 } |
|
73 |
|
74 TInt CT_DataMappingPersistenceBTestStep::RunTestCasesL() |
|
75 { |
|
76 HEAP_TEST_LS_SESSION(iSession, 0, 0, TestDeleteDataMappingL() , NO_CLEANUP); |
|
77 |
|
78 return KErrNone; |
|
79 } |
|
80 |
|
81 void CT_DataMappingPersistenceBTestStep::TestDeleteDataMappingL() |
|
82 { |
|
83 TUid appUid = {0x10004c58}; |
|
84 _LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence"); |
|
85 TDataType dataType (KLitMimeTypeData); |
|
86 TUid retAppUid; |
|
87 TInt error = iSession.AppForDataType(dataType,retAppUid); |
|
88 TEST(error==KErrNone); |
|
89 TEST(appUid == retAppUid); |
|
90 error = iSession.DeleteDataMapping(dataType); |
|
91 TEST(error==KErrNone); |
|
92 |
|
93 } |