telephonyserver/etelmultimode/TETEL/te_EtelMM/te_mmdialcallcontrol.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 // This file contains class definitions of TestExecute test steps
       
    15 // which test that the RMobileCall::DialCallControl API can only
       
    16 // be called if the application has the correct SID and capabilities
       
    17 // to call it.
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file
       
    23 */
       
    24 
       
    25 #include "testdef.h"
       
    26 #include "te_mmdialcallcontrol.h"
       
    27 
       
    28 
       
    29 CTestDialCallControlCorrectSIDCorrectCap::CTestDialCallControlCorrectSIDCorrectCap()
       
    30 /** 
       
    31 Each test step initialises it's own name.
       
    32 */
       
    33 	{
       
    34 	SetTestStepName(_L("TestDialCallControlCorrectSIDCorrectCap"));
       
    35 	}
       
    36 
       
    37 enum TVerdict CTestDialCallControlCorrectSIDCorrectCap::doTestStepL()
       
    38 /**
       
    39 @SYMTestCaseID TEL-ETEL-NA-2038
       
    40 @SYMComponent  telephony_etel
       
    41 @SYMTestCaseDesc To check client has the required SID and Capability to successfully call the RMobileCall::DialCallControl API.
       
    42 @SYMTestPriority High
       
    43 @SYMTestActions  Call the RMobileCall::DialCallControl API with required SID and required Capability and check the return value of the API
       
    44 @SYMTestExpectedResults KErrNone when SID and capabilities are both correct.
       
    45 @SYMTestType CT
       
    46 */
       
    47 	{
       
    48 	TInt iTestCount = 1;
       
    49 	
       
    50 	RMobilePhone mmPhone;
       
    51 	TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
       
    52 	TEST(ret==KErrNone);
       
    53 
       
    54 	RMobileLine mmLine;
       
    55 	ret=mmLine.Open(mmPhone,DMMTSY_LINE_VOICE_NAME);
       
    56     TEST(ret==KErrNone);
       
    57 
       
    58 	RMobileCall mmCall;
       
    59 	TName callName;
       
    60 	ret=mmCall.OpenNewCall(mmLine,callName);
       
    61     TEST(ret==KErrNone);
       
    62 	
       
    63 	RMobileCall::TMobileCallParamsV7 mmCallParamsV7;
       
    64 	TEST(mmCallParamsV7.ExtensionId() == RMobileCall::KETelMobileCallParamsV7);
       
    65 
       
    66 	mmCallParamsV7.iInterval = DMMTSY_CALL_INTERVAL;
       
    67 	mmCallParamsV7.iIdRestrict = DMMTSY_CALL_CLI_RESTRICT_SETTING1;
       
    68 	mmCallParamsV7.iCug.iExplicitInvoke = DMMTSY_CALL_CUG_INVOKE;
       
    69 	mmCallParamsV7.iCug.iCugIndex = DMMTSY_CALL_CUG_INDEX;
       
    70 	mmCallParamsV7.iCug.iSuppressOA = DMMTSY_CALL_CUG_OA;
       
    71 	mmCallParamsV7.iCug.iSuppressPrefCug = DMMTSY_CALL_CUG_PREF;
       
    72 	mmCallParamsV7.iAutoRedial = DMMTSY_CALL_AUTO_REDIAL_FLAG;
       
    73 	mmCallParamsV7.iBearerMode = DMMTSY_CALL_NEW_BEARER;
       
    74 	mmCallParamsV7.iCallParamOrigin = DMMTSY_CALL_PARAM_ORIGIN;
       
    75 	mmCallParamsV7.iSubAddress = DMMTSY_CALL_SUBADDRESS;
       
    76 	mmCallParamsV7.iBearerCap1 = DMMTSY_CALL_BEARER_CAP1;
       
    77 	mmCallParamsV7.iBearerCap2 = DMMTSY_CALL_BEARER_CAP2;
       
    78 	mmCallParamsV7.iBCRepeatIndicator = DMMTSY_CALL_BC_REPEAT_INDICATOR;
       
    79 	mmCallParamsV7.iIconId.iQualifier = DMMTSY_CALL_ICON_ID_QUALIFIER;
       
    80 	mmCallParamsV7.iIconId.iIdentifier = DMMTSY_CALL_ICON_ID_IDENTIFIER;
       
    81 	mmCallParamsV7.iAlphaId = DMMTSY_CALL_ALPHA_ID;
       
    82 	
       
    83 	RMobileCall::TMobileCallParamsV7Pckg mmCallParamsV7Pckg(mmCallParamsV7);
       
    84 	
       
    85 	TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber(DMMTSY_PHONE_TEL_NUMBER);
       
    86 	
       
    87 	TRequestStatus reqStatus;
       
    88 	mmCall.DialCallControl(reqStatus, mmCallParamsV7Pckg, telNumber);
       
    89 	User::WaitForRequest(reqStatus);
       
    90 
       
    91 	TEST(reqStatus.Int()==KErrNone);
       
    92 	INFO_PRINTF2(_L("Test %d - RMobileCall::DialCallControl correct SID correct caps passed"), iTestCount++);
       
    93 	
       
    94 	mmCall.Close();
       
    95 	mmLine.Close();
       
    96 	mmPhone.Close();
       
    97 
       
    98 	return TestStepResult();
       
    99 	}
       
   100 
       
   101 CTestDialCallControlIncorrectSIDCorrectCap::CTestDialCallControlIncorrectSIDCorrectCap()
       
   102 /** 
       
   103 Each test step initialises it's own name.
       
   104 */
       
   105 	{
       
   106 	SetTestStepName(_L("TestDialCallControlIncorrectSIDCorrectCap"));
       
   107 	}
       
   108 
       
   109 enum TVerdict CTestDialCallControlIncorrectSIDCorrectCap::doTestStepL()
       
   110 /**
       
   111 @SYMTestCaseID TEL-ETEL-NA-2039
       
   112 @SYMComponent  telephony_etel
       
   113 @SYMTestCaseDesc To check client has the required SID and Capability to successfully call the RMobileCall::DialCallControl API
       
   114 @SYMTestPriority High
       
   115 @SYMTestActions Call the RMobileCall::DialCallControl with incorrect SID but required Capability and check the return value of the API
       
   116 @SYMTestExpectedResults KErrPermissionDenied returned when SID is incorrect.
       
   117 @SYMTestType CT
       
   118 */
       
   119 	{
       
   120 	TInt iTestCount = 1;
       
   121 	
       
   122 	RMobilePhone mmPhone;
       
   123 	TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
       
   124 	TEST(ret==KErrNone);
       
   125 
       
   126 	RMobileLine mmLine;
       
   127 	ret=mmLine.Open(mmPhone,DMMTSY_LINE_VOICE_NAME);
       
   128     TEST(ret==KErrNone);
       
   129 
       
   130 	RMobileCall mmCall;
       
   131 	TName callName;
       
   132 	ret=mmCall.OpenNewCall(mmLine,callName);
       
   133     TEST(ret==KErrNone);
       
   134 	
       
   135 	RMobileCall::TMobileCallParamsV7 mmCallParamsV7;
       
   136 	TEST(mmCallParamsV7.ExtensionId() == RMobileCall::KETelMobileCallParamsV7);
       
   137 
       
   138 	mmCallParamsV7.iInterval = DMMTSY_CALL_INTERVAL;
       
   139 	mmCallParamsV7.iIdRestrict = DMMTSY_CALL_CLI_RESTRICT_SETTING1;
       
   140 	mmCallParamsV7.iCug.iExplicitInvoke = DMMTSY_CALL_CUG_INVOKE;
       
   141 	mmCallParamsV7.iCug.iCugIndex = DMMTSY_CALL_CUG_INDEX;
       
   142 	mmCallParamsV7.iCug.iSuppressOA = DMMTSY_CALL_CUG_OA;
       
   143 	mmCallParamsV7.iCug.iSuppressPrefCug = DMMTSY_CALL_CUG_PREF;
       
   144 	mmCallParamsV7.iAutoRedial = DMMTSY_CALL_AUTO_REDIAL_FLAG;
       
   145 	mmCallParamsV7.iBearerMode = DMMTSY_CALL_NEW_BEARER;
       
   146 	mmCallParamsV7.iCallParamOrigin = DMMTSY_CALL_PARAM_ORIGIN;
       
   147 	mmCallParamsV7.iSubAddress = DMMTSY_CALL_SUBADDRESS;
       
   148 	mmCallParamsV7.iBearerCap1 = DMMTSY_CALL_BEARER_CAP1;
       
   149 	mmCallParamsV7.iBearerCap2 = DMMTSY_CALL_BEARER_CAP2;
       
   150 	mmCallParamsV7.iBCRepeatIndicator = DMMTSY_CALL_BC_REPEAT_INDICATOR;
       
   151 	mmCallParamsV7.iIconId.iQualifier = DMMTSY_CALL_ICON_ID_QUALIFIER;
       
   152 	mmCallParamsV7.iIconId.iIdentifier = DMMTSY_CALL_ICON_ID_IDENTIFIER;
       
   153 	mmCallParamsV7.iAlphaId = DMMTSY_CALL_ALPHA_ID;
       
   154 	
       
   155 	RMobileCall::TMobileCallParamsV7Pckg mmCallParamsV7Pckg(mmCallParamsV7);
       
   156 	
       
   157 	TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber(DMMTSY_PHONE_TEL_NUMBER);
       
   158 	
       
   159 	TRequestStatus reqStatus;
       
   160 	mmCall.DialCallControl(reqStatus, mmCallParamsV7Pckg, telNumber);
       
   161 	User::WaitForRequest(reqStatus);
       
   162 
       
   163 	TEST(reqStatus.Int()==KErrPermissionDenied);
       
   164 	INFO_PRINTF2(_L("Test %d - RMobileCall::DialCallControl incorrect SID correct caps passed"), iTestCount++);
       
   165 	
       
   166 	mmCall.Close();
       
   167 	mmLine.Close();
       
   168 	mmPhone.Close();
       
   169 	return TestStepResult();
       
   170 	}
       
   171 
       
   172 CTestDialCallControlCorrectSIDIncorrectCap::CTestDialCallControlCorrectSIDIncorrectCap()
       
   173 /** 
       
   174 Each test step initialises it's own name.
       
   175 */
       
   176 	{
       
   177 	SetTestStepName(_L("TestDialCallControlCorrectSIDIncorrectCap"));
       
   178 	}
       
   179 
       
   180 enum TVerdict CTestDialCallControlCorrectSIDIncorrectCap::doTestStepL()
       
   181 /**
       
   182 @SYMTestCaseID TEL-ETEL-NA-2040
       
   183 @SYMComponent  telephony_etel
       
   184 @SYMTestCaseDesc To check client has the required SID and Capability to successfully call the RMobileCall::DialCallControl API
       
   185 @SYMTestPriority High
       
   186 @SYMTestActions  Call the RMobileCall::DialCallControl API with correct SID and incorrect Capability and check the return value of the API
       
   187 @SYMTestExpectedResults KErrPermissionDenied when capability is incorrect.
       
   188 @SYMTestType CT
       
   189 */
       
   190 	{
       
   191 	TInt iTestCount = 1;
       
   192 	
       
   193 	RMobilePhone mmPhone;
       
   194 	TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
       
   195 	TEST(ret==KErrNone);
       
   196 
       
   197 	RMobileLine mmLine;
       
   198 	ret=mmLine.Open(mmPhone,DMMTSY_LINE_VOICE_NAME);
       
   199     TEST(ret==KErrNone);
       
   200 
       
   201 	RMobileCall mmCall;
       
   202 	TName callName;
       
   203 	ret=mmCall.OpenNewCall(mmLine,callName);
       
   204     TEST(ret==KErrNone);
       
   205 	
       
   206 	RMobileCall::TMobileCallParamsV7 mmCallParamsV7;
       
   207 	TEST(mmCallParamsV7.ExtensionId() == RMobileCall::KETelMobileCallParamsV7);
       
   208 
       
   209 	mmCallParamsV7.iInterval = DMMTSY_CALL_INTERVAL;
       
   210 	mmCallParamsV7.iIdRestrict = DMMTSY_CALL_CLI_RESTRICT_SETTING1;
       
   211 	mmCallParamsV7.iCug.iExplicitInvoke = DMMTSY_CALL_CUG_INVOKE;
       
   212 	mmCallParamsV7.iCug.iCugIndex = DMMTSY_CALL_CUG_INDEX;
       
   213 	mmCallParamsV7.iCug.iSuppressOA = DMMTSY_CALL_CUG_OA;
       
   214 	mmCallParamsV7.iCug.iSuppressPrefCug = DMMTSY_CALL_CUG_PREF;
       
   215 	mmCallParamsV7.iAutoRedial = DMMTSY_CALL_AUTO_REDIAL_FLAG;
       
   216 	mmCallParamsV7.iBearerMode = DMMTSY_CALL_NEW_BEARER;
       
   217 	mmCallParamsV7.iCallParamOrigin = DMMTSY_CALL_PARAM_ORIGIN;
       
   218 	mmCallParamsV7.iSubAddress = DMMTSY_CALL_SUBADDRESS;
       
   219 	mmCallParamsV7.iBearerCap1 = DMMTSY_CALL_BEARER_CAP1;
       
   220 	mmCallParamsV7.iBearerCap2 = DMMTSY_CALL_BEARER_CAP2;
       
   221 	mmCallParamsV7.iBCRepeatIndicator = DMMTSY_CALL_BC_REPEAT_INDICATOR;
       
   222 	mmCallParamsV7.iIconId.iQualifier = DMMTSY_CALL_ICON_ID_QUALIFIER;
       
   223 	mmCallParamsV7.iIconId.iIdentifier = DMMTSY_CALL_ICON_ID_IDENTIFIER;
       
   224 	mmCallParamsV7.iAlphaId = DMMTSY_CALL_ALPHA_ID;
       
   225 	
       
   226 	RMobileCall::TMobileCallParamsV7Pckg mmCallParamsV7Pckg(mmCallParamsV7);
       
   227 	
       
   228 	TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber(DMMTSY_PHONE_TEL_NUMBER);
       
   229 	
       
   230 	TRequestStatus reqStatus;
       
   231 	mmCall.DialCallControl(reqStatus, mmCallParamsV7Pckg, telNumber);
       
   232 	User::WaitForRequest(reqStatus);
       
   233 
       
   234 	TEST(reqStatus.Int()==KErrPermissionDenied);
       
   235 	INFO_PRINTF2(_L("Test %d - RMobileCall::DialCallControl correct SID incorrect caps passed"), iTestCount++);
       
   236 	
       
   237 	mmCall.Close();
       
   238 	mmLine.Close();
       
   239 	mmPhone.Close();
       
   240 	return TestStepResult();
       
   241 	}
       
   242 
       
   243 CTestDialCallControlIncorrectSIDIncorrectCap::CTestDialCallControlIncorrectSIDIncorrectCap()
       
   244 /** 
       
   245 Each test step initialises it's own name.
       
   246 */
       
   247 	{
       
   248 	SetTestStepName(_L("TestDialCallControlIncorrectSIDIncorrectCap"));
       
   249 	}
       
   250 
       
   251 enum TVerdict CTestDialCallControlIncorrectSIDIncorrectCap::doTestStepL()
       
   252 /**
       
   253 @SYMTestCaseID TEL-ETEL-NA-2041
       
   254 @SYMComponent  telephony_etel
       
   255 @SYMTestCaseDesc To check client has the required SID and Capability to successfully call the RMobileCall::DialCallControl API
       
   256 @SYMTestPriority High
       
   257 @SYMTestActions  Call the RMobileCall::DialCallControl API with incorrect SID and incorrect Capability and check the return value of the API
       
   258 @SYMTestExpectedResults KErrPermissionDenied returned when both SID and capabilities are both wrong.
       
   259 @SYMTestType CT
       
   260 */
       
   261 	{
       
   262 	TInt iTestCount = 1;
       
   263 	
       
   264 	RMobilePhone mmPhone;
       
   265 	TInt ret=mmPhone.Open(iTelServer,DMMTSY_PHONE_NAME);
       
   266 	TEST(ret==KErrNone);
       
   267 
       
   268 	RMobileLine mmLine;
       
   269 	ret=mmLine.Open(mmPhone,DMMTSY_LINE_VOICE_NAME);
       
   270     TEST(ret==KErrNone);
       
   271 
       
   272 	RMobileCall mmCall;
       
   273 	TName callName;
       
   274 	ret=mmCall.OpenNewCall(mmLine,callName);
       
   275     TEST(ret==KErrNone);
       
   276 	
       
   277 	RMobileCall::TMobileCallParamsV7 mmCallParamsV7;
       
   278 	TEST(mmCallParamsV7.ExtensionId() == RMobileCall::KETelMobileCallParamsV7);
       
   279 
       
   280 	mmCallParamsV7.iInterval = DMMTSY_CALL_INTERVAL;
       
   281 	mmCallParamsV7.iIdRestrict = DMMTSY_CALL_CLI_RESTRICT_SETTING1;
       
   282 	mmCallParamsV7.iCug.iExplicitInvoke = DMMTSY_CALL_CUG_INVOKE;
       
   283 	mmCallParamsV7.iCug.iCugIndex = DMMTSY_CALL_CUG_INDEX;
       
   284 	mmCallParamsV7.iCug.iSuppressOA = DMMTSY_CALL_CUG_OA;
       
   285 	mmCallParamsV7.iCug.iSuppressPrefCug = DMMTSY_CALL_CUG_PREF;
       
   286 	mmCallParamsV7.iAutoRedial = DMMTSY_CALL_AUTO_REDIAL_FLAG;
       
   287 	mmCallParamsV7.iBearerMode = DMMTSY_CALL_NEW_BEARER;
       
   288 	mmCallParamsV7.iCallParamOrigin = DMMTSY_CALL_PARAM_ORIGIN;
       
   289 	mmCallParamsV7.iSubAddress = DMMTSY_CALL_SUBADDRESS;
       
   290 	mmCallParamsV7.iBearerCap1 = DMMTSY_CALL_BEARER_CAP1;
       
   291 	mmCallParamsV7.iBearerCap2 = DMMTSY_CALL_BEARER_CAP2;
       
   292 	mmCallParamsV7.iBCRepeatIndicator = DMMTSY_CALL_BC_REPEAT_INDICATOR;
       
   293 	mmCallParamsV7.iIconId.iQualifier = DMMTSY_CALL_ICON_ID_QUALIFIER;
       
   294 	mmCallParamsV7.iIconId.iIdentifier = DMMTSY_CALL_ICON_ID_IDENTIFIER;
       
   295 	mmCallParamsV7.iAlphaId = DMMTSY_CALL_ALPHA_ID;
       
   296 	
       
   297 	RMobileCall::TMobileCallParamsV7Pckg mmCallParamsV7Pckg(mmCallParamsV7);
       
   298 	
       
   299 	TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber(DMMTSY_PHONE_TEL_NUMBER);
       
   300 	
       
   301 	TRequestStatus reqStatus;
       
   302 	mmCall.DialCallControl(reqStatus, mmCallParamsV7Pckg, telNumber);
       
   303 	User::WaitForRequest(reqStatus);
       
   304 
       
   305 	TEST(reqStatus.Int()==KErrPermissionDenied);
       
   306 	INFO_PRINTF2(_L("Test %d - RMobileCall::DialCallControl incorrect SID incorrect caps passed"), iTestCount++);
       
   307 	
       
   308 	mmCall.Close();
       
   309 	mmLine.Close();
       
   310 	mmPhone.Close();
       
   311 	return TestStepResult();
       
   312 	}
       
   313