|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "dunutilstest.h" // Cdunutilstest |
|
19 |
|
20 // Member Functions |
|
21 |
|
22 |
|
23 Cdunutilstest* Cdunutilstest::NewL(CTestModuleIf& aTestModuleIf) |
|
24 { |
|
25 Cdunutilstest* self = new (ELeave) Cdunutilstest( aTestModuleIf ); |
|
26 |
|
27 CleanupStack::PushL( self ); |
|
28 self->ConstructL(); |
|
29 CleanupStack::Pop(); |
|
30 |
|
31 return self; |
|
32 |
|
33 } |
|
34 |
|
35 Cdunutilstest::Cdunutilstest(CTestModuleIf& aTestModuleIf ): |
|
36 CScriptBase( aTestModuleIf ) |
|
37 { |
|
38 } |
|
39 |
|
40 void Cdunutilstest::ConstructL() |
|
41 { |
|
42 // second phase constructor, anything that may leave must be constructed here |
|
43 mDunandler = CDunNoteHandler::NewL(); |
|
44 |
|
45 } |
|
46 |
|
47 Cdunutilstest::~Cdunutilstest() |
|
48 { |
|
49 delete mDunandler; |
|
50 } |
|
51 |
|
52 TInt Cdunutilstest::RunMethodL( CStifItemParser& aItem ) |
|
53 { |
|
54 |
|
55 static TStifFunctionInfo const KFunctions[] = |
|
56 { |
|
57 // Copy this line for every implemented function. |
|
58 // First string is the function name used in TestScripter script file. |
|
59 // Second is the actual implementation member function. |
|
60 ENTRY( "LaunchDialog", Cdunutilstest::LaunchDialogL ) |
|
61 }; |
|
62 |
|
63 const TInt count = sizeof( KFunctions ) / |
|
64 sizeof( TStifFunctionInfo ); |
|
65 |
|
66 return RunInternalL( KFunctions, count, aItem ); |
|
67 |
|
68 } |
|
69 |
|
70 TInt Cdunutilstest::LaunchDialogL( CStifItemParser& /*aItem*/ ) |
|
71 { |
|
72 |
|
73 TTimeIntervalMicroSeconds32 time(7000000); //7 Seconds |
|
74 |
|
75 mDunandler->IssueRequest(); |
|
76 User::After(time); |
|
77 return KErrNone; |
|
78 } |
|
79 |
|
80 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // LibEntryL is a polymorphic Dll entry point. |
|
84 // Returns: CScriptBase: New CScriptBase derived object |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C CScriptBase* LibEntryL( |
|
88 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
89 { |
|
90 |
|
91 return ( CScriptBase* ) Cdunutilstest::NewL( aTestModuleIf ); |
|
92 |
|
93 } |
|
94 |
|
95 |