|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Thumbnail Manager API tests |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <Stiftestinterface.h> |
|
20 #include <SettingServerClient.h> |
|
21 |
|
22 #include <PathInfo.h> |
|
23 |
|
24 #include "ThumbnailManagerTest.h" |
|
25 |
|
26 // ============================= LOCAL FUNCTIONS =============================== |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CThumbnailManagerTest::CThumbnailManagerTest |
|
32 // C++ default constructor can NOT contain any code, that |
|
33 // might leave. |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CThumbnailManagerTest::CThumbnailManagerTest( CTestModuleIf& aTestModuleIf ): |
|
37 CScriptBase( aTestModuleIf ) |
|
38 { |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CThumbnailManagerTest::ConstructL |
|
43 // Symbian 2nd phase constructor can leave. |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 void CThumbnailManagerTest::ConstructL() |
|
47 { |
|
48 iLog = CStifLogger::NewL( KThumbnailManagerTestLogPath, |
|
49 KThumbnailManagerTestLogFile, |
|
50 CStifLogger::ETxt, |
|
51 CStifLogger::EFile, |
|
52 EFalse ); |
|
53 |
|
54 User::LeaveIfError( iFs.Connect()); |
|
55 User::LeaveIfError( iFs.ShareProtected()); |
|
56 |
|
57 // set test data path according to env |
|
58 #if ( defined (__WINS__) || defined (__WINSCW__) ) |
|
59 iDataPath.Copy( PathInfo::PhoneMemoryRootPath().Left( KPathPrefixLength )); |
|
60 #else |
|
61 iDataPath.Copy( PathInfo::MemoryCardRootPath ().Left( KPathPrefixLength )); |
|
62 #endif |
|
63 iDataPath.Append( KTMTestDataPath ); |
|
64 iDataPath.ZeroTerminate(); |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CThumbnailManagerTest::NewL |
|
69 // Two-phased constructor. |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 CThumbnailManagerTest* CThumbnailManagerTest::NewL( CTestModuleIf& aTestModuleIf ) |
|
73 { |
|
74 CThumbnailManagerTest* self = new (ELeave) CThumbnailManagerTest( aTestModuleIf ); |
|
75 |
|
76 CleanupStack::PushL( self ); |
|
77 self->ConstructL(); |
|
78 CleanupStack::Pop(); |
|
79 |
|
80 return self; |
|
81 } |
|
82 |
|
83 // Destructor |
|
84 CThumbnailManagerTest::~CThumbnailManagerTest() |
|
85 { |
|
86 // Delete resources allocated from test methods |
|
87 Delete(); |
|
88 |
|
89 // Delete logger |
|
90 delete iLog; |
|
91 |
|
92 iFs.Close(); |
|
93 } |
|
94 |
|
95 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // LibEntryL is a polymorphic Dll entry point. |
|
99 // Returns: CScriptBase: New CScriptBase derived object |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C CScriptBase* LibEntryL( CTestModuleIf& aTestModuleIf ) // Backpointer to STIF |
|
103 { |
|
104 return ( CScriptBase* ) CThumbnailManagerTest::NewL( aTestModuleIf ); |
|
105 } |
|
106 |
|
107 |
|
108 // End of File |