1 // Copyright (c) 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 //user include |
|
18 #include "testltsycallcontrolswapcalls.h" |
|
19 |
|
20 CTestLtsyCallControlSwapCalls::CTestLtsyCallControlSwapCalls(CTestLtsyModel& aModel) |
|
21 : CTestLtsyCallControlBase(aModel) |
|
22 { |
|
23 |
|
24 } |
|
25 |
|
26 |
|
27 CTestLtsyCallControlSwapCalls::~CTestLtsyCallControlSwapCalls() |
|
28 { |
|
29 |
|
30 } |
|
31 |
|
32 TVerdict CTestLtsyCallControlSwapCalls::doTestStepL() |
|
33 { |
|
34 INFO_PRINTF1(_L("starting CTestLtsyCallControlSwapCalls::doTestStepL()")); |
|
35 |
|
36 if(TestStepResult() == EPass) |
|
37 { |
|
38 TRAPD(err,NotifyIncomingCallOneL()); |
|
39 if (err != KErrNone) |
|
40 { |
|
41 SetTestStepResult(EFail); |
|
42 INFO_PRINTF2(_L("The error was %d when notify incoming call"),err); |
|
43 return TestStepResult(); |
|
44 } |
|
45 |
|
46 TRAP(err, AnswerIncomingCallOneL()); |
|
47 if (err != KErrNone) |
|
48 { |
|
49 SetTestStepResult(EFail); |
|
50 INFO_PRINTF2(_L("The error was %d when answer incoming call"),err); |
|
51 return TestStepResult(); |
|
52 } |
|
53 |
|
54 User::After(1000*1000); |
|
55 |
|
56 TRAP(err,NotifyIncomingCallTwoL()); |
|
57 if (err != KErrNone) |
|
58 { |
|
59 SetTestStepResult(EFail); |
|
60 INFO_PRINTF2(_L("The error was %d when notify incoming call"),err); |
|
61 return TestStepResult(); |
|
62 } |
|
63 |
|
64 TRAP(err, AnswerIncomingCallTwoL()); |
|
65 if (err != KErrNone) |
|
66 { |
|
67 SetTestStepResult(EFail); |
|
68 INFO_PRINTF2(_L("The error was %d when answer incoming call"),err); |
|
69 return TestStepResult(); |
|
70 } |
|
71 |
|
72 SwapCallOne(); |
|
73 |
|
74 NotifyCallTwo(); |
|
75 |
|
76 SwapCallTwo(); |
|
77 |
|
78 NotifyCallOne(); |
|
79 |
|
80 TRAP(err, HangupCallOneL()); |
|
81 if (err != KErrNone) |
|
82 { |
|
83 SetTestStepResult(EFail); |
|
84 INFO_PRINTF2(_L("The error was %d when hang up call one"),err); |
|
85 return TestStepResult(); |
|
86 } |
|
87 |
|
88 |
|
89 TRAP(err, HangupCallTwoL()); |
|
90 if (err != KErrNone) |
|
91 { |
|
92 SetTestStepResult(EFail); |
|
93 INFO_PRINTF2(_L("The error was %d when hang up call two"),err); |
|
94 return TestStepResult(); |
|
95 } |
|
96 |
|
97 //Close call |
|
98 CloseCallOne(); |
|
99 |
|
100 //Close call |
|
101 CloseCallTwo(); |
|
102 } |
|
103 |
|
104 return TestStepResult(); |
|
105 } |
|
106 |
|
107 //End of file |
|
108 |
|
109 |
|