telephonyserverplugins/common_tsy/test/component/src/cctsytrafficchannelfu.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-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 // The TEFUnit test suite for TrafficChannel in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsytrafficchannelfu.h"
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <et_clsvr.h>
       
    26 #include <ctsy/mmtsy_names.h>
       
    27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    28 #include "tmockltsydata.h"
       
    29 #include <ctsy/serviceapi/gsmerror.h>
       
    30 
       
    31 CTestSuite* CCTsyTrafficChannelFU::CreateSuiteL(const TDesC& aName)
       
    32 	{
       
    33 	SUB_SUITE;
       
    34 
       
    35 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestSetTrafficChannel0001L);
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestSetTrafficChannel0006L);
       
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestSetTrafficChannel00011L);
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestNotifyTrafficChannelConfirmation0001L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestNotifyTrafficChannelConfirmation0006L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyTrafficChannelFU, TestNotifyTrafficChannelConfirmation00011L);
       
    41 
       
    42 	END_SUITE;
       
    43 	}
       
    44 
       
    45 
       
    46 /**
       
    47 Tests that RMobileCall::SetTrafficChannel is not supported for a call
       
    48 @param aLineName The name of the line from which the call is opened
       
    49 */
       
    50 void CCTsyTrafficChannelFU::TestSetTrafficChannelNotSupportedL(const TDesC& aLineName)
       
    51 	{
       
    52 
       
    53 	RLine line;
       
    54 	OpenLineLC(line, aLineName);
       
    55 
       
    56 	RMobileCall mobileCall;
       
    57 	OpenNewCallLC(line, mobileCall);
       
    58 
       
    59 	RMobileCall::TMobileCallTch tchRequest(RMobileCall::ETchUnknown);
       
    60 	TInt err = mobileCall.SetTrafficChannel(tchRequest);
       
    61 	ASSERT_EQUALS(KErrNotSupported, err)
       
    62 
       
    63 	AssertMockLtsyStatusL();
       
    64 	CleanupStack::PopAndDestroy(2); // mobileCall, line
       
    65 
       
    66 	}
       
    67 
       
    68 
       
    69 /**
       
    70 Tests that RMobileCall::NotifyTrafficChannelConfirmation is not supported for a call
       
    71 @param aLineName The name of the line from which the call is opened
       
    72 */
       
    73 void CCTsyTrafficChannelFU::TestNotifyTrafficChannelConfirmationNotSupportedL(const TDesC& aLineName)
       
    74 	{
       
    75 
       
    76 	RLine line;
       
    77 	OpenLineLC(line, aLineName);
       
    78 
       
    79 	RMobileCall mobileCall;
       
    80 	OpenNewCallLC(line, mobileCall);
       
    81 
       
    82 	RMobileCall::TMobileCallTch tchType(RMobileCall::ETchUnknown);
       
    83 	TRequestStatus reqStatus;
       
    84 	mobileCall.NotifyTrafficChannelConfirmation(reqStatus, tchType);
       
    85 	User::WaitForRequest(reqStatus);
       
    86 	ASSERT_EQUALS(KErrNotSupported, reqStatus.Int())
       
    87 
       
    88 	AssertMockLtsyStatusL();
       
    89 	CleanupStack::PopAndDestroy(2); // mobileCall, line
       
    90 
       
    91 	}
       
    92 
       
    93 
       
    94 //
       
    95 // Actual test cases
       
    96 //
       
    97 
       
    98 
       
    99 /**
       
   100 @SYMTestCaseID BA-CTSY-TRCH-CSTC-0001
       
   101 @SYMComponent  telephony_ctsy
       
   102 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SetTrafficChannel for voice calls
       
   103 @SYMTestPriority High
       
   104 @SYMTestActions Invokes RMobileCall::SetTrafficChannel for voice calls
       
   105 @SYMTestExpectedResults Pass
       
   106 @SYMTestType CT
       
   107 */
       
   108 void CCTsyTrafficChannelFU::TestSetTrafficChannel0001L()
       
   109 	{
       
   110 
       
   111 	OpenEtelServerL(EUseExtendedError);
       
   112 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   113 	OpenPhoneL();
       
   114 
       
   115 	TestSetTrafficChannelNotSupportedL(KMmTsyVoice1LineName);
       
   116 
       
   117 	TestSetTrafficChannelNotSupportedL(KMmTsyVoice2LineName);
       
   118 
       
   119 	CleanupStack::PopAndDestroy(this);
       
   120 
       
   121 	}
       
   122 
       
   123 
       
   124 /**
       
   125 @SYMTestCaseID BA-CTSY-TRCH-CSTC-0002
       
   126 @SYMComponent  telephony_ctsy
       
   127 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SetTrafficChannel for data calls
       
   128 @SYMTestPriority High
       
   129 @SYMTestActions Invokes RMobileCall::SetTrafficChannel for data calls
       
   130 @SYMTestExpectedResults Pass
       
   131 @SYMTestType CT
       
   132 */
       
   133 void CCTsyTrafficChannelFU::TestSetTrafficChannel0006L()
       
   134 	{
       
   135 
       
   136 	OpenEtelServerL(EUseExtendedError);
       
   137 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   138 	OpenPhoneL();
       
   139 
       
   140 	TestSetTrafficChannelNotSupportedL(KMmTsyDataLineName);
       
   141 
       
   142 	CleanupStack::PopAndDestroy(this);
       
   143 	
       
   144 	}
       
   145 
       
   146 
       
   147 /**
       
   148 @SYMTestCaseID BA-CTSY-TRCH-CSTC-0003
       
   149 @SYMComponent  telephony_ctsy
       
   150 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SetTrafficChannel for fax calls
       
   151 @SYMTestPriority High
       
   152 @SYMTestActions Invokes RMobileCall::SetTrafficChannel for fax calls
       
   153 @SYMTestExpectedResults Pass
       
   154 @SYMTestType CT
       
   155 */
       
   156 void CCTsyTrafficChannelFU::TestSetTrafficChannel00011L()
       
   157 	{
       
   158 
       
   159 	OpenEtelServerL(EUseExtendedError);
       
   160 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   161 	OpenPhoneL();
       
   162 
       
   163 	TestSetTrafficChannelNotSupportedL(KMmTsyFaxLineName);
       
   164 
       
   165 	CleanupStack::PopAndDestroy(this);
       
   166 	
       
   167 	}
       
   168 
       
   169 
       
   170 /**
       
   171 @SYMTestCaseID BA-CTSY-TRCH-CNTCC-0001
       
   172 @SYMComponent  telephony_ctsy
       
   173 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyTrafficChannelConfirmation for voice calls
       
   174 @SYMTestPriority High
       
   175 @SYMTestActions Invokes RMobileCall::NotifyTrafficChannelConfirmation for voice calls
       
   176 @SYMTestExpectedResults Pass
       
   177 @SYMTestType CT
       
   178 */
       
   179 void CCTsyTrafficChannelFU::TestNotifyTrafficChannelConfirmation0001L()
       
   180 	{
       
   181 
       
   182 	OpenEtelServerL(EUseExtendedError);
       
   183 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   184 	OpenPhoneL();
       
   185 
       
   186 	TestNotifyTrafficChannelConfirmationNotSupportedL(KMmTsyVoice1LineName);
       
   187 
       
   188 	TestNotifyTrafficChannelConfirmationNotSupportedL(KMmTsyVoice2LineName);
       
   189 
       
   190 	CleanupStack::PopAndDestroy(this);
       
   191 
       
   192 	}
       
   193 
       
   194 
       
   195 /**
       
   196 @SYMTestCaseID BA-CTSY-TRCH-CNTCC-0002
       
   197 @SYMComponent  telephony_ctsy
       
   198 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyTrafficChannelConfirmation for data calls
       
   199 @SYMTestPriority High
       
   200 @SYMTestActions Invokes RMobileCall::NotifyTrafficChannelConfirmation for data calls
       
   201 @SYMTestExpectedResults Pass
       
   202 @SYMTestType CT
       
   203 */
       
   204 void CCTsyTrafficChannelFU::TestNotifyTrafficChannelConfirmation0006L()
       
   205 	{
       
   206 
       
   207 	OpenEtelServerL(EUseExtendedError);
       
   208 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   209 	OpenPhoneL();
       
   210 
       
   211 	TestNotifyTrafficChannelConfirmationNotSupportedL(KMmTsyDataLineName);
       
   212 
       
   213 	CleanupStack::PopAndDestroy(this);
       
   214 	
       
   215 	}
       
   216 
       
   217 
       
   218 /**
       
   219 @SYMTestCaseID BA-CTSY-TRCH-CNTCC-0003
       
   220 @SYMComponent  telephony_ctsy
       
   221 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyTrafficChannelConfirmation for fax calls
       
   222 @SYMTestPriority High
       
   223 @SYMTestActions Invokes RMobileCall::NotifyTrafficChannelConfirmation for fax calls
       
   224 @SYMTestExpectedResults Pass
       
   225 @SYMTestType CT
       
   226 */
       
   227 void CCTsyTrafficChannelFU::TestNotifyTrafficChannelConfirmation00011L()
       
   228 	{
       
   229 
       
   230 	OpenEtelServerL(EUseExtendedError);
       
   231 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   232 	OpenPhoneL();
       
   233 
       
   234 	TestNotifyTrafficChannelConfirmationNotSupportedL(KMmTsyFaxLineName);
       
   235 
       
   236 	CleanupStack::PopAndDestroy(this);
       
   237 	
       
   238 	}
       
   239 
       
   240 
       
   241