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