telephonyserverplugins/common_tsy/test/component/src/cctsyusertousersignallingfu.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 UserToUserSignalling in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsyusertousersignallingfu.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* CCTsyUserToUserSignallingFU::CreateSuiteL(const TDesC& aName)
       
    32 	{
       
    33 	SUB_SUITE;
       
    34 
       
    35 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestGetUUSCaps0001L);
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestGetUUSCaps0002L);
       
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestGetUUSCaps0003L);
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestReceiveUUI0001L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestReceiveUUI0001bL);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestReceiveUUI0002L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestReceiveUUI0003L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestActivateUUS0001L);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestActivateUUS0002L);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestActivateUUS0003L);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestHangupWithUUI0001L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestHangupWithUUI0002L);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestHangupWithUUI0003L);
       
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestNotifyUUSCapsChange0001L);
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestNotifyUUSCapsChange0002L);
       
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestNotifyUUSCapsChange0003L);
       
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestAnswerIncomingCallWithUUI0001L);
       
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestAnswerIncomingCallWithUUI0002L);
       
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestAnswerIncomingCallWithUUI0003L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestSendUUI0001L);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestSendUUI0002L);
       
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestSendUUI0003L);
       
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestGetUUSSetting0001L);
       
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestSetUUSSetting0001L);
       
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyUserToUserSignallingFU, TestNotifyUUSSettingChange0001L);
       
    60 
       
    61 	END_SUITE;
       
    62 	}
       
    63 
       
    64 
       
    65 //
       
    66 // Actual test cases
       
    67 //
       
    68 
       
    69 
       
    70 /**
       
    71 @SYMTestCaseID BA-CTSY-UUS-CGUC-0001
       
    72 @SYMComponent  telephony_ctsy
       
    73 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GetUUSCaps for voice calls
       
    74 @SYMTestPriority High
       
    75 @SYMTestActions Invokes RMobileCall::GetUUSCaps for voice calls
       
    76 @SYMTestExpectedResults Pass
       
    77 @SYMTestType CT
       
    78 */
       
    79 void CCTsyUserToUserSignallingFU::TestGetUUSCaps0001L()
       
    80 	{
       
    81 
       
    82 	AuxGetUUSCapsL(KMmTsyVoice1LineName);
       
    83 
       
    84 	}
       
    85 
       
    86 
       
    87 /**
       
    88 @SYMTestCaseID BA-CTSY-UUS-CGUC-0002
       
    89 @SYMComponent  telephony_ctsy
       
    90 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GetUUSCaps for data calls
       
    91 @SYMTestPriority High
       
    92 @SYMTestActions Invokes RMobileCall::GetUUSCaps for data calls
       
    93 @SYMTestExpectedResults Pass
       
    94 @SYMTestType CT
       
    95 */
       
    96 void CCTsyUserToUserSignallingFU::TestGetUUSCaps0002L()
       
    97 	{
       
    98 
       
    99 	AuxGetUUSCapsL(KMmTsyDataLineName);
       
   100 
       
   101 	}
       
   102 
       
   103 
       
   104 /**
       
   105 @SYMTestCaseID BA-CTSY-UUS-CGUC-0003
       
   106 @SYMComponent  telephony_ctsy
       
   107 @SYMTestCaseDesc Test support in CTSY for RMobileCall::GetUUSCaps for fax calls
       
   108 @SYMTestPriority High
       
   109 @SYMTestActions Invokes RMobileCall::GetUUSCaps for fax calls
       
   110 @SYMTestExpectedResults Pass
       
   111 @SYMTestType CT
       
   112 */
       
   113 void CCTsyUserToUserSignallingFU::TestGetUUSCaps0003L()
       
   114 	{
       
   115 
       
   116 	AuxGetUUSCapsL(KMmTsyFaxLineName);
       
   117 
       
   118 	}
       
   119 
       
   120 
       
   121 /**
       
   122 @SYMTestCaseID BA-CTSY-UUS-CRU-0001
       
   123 @SYMComponent  telephony_ctsy
       
   124 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ReceiveUUI for voice calls
       
   125 @SYMTestPriority High
       
   126 @SYMTestActions Invokes RMobileCall::ReceiveUUI for voice calls
       
   127 @SYMTestExpectedResults Pass
       
   128 @SYMTestType CT
       
   129 */
       
   130 void CCTsyUserToUserSignallingFU::TestReceiveUUI0001L()
       
   131 	{
       
   132 
       
   133 	AuxReceiveUUIVoiceL();
       
   134 
       
   135 	}
       
   136 
       
   137 
       
   138 /**
       
   139 @SYMTestCaseID BA-CTSY-UUS-CRU-0001b
       
   140 @SYMComponent  telephony_ctsy
       
   141 @SYMTestCaseDesc Test to increase CMmCallTsy::ReceiveUUI coverage covers 
       
   142 @SYMTestCaseDesc "if ( 0 < iReceivedUUI.Length() )" condition
       
   143 @SYMTestPriority High
       
   144 @SYMTestActions Invokes RMobileCall::ReceiveUUI for voice calls
       
   145 @SYMTestExpectedResults Pass
       
   146 @SYMTestType CT
       
   147 */
       
   148 void CCTsyUserToUserSignallingFU::TestReceiveUUI0001bL()
       
   149 	{
       
   150 
       
   151 	AuxReceiveUUIVoiceL(ETrue);
       
   152 	
       
   153 	}
       
   154 
       
   155 
       
   156 /**
       
   157 @SYMTestCaseID BA-CTSY-UUS-CRU-0002
       
   158 @SYMComponent  telephony_ctsy
       
   159 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ReceiveUUI for data calls
       
   160 @SYMTestPriority High
       
   161 @SYMTestActions Invokes RMobileCall::ReceiveUUI for data calls
       
   162 @SYMTestExpectedResults Pass
       
   163 @SYMTestType CT
       
   164 */
       
   165 void CCTsyUserToUserSignallingFU::TestReceiveUUI0002L()
       
   166 	{
       
   167 
       
   168 	AuxReceiveUUIDataAndFaxL(KMmTsyDataLineName);
       
   169 
       
   170 	}
       
   171 
       
   172 
       
   173 /**
       
   174 @SYMTestCaseID BA-CTSY-UUS-CRU-0003
       
   175 @SYMComponent  telephony_ctsy
       
   176 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ReceiveUUI for fax calls
       
   177 @SYMTestPriority High
       
   178 @SYMTestActions Invokes RMobileCall::ReceiveUUI for fax calls
       
   179 @SYMTestExpectedResults Pass
       
   180 @SYMTestType CT
       
   181 */
       
   182 void CCTsyUserToUserSignallingFU::TestReceiveUUI0003L()
       
   183 	{
       
   184 
       
   185 	AuxReceiveUUIDataAndFaxL(KMmTsyFaxLineName);
       
   186 
       
   187 	}
       
   188 
       
   189 
       
   190 /**
       
   191 @SYMTestCaseID BA-CTSY-UUS-CAU-0001
       
   192 @SYMComponent  telephony_ctsy
       
   193 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ActivateUUS for voice calls
       
   194 @SYMTestPriority High
       
   195 @SYMTestActions Invokes RMobileCall::ActivateUUS for voice calls
       
   196 @SYMTestExpectedResults Pass
       
   197 @SYMTestType CT
       
   198 */
       
   199 void CCTsyUserToUserSignallingFU::TestActivateUUS0001L()
       
   200 	{
       
   201 
       
   202 	OpenEtelServerL(EUseExtendedError);
       
   203 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   204 	OpenPhoneL();
       
   205 
       
   206 	RLine line;
       
   207 	OpenNewLineLC(line, KMmTsyVoice1LineName);
       
   208 
       
   209 	TName callName;
       
   210 	RMobileCall call;
       
   211 	OpenNewCallLC(call, line, callName);
       
   212 
       
   213 	TRequestStatus reqStatus;
       
   214 	RMobileCall::TMobileCallUUSRequestV1 uusRequest;
       
   215 	RMobileCall::TMobileCallUUSRequestV1Pckg pckgUUSRequest(uusRequest);
       
   216 
       
   217 	TInt serviceReq(1);
       
   218 	uusRequest.iServiceReq = serviceReq;
       
   219 
       
   220 	call.ActivateUUS(reqStatus, pckgUUSRequest);
       
   221 	User::WaitForRequest(reqStatus);	
       
   222 	ASSERT_EQUALS (KErrNone, reqStatus.Int());	
       
   223 
       
   224 	AssertMockLtsyStatusL();
       
   225 	CleanupStack::PopAndDestroy(3, this); // line, call, this
       
   226 
       
   227 	}
       
   228 
       
   229 
       
   230 /**
       
   231 @SYMTestCaseID BA-CTSY-UUS-CAU-0002
       
   232 @SYMComponent  telephony_ctsy
       
   233 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ActivateUUS for data calls
       
   234 @SYMTestPriority High
       
   235 @SYMTestActions Invokes RMobileCall::ActivateUUS for data calls
       
   236 @SYMTestExpectedResults Pass
       
   237 @SYMTestType CT
       
   238 */
       
   239 void CCTsyUserToUserSignallingFU::TestActivateUUS0002L()
       
   240 	{
       
   241 
       
   242 	AuxActivateUUSDataAndFaxL(KMmTsyDataLineName);
       
   243 
       
   244 	}
       
   245 
       
   246 
       
   247 /**
       
   248 @SYMTestCaseID BA-CTSY-UUS-CAU-0003
       
   249 @SYMComponent  telephony_ctsy
       
   250 @SYMTestCaseDesc Test support in CTSY for RMobileCall::ActivateUUS for fax calls
       
   251 @SYMTestPriority High
       
   252 @SYMTestActions Invokes RMobileCall::ActivateUUS for fax calls
       
   253 @SYMTestExpectedResults Pass
       
   254 @SYMTestType CT
       
   255 */
       
   256 void CCTsyUserToUserSignallingFU::TestActivateUUS0003L()
       
   257 	{
       
   258 
       
   259 	AuxActivateUUSDataAndFaxL(KMmTsyFaxLineName);
       
   260 
       
   261 	}
       
   262 
       
   263 
       
   264 /**
       
   265 @SYMTestCaseID BA-CTSY-UUS-CHWU-0001
       
   266 @SYMComponent  telephony_ctsy
       
   267 @SYMTestCaseDesc Test support in CTSY for RMobileCall::HangupWithUUI for voice calls
       
   268 @SYMTestPriority High
       
   269 @SYMTestActions Invokes RMobileCall::HangupWithUUI for voice calls
       
   270 @SYMTestExpectedResults Pass
       
   271 @SYMTestType CT
       
   272 */
       
   273 void CCTsyUserToUserSignallingFU::TestHangupWithUUI0001L()
       
   274 	{
       
   275 
       
   276 	AuxHangupWithUUIL(KMmTsyVoice1LineName);
       
   277 
       
   278 	}
       
   279 
       
   280 
       
   281 /**
       
   282 @SYMTestCaseID BA-CTSY-UUS-CHWU-0002
       
   283 @SYMComponent  telephony_ctsy
       
   284 @SYMTestCaseDesc Test support in CTSY for RMobileCall::HangupWithUUI for data calls
       
   285 @SYMTestPriority High
       
   286 @SYMTestActions Invokes RMobileCall::HangupWithUUI for data calls
       
   287 @SYMTestExpectedResults Pass
       
   288 @SYMTestType CT
       
   289 */
       
   290 void CCTsyUserToUserSignallingFU::TestHangupWithUUI0002L()
       
   291 	{
       
   292 
       
   293 	AuxHangupWithUUIL(KMmTsyDataLineName);
       
   294 
       
   295 	}
       
   296 
       
   297 
       
   298 /**
       
   299 @SYMTestCaseID BA-CTSY-UUS-CHWU-0003
       
   300 @SYMComponent  telephony_ctsy
       
   301 @SYMTestCaseDesc Test support in CTSY for RMobileCall::HangupWithUUI for fax calls
       
   302 @SYMTestPriority High
       
   303 @SYMTestActions Invokes RMobileCall::HangupWithUUI for fax calls
       
   304 @SYMTestExpectedResults Pass
       
   305 @SYMTestType CT
       
   306 */
       
   307 void CCTsyUserToUserSignallingFU::TestHangupWithUUI0003L()
       
   308 	{
       
   309 
       
   310 	AuxHangupWithUUIL(KMmTsyFaxLineName);
       
   311 
       
   312 	}
       
   313 
       
   314 
       
   315 /**
       
   316 @SYMTestCaseID BA-CTSY-UUS-CNUCC-0001
       
   317 @SYMComponent  telephony_ctsy
       
   318 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyUUSCapsChange for voice calls
       
   319 @SYMTestPriority High
       
   320 @SYMTestActions Invokes RMobileCall::NotifyUUSCapsChange for voice calls
       
   321 @SYMTestExpectedResults Pass
       
   322 @SYMTestType CT
       
   323 */
       
   324 void CCTsyUserToUserSignallingFU::TestNotifyUUSCapsChange0001L()
       
   325 	{
       
   326 
       
   327 	AuxNotifyUUSCapsChangeL(KMmTsyVoice1LineName);
       
   328 
       
   329 	}
       
   330 
       
   331 
       
   332 /**
       
   333 @SYMTestCaseID BA-CTSY-UUS-CNUCC-0002
       
   334 @SYMComponent  telephony_ctsy
       
   335 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyUUSCapsChange for data calls
       
   336 @SYMTestPriority High
       
   337 @SYMTestActions Invokes RMobileCall::NotifyUUSCapsChange for data calls
       
   338 @SYMTestExpectedResults Pass
       
   339 @SYMTestType CT
       
   340 */
       
   341 void CCTsyUserToUserSignallingFU::TestNotifyUUSCapsChange0002L()
       
   342 	{
       
   343 
       
   344 	AuxNotifyUUSCapsChangeL(KMmTsyDataLineName);
       
   345 
       
   346 	}
       
   347 
       
   348 
       
   349 /**
       
   350 @SYMTestCaseID BA-CTSY-UUS-CNUCC-0003
       
   351 @SYMComponent  telephony_ctsy
       
   352 @SYMTestCaseDesc Test support in CTSY for RMobileCall::NotifyUUSCapsChange for fax calls
       
   353 @SYMTestPriority High
       
   354 @SYMTestActions Invokes RMobileCall::NotifyUUSCapsChange for fax calls
       
   355 @SYMTestExpectedResults Pass
       
   356 @SYMTestType CT
       
   357 */
       
   358 void CCTsyUserToUserSignallingFU::TestNotifyUUSCapsChange0003L()
       
   359 	{
       
   360 
       
   361 	AuxNotifyUUSCapsChangeL(KMmTsyFaxLineName);
       
   362 
       
   363 	}
       
   364 
       
   365 
       
   366 /**
       
   367 @SYMTestCaseID BA-CTSY-UUS-CAICWU-0001
       
   368 @SYMComponent  telephony_ctsy
       
   369 @SYMTestCaseDesc Test support in CTSY for RMobileCall::AnswerIncomingCallWithUUI for voice calls
       
   370 @SYMTestPriority High
       
   371 @SYMTestActions Invokes RMobileCall::AnswerIncomingCallWithUUI for voice calls
       
   372 @SYMTestExpectedResults Pass
       
   373 @SYMTestType CT
       
   374 */
       
   375 void CCTsyUserToUserSignallingFU::TestAnswerIncomingCallWithUUI0001L()
       
   376 	{
       
   377 
       
   378 	AuxAnswerIncomingCallWithUUIL(KMmTsyVoice1LineName);
       
   379 
       
   380 	}
       
   381 
       
   382 
       
   383 /**
       
   384 @SYMTestCaseID BA-CTSY-UUS-CAICWU-0002
       
   385 @SYMComponent  telephony_ctsy
       
   386 @SYMTestCaseDesc Test support in CTSY for RMobileCall::AnswerIncomingCallWithUUI for data calls
       
   387 @SYMTestPriority High
       
   388 @SYMTestActions Invokes RMobileCall::AnswerIncomingCallWithUUI for data calls
       
   389 @SYMTestExpectedResults Pass
       
   390 @SYMTestType CT
       
   391 */
       
   392 void CCTsyUserToUserSignallingFU::TestAnswerIncomingCallWithUUI0002L()
       
   393 	{
       
   394 
       
   395 	AuxAnswerIncomingCallWithUUIL(KMmTsyDataLineName);
       
   396 
       
   397 	}
       
   398 
       
   399 
       
   400 /**
       
   401 @SYMTestCaseID BA-CTSY-UUS-CAICWU-0003
       
   402 @SYMComponent  telephony_ctsy
       
   403 @SYMTestCaseDesc Test support in CTSY for RMobileCall::AnswerIncomingCallWithUUI for fax calls
       
   404 @SYMTestPriority High
       
   405 @SYMTestActions Invokes RMobileCall::AnswerIncomingCallWithUUI for fax calls
       
   406 @SYMTestExpectedResults Pass
       
   407 @SYMTestType CT
       
   408 */
       
   409 void CCTsyUserToUserSignallingFU::TestAnswerIncomingCallWithUUI0003L()
       
   410 	{
       
   411 
       
   412 	AuxAnswerIncomingCallWithUUIL(KMmTsyFaxLineName);
       
   413 
       
   414 	}
       
   415 
       
   416 
       
   417 /**
       
   418 @SYMTestCaseID BA-CTSY-UUS-CSU-0001
       
   419 @SYMComponent  telephony_ctsy
       
   420 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SendUUI for voice calls
       
   421 @SYMTestPriority High
       
   422 @SYMTestActions Invokes RMobileCall::SendUUI for voice calls
       
   423 @SYMTestExpectedResults Pass
       
   424 @SYMTestType CT
       
   425 */
       
   426 void CCTsyUserToUserSignallingFU::TestSendUUI0001L()
       
   427 	{
       
   428 
       
   429 	AuxSendUUIL(KMmTsyVoice1LineName);
       
   430 
       
   431 	}
       
   432 
       
   433 
       
   434 /**
       
   435 @SYMTestCaseID BA-CTSY-UUS-CSU-0002
       
   436 @SYMComponent  telephony_ctsy
       
   437 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SendUUI for data calls
       
   438 @SYMTestPriority High
       
   439 @SYMTestActions Invokes RMobileCall::SendUUI for data calls
       
   440 @SYMTestExpectedResults Pass
       
   441 @SYMTestType CT
       
   442 */
       
   443 void CCTsyUserToUserSignallingFU::TestSendUUI0002L()
       
   444 	{
       
   445 
       
   446 	AuxSendUUIL(KMmTsyDataLineName);
       
   447 
       
   448 	}
       
   449 
       
   450 
       
   451 /**
       
   452 @SYMTestCaseID BA-CTSY-UUS-CSU-0003
       
   453 @SYMComponent  telephony_ctsy
       
   454 @SYMTestCaseDesc Test support in CTSY for RMobileCall::SendUUI for fax calls
       
   455 @SYMTestPriority High
       
   456 @SYMTestActions Invokes RMobileCall::SendUUI for fax calls
       
   457 @SYMTestExpectedResults Pass
       
   458 @SYMTestType CT
       
   459 */
       
   460 void CCTsyUserToUserSignallingFU::TestSendUUI0003L()
       
   461 	{
       
   462 
       
   463 	AuxSendUUIL(KMmTsyFaxLineName);
       
   464 
       
   465 	}
       
   466 
       
   467 
       
   468 /**
       
   469 @SYMTestCaseID BA-CTSY-UUS-MGUUSS-0001
       
   470 @SYMComponent  telephony_ctsy
       
   471 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetUUSSetting
       
   472 @SYMTestPriority High
       
   473 @SYMTestActions Invokes RMobilePhone::GetUUSSetting
       
   474 @SYMTestExpectedResults Pass
       
   475 @SYMTestType CT
       
   476 */
       
   477 void CCTsyUserToUserSignallingFU::TestGetUUSSetting0001L()
       
   478 	{
       
   479 
       
   480 	OpenEtelServerL(EUseExtendedError);
       
   481 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   482 	OpenPhoneL();
       
   483 	
       
   484 	// Test API is not supported
       
   485 	TRequestStatus reqStatus;
       
   486 	RMobilePhone::TMobilePhoneUUSSetting setting;
       
   487 	
       
   488 	iPhone.GetUUSSetting(reqStatus, setting);
       
   489 	User::WaitForRequest(reqStatus);	
       
   490 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());
       
   491 
       
   492 	AssertMockLtsyStatusL();
       
   493 	CleanupStack::PopAndDestroy(1, this); // this
       
   494 	
       
   495 	}
       
   496 
       
   497 
       
   498 /**
       
   499 @SYMTestCaseID BA-CTSY-UUS-MSUS-0001
       
   500 @SYMComponent  telephony_ctsy
       
   501 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetUUSSetting
       
   502 @SYMTestPriority High
       
   503 @SYMTestActions Invokes RMobilePhone::SetUUSSetting
       
   504 @SYMTestExpectedResults Pass
       
   505 @SYMTestType CT
       
   506 */
       
   507 void CCTsyUserToUserSignallingFU::TestSetUUSSetting0001L()
       
   508 	{
       
   509 
       
   510 	OpenEtelServerL(EUseExtendedError);
       
   511 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   512 	OpenPhoneL();
       
   513 	
       
   514 	// Test API is not supported
       
   515 	TRequestStatus reqStatus;
       
   516 	RMobilePhone::TMobilePhoneUUSSetting setting(RMobilePhone::EIncomingUUSAccepted);
       
   517 	
       
   518 	iPhone.SetUUSSetting(reqStatus, setting);
       
   519 	User::WaitForRequest(reqStatus);	
       
   520 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());
       
   521 
       
   522 	AssertMockLtsyStatusL();
       
   523 	CleanupStack::PopAndDestroy(1, this); // this
       
   524 	
       
   525 	}
       
   526 
       
   527 
       
   528 /**
       
   529 @SYMTestCaseID BA-CTSY-UUS-MNUSC-0001
       
   530 @SYMComponent  telephony_ctsy
       
   531 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyUUSSettingChange
       
   532 @SYMTestPriority High
       
   533 @SYMTestActions Invokes RMobilePhone::NotifyUUSSettingChange
       
   534 @SYMTestExpectedResults Pass
       
   535 @SYMTestType CT
       
   536 */
       
   537 void CCTsyUserToUserSignallingFU::TestNotifyUUSSettingChange0001L()
       
   538 	{
       
   539 
       
   540 	OpenEtelServerL(EUseExtendedError);
       
   541 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   542 	OpenPhoneL();
       
   543 	
       
   544 	// Test API is not supported
       
   545 	TRequestStatus reqStatus;
       
   546 	RMobilePhone::TMobilePhoneUUSSetting setting;
       
   547 	
       
   548 	iPhone.NotifyUUSSettingChange(reqStatus, setting);
       
   549 	User::WaitForRequest(reqStatus);	
       
   550 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());
       
   551 
       
   552 	AssertMockLtsyStatusL();
       
   553 	CleanupStack::PopAndDestroy(1, this); // this
       
   554 	
       
   555 	}
       
   556 
       
   557 void CCTsyUserToUserSignallingFU::AuxGetUUSCapsL(const TDesC& aLineName)
       
   558 	{
       
   559 	
       
   560 	OpenEtelServerL(EUseExtendedError);
       
   561 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   562 	OpenPhoneL();
       
   563 	
       
   564 	RLine line;
       
   565 	OpenNewLineLC(line, aLineName);
       
   566 
       
   567 	TName callName;
       
   568 	RMobileCall call;
       
   569 	OpenNewCallLC(call, line, callName);
       
   570 
       
   571 	TUint32 caps;
       
   572 	TInt ret = call.GetUUSCaps(caps);	
       
   573 	ASSERT_EQUALS (KErrNotSupported, ret);	
       
   574 
       
   575 	AssertMockLtsyStatusL();
       
   576 	CleanupStack::PopAndDestroy(3, this); // line, call, this
       
   577 	
       
   578 	}
       
   579 
       
   580 /*
       
   581  * Auxiliary function may be used only for KMmTsyDataLineName and KMmTsyFaxLineName.
       
   582  */
       
   583 void CCTsyUserToUserSignallingFU::AuxActivateUUSDataAndFaxL(const TDesC& aLineName)
       
   584 	{
       
   585 
       
   586 	if (aLineName.Compare(KMmTsyVoice1LineName) == 0)
       
   587 		{
       
   588 		ASSERT_TRUE(false);
       
   589 		}
       
   590 
       
   591 	OpenEtelServerL(EUseExtendedError);
       
   592 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   593 	OpenPhoneL();
       
   594 
       
   595 	RLine line;
       
   596 	OpenNewLineLC(line, aLineName);
       
   597 
       
   598 	TName callName;
       
   599 	RMobileCall call;
       
   600 	OpenNewCallLC(call, line, callName);
       
   601 
       
   602 	TRequestStatus reqStatus;
       
   603 	RMobileCall::TMobileCallUUSRequestV1 uusRequest;
       
   604 	RMobileCall::TMobileCallUUSRequestV1Pckg pckgUUSRequest(uusRequest);
       
   605 	
       
   606 	call.ActivateUUS(reqStatus, pckgUUSRequest);
       
   607 	User::WaitForRequest(reqStatus);	
       
   608 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   609 
       
   610 	AssertMockLtsyStatusL();
       
   611 	CleanupStack::PopAndDestroy(3, this); // line, fax, this
       
   612 	
       
   613 	}
       
   614 
       
   615 void CCTsyUserToUserSignallingFU::AuxHangupWithUUIL(const TDesC& aLineName)
       
   616 	{
       
   617 	
       
   618 	OpenEtelServerL(EUseExtendedError);
       
   619 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   620 	OpenPhoneL();
       
   621 
       
   622 	RLine line;
       
   623 	OpenNewLineLC(line, aLineName);
       
   624 
       
   625 	TName callName;
       
   626 	RMobileCall call;
       
   627 	OpenNewCallLC(call, line, callName);
       
   628 
       
   629 	TRequestStatus reqStatus;
       
   630 	RMobileCall::TMobileCallUUI uui;
       
   631 		
       
   632 	call.HangupWithUUI(reqStatus, uui);
       
   633 	User::WaitForRequest(reqStatus);	
       
   634 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   635 
       
   636 	AssertMockLtsyStatusL();
       
   637 	CleanupStack::PopAndDestroy(3, this); // line, call, this
       
   638 	
       
   639 	}
       
   640 
       
   641 void CCTsyUserToUserSignallingFU::AuxNotifyUUSCapsChangeL(const TDesC& aLineName)
       
   642 	{
       
   643 
       
   644 	OpenEtelServerL(EUseExtendedError);
       
   645 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   646 	OpenPhoneL();
       
   647 
       
   648 	RLine line;
       
   649 	OpenNewLineLC(line, aLineName);
       
   650 
       
   651 	TName callName;
       
   652 	RMobileCall call;
       
   653 	OpenNewCallLC(call, line, callName);
       
   654 
       
   655 	TRequestStatus reqStatus;
       
   656 	TUint32 caps;
       
   657 		
       
   658 	call.NotifyUUSCapsChange(reqStatus, caps);
       
   659 	User::WaitForRequest(reqStatus);	
       
   660 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   661 
       
   662 	AssertMockLtsyStatusL();
       
   663 	CleanupStack::PopAndDestroy(3, this); // line, call, this
       
   664 	
       
   665 	}
       
   666 
       
   667 void CCTsyUserToUserSignallingFU::AuxAnswerIncomingCallWithUUIL(const TDesC& aLineName)
       
   668 	{
       
   669 	
       
   670 	OpenEtelServerL(EUseExtendedError);
       
   671 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   672 	OpenPhoneL();
       
   673 
       
   674 	RLine line;
       
   675 	OpenNewLineLC(line, aLineName);
       
   676 
       
   677 	TName callName;
       
   678 	RMobileCall call;
       
   679 	OpenNewCallLC(call, line, callName);
       
   680 
       
   681 	TRequestStatus reqStatus;
       
   682 	_LIT(KSomething, "Some");
       
   683 	RMobileCall::TMobileCallUUI uui(KSomething);
       
   684 	RMobileCall::TMobileCallParamsV1 callParam;
       
   685 	RMobileCall::TMobileCallParamsV1Pckg pckgCallParam(callParam);
       
   686 		
       
   687 	call.AnswerIncomingCallWithUUI(reqStatus, pckgCallParam, uui);
       
   688 	User::WaitForRequest(reqStatus);	
       
   689 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   690 
       
   691 	AssertMockLtsyStatusL();
       
   692 	CleanupStack::PopAndDestroy(3, this); // ... , this
       
   693 	
       
   694 	}
       
   695 
       
   696 void CCTsyUserToUserSignallingFU::AuxSendUUIL(const TDesC& aLineName)
       
   697 	{
       
   698 
       
   699 	OpenEtelServerL(EUseExtendedError);
       
   700 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   701 	OpenPhoneL();
       
   702 
       
   703 	RLine line;
       
   704 	OpenNewLineLC(line, aLineName);
       
   705 
       
   706 	TName callName;
       
   707 	RMobileCall call;
       
   708 	OpenNewCallLC(call, line, callName);
       
   709 
       
   710 	TRequestStatus reqStatus;
       
   711 	_LIT(KSomething, "Some");
       
   712 	RMobileCall::TMobileCallUUI uui(KSomething);
       
   713 	TBool more (EFalse);
       
   714 		
       
   715 	call.SendUUI(reqStatus, more, uui);
       
   716 	User::WaitForRequest(reqStatus);	
       
   717 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   718 
       
   719 	AssertMockLtsyStatusL();
       
   720 	CleanupStack::PopAndDestroy(3, this); // ... , this
       
   721 	
       
   722 	}
       
   723 
       
   724 /*
       
   725  * Auxiliary function may be used only for KMmTsyDataLineName and KMmTsyFaxLineName.
       
   726  */
       
   727 void CCTsyUserToUserSignallingFU::AuxReceiveUUIDataAndFaxL(const TDesC& aLineName)
       
   728 	{
       
   729 
       
   730 	if (aLineName.Compare(KMmTsyVoice1LineName) == 0)
       
   731 		{
       
   732 		ASSERT_TRUE(false);
       
   733 		}
       
   734 
       
   735 	OpenEtelServerL(EUseExtendedError);
       
   736 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   737 	OpenPhoneL();
       
   738 
       
   739 	RLine line;
       
   740 	OpenNewLineLC(line, aLineName);
       
   741 
       
   742 	TName callName;
       
   743 	RMobileCall call;
       
   744 	OpenNewCallLC(call, line, callName);
       
   745 
       
   746 	TRequestStatus reqStatus;
       
   747 	RMobileCall::TMobileCallUUI uui;
       
   748 	
       
   749 	call.ReceiveUUI(reqStatus, uui);
       
   750 	User::WaitForRequest(reqStatus);	
       
   751 	ASSERT_EQUALS (KErrNotSupported, reqStatus.Int());	
       
   752 
       
   753 	AssertMockLtsyStatusL();
       
   754 	CleanupStack::PopAndDestroy(3, this); // line, call, this
       
   755 	
       
   756 	}
       
   757 
       
   758 /*
       
   759  * Auxiliary function may be used only for KMmTsyVoice1LineName.
       
   760  * 
       
   761  * @capability aWaitForComplete - Indicator that determines when call of CompleteL()
       
   762  * must be complete. If client sets it to ETrue then call of CompleteL()
       
   763  * is completed befor call of ReceiveUUI(). Default variable is equal EFalse.
       
   764  */
       
   765 
       
   766 void CCTsyUserToUserSignallingFU::AuxReceiveUUIVoiceL(TBool aWaitForComplete)
       
   767 	{
       
   768 
       
   769 	OpenEtelServerL(EUseExtendedError);
       
   770 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   771 	OpenPhoneL();
       
   772 
       
   773 	RBuf8 data;
       
   774 	CleanupClosePushL(data);
       
   775 
       
   776 	RLine line;
       
   777 	OpenNewLineLC(line, KMmTsyVoice1LineName);
       
   778 
       
   779 	TName callName;
       
   780 	RMobileCall call;
       
   781 	TInt callId(1);
       
   782 	RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
       
   783 	CreateAndOpenCallForVoiceLC( line, call, callId, callName, mobileService);
       
   784 
       
   785 	TRequestStatus reqStatus;
       
   786 	TRequestStatus mockStatus;
       
   787 	RMobileCall::TMobileCallUUI uui;
       
   788 
       
   789 	_LIT(KUUI, "old witch");
       
   790 	RMobileCall::TMobileCallUUI receiveUUI;
       
   791 	receiveUUI.Append(KUUI);
       
   792 	TMockLtsyCallData1<RMobileCall::TMobileCallUUI> mockData(callId, mobileService, receiveUUI);
       
   793 
       
   794 	if (aWaitForComplete)
       
   795 		{
       
   796 		iMockLTSY.NotifyTerminated(mockStatus);
       
   797 		}
       
   798 	
       
   799 	mockData.SerialiseL(data);
       
   800 	iMockLTSY.CompleteL(EMobileCallReceiveUUI, KErrNone, data);
       
   801 	
       
   802 	if (aWaitForComplete)
       
   803 		{
       
   804 		/*
       
   805 		 * Wait for CompleteL() to ensure that iReceivedUUI is updated 
       
   806 		 * before call.ReceiveUUI() is called.
       
   807 		 */
       
   808 		User::WaitForRequest(mockStatus);
       
   809 		ASSERT_EQUALS (KErrNone, mockStatus.Int());	
       
   810 		}
       
   811 
       
   812 	call.ReceiveUUI(reqStatus, uui);
       
   813 	User::WaitForRequest(reqStatus);	
       
   814 	ASSERT_EQUALS (KErrNone, reqStatus.Int());	
       
   815 
       
   816 	ASSERT_EQUALS(0, receiveUUI.Compare(uui));
       
   817 
       
   818 	AssertMockLtsyStatusL();
       
   819 	CleanupStack::PopAndDestroy(4, this); // line, this, data, call
       
   820 	
       
   821 	}
       
   822 
       
   823 /*
       
   824  * Opens a line by name.
       
   825  */
       
   826 void CCTsyUserToUserSignallingFU::OpenNewLineLC(RLine& aLine, const TDesC& aLineName)
       
   827 	{
       
   828 	TInt errorCode = aLine.Open(iPhone, aLineName);
       
   829 	ASSERT_EQUALS (KErrNone, errorCode);
       
   830 	CleanupClosePushL(aLine);
       
   831 	}
       
   832 
       
   833 /*
       
   834  * Opens a new call for line.
       
   835  */
       
   836 void CCTsyUserToUserSignallingFU::OpenNewCallLC(RMobileCall& aCall, RLine& aLine, TDes& aCallName)
       
   837 	{
       
   838 	TInt errorCode = aCall.OpenNewCall(aLine, aCallName);
       
   839 	ASSERT_EQUALS(KErrNone, errorCode);
       
   840 	CleanupClosePushL(aCall);
       
   841 	}
       
   842 
       
   843 /**
       
   844 A function creates and opens new incomming call for voice with aCallId and gets aCallName.
       
   845 */
       
   846 void CCTsyUserToUserSignallingFU::CreateAndOpenCallForVoiceLC( RLine& aLine, RCall& aCall, 
       
   847 													TInt aCallId, TName& aCallName,
       
   848 													RMobilePhone::TMobileService& aMobileService,
       
   849 													RMobileCall::TMobileCallStatus aMobileCallStatus)
       
   850 	{
       
   851 	
       
   852 	TName lineName; 
       
   853 
       
   854 	switch(aMobileService)
       
   855 		{
       
   856 		case RMobilePhone::EVoiceService:
       
   857 			{
       
   858 			lineName = KMmTsyVoice1LineName;
       
   859 			break;
       
   860 			}
       
   861 		case RMobilePhone::ECircuitDataService:
       
   862 			{
       
   863 			lineName = KMmTsyDataLineName;
       
   864 			break;
       
   865 			}
       
   866 		case RMobilePhone::EFaxService:
       
   867 			{
       
   868 			lineName = KMmTsyFaxLineName;
       
   869 			break;
       
   870 			}
       
   871 		default:
       
   872 			{
       
   873 			ASSERT_TRUE(false);
       
   874 			}
       
   875 		}
       
   876 	
       
   877 	// create new incoming call
       
   878 	TInt errorCode = CreateIncomingCallL(aLine, aCallId, lineName, aCallName,
       
   879 										aMobileService, aMobileCallStatus);
       
   880 	ASSERT_EQUALS(KErrNone, errorCode);
       
   881 	CleanupClosePushL(aCall);
       
   882 	
       
   883 	errorCode = aCall.OpenExistingCall(aLine, aCallName);
       
   884 	ASSERT_EQUALS(KErrNone, errorCode);
       
   885 
       
   886 	}
       
   887