|
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 |
|
22 #include "T_DataMappingPersistenceC.h" |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 * Constructor |
|
28 */ |
|
29 CT_DataMappingPersistenceCTestStep::CT_DataMappingPersistenceCTestStep() |
|
30 { |
|
31 // Call base class method to set up the human readable name for logging |
|
32 SetTestStepName(KT_DataMappingPersistenceCStep); |
|
33 } |
|
34 |
|
35 /** |
|
36 * Destructor |
|
37 */ |
|
38 CT_DataMappingPersistenceCTestStep::~CT_DataMappingPersistenceCTestStep() |
|
39 { |
|
40 iSession.Close(); |
|
41 } |
|
42 |
|
43 /** |
|
44 * @return - TVerdict code |
|
45 * Override of base class virtual |
|
46 */ |
|
47 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPreambleL() |
|
48 { |
|
49 SetTestStepResult(EPass); |
|
50 TInt error = iSession.Connect(); |
|
51 TEST(error==KErrNone); |
|
52 return TestStepResult(); |
|
53 } |
|
54 |
|
55 /** |
|
56 * @return - TVerdict code |
|
57 * Override of base class virtual |
|
58 */ |
|
59 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepPostambleL() |
|
60 { |
|
61 return TestStepResult(); |
|
62 } |
|
63 |
|
64 TVerdict CT_DataMappingPersistenceCTestStep::doTestStepL() |
|
65 { |
|
66 INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceC Test Cases Running...")); |
|
67 |
|
68 TRAPD(ret,RunTestCasesL()); |
|
69 TEST(ret==KErrNone); |
|
70 |
|
71 INFO_PRINTF1(_L("...T_DataMappingPersistenceC Test Cases Completed.")); |
|
72 |
|
73 return TestStepResult(); |
|
74 } |
|
75 |
|
76 TInt CT_DataMappingPersistenceCTestStep::RunTestCasesL() |
|
77 { |
|
78 HEAP_TEST_LS_SESSION(iSession, 0, 0, TestCheckDeleteDataMappingL(), NO_CLEANUP); |
|
79 |
|
80 return KErrNone; |
|
81 } |
|
82 |
|
83 void CT_DataMappingPersistenceCTestStep::TestCheckDeleteDataMappingL() |
|
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 } |