|
1 /* |
|
2 * Copyright (c) 2004 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: Implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "CTTcSIPFactory.h" |
|
19 #include "CTcSIPContext.h" |
|
20 #include "MTcTestContext.h" |
|
21 |
|
22 // SIP context identifier |
|
23 _LIT8( KTcSIPNameTag, "SIP:" ); |
|
24 _LIT8( KTcCreateSipStack, "TRUE" ); |
|
25 |
|
26 CTTcSIPFactory* CTTcSIPFactory::NewL() |
|
27 { |
|
28 return new ( ELeave ) CTTcSIPFactory; |
|
29 } |
|
30 |
|
31 CTTcSIPFactory::CTTcSIPFactory() |
|
32 { |
|
33 } |
|
34 |
|
35 CTTcSIPFactory::~CTTcSIPFactory() |
|
36 { |
|
37 } |
|
38 |
|
39 MTcTestContext* CTTcSIPFactory::CreateLC( const TDesC8& aTestCaseName, |
|
40 CTcCTRLCodec& aCodec, |
|
41 TInt aIAPId ) const |
|
42 { |
|
43 // Does the test case name start with our tag? |
|
44 // (complete name might be e.g. "SIP:INV_01") |
|
45 if( aTestCaseName.FindF( KTcSIPNameTag ) == 0 ) |
|
46 { |
|
47 // If CreateSipStack is !true then create SIP stack manually |
|
48 // otherwise create it automatically |
|
49 if ( aTestCaseName.FindF( KTcCreateSipStack ) != -1 ) |
|
50 { |
|
51 return CTcSIPContext::NewLC( aCodec, aIAPId, ETrue ); |
|
52 } |
|
53 return CTcSIPContext::NewLC( aCodec, aIAPId, EFalse ); |
|
54 } |
|
55 // No, the test case wasn't for us. |
|
56 else |
|
57 { |
|
58 return NULL; |
|
59 } |
|
60 } |