telephonyserverplugins/common_tsy/test/component/src/cctsyucasembms001.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2008-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  @file The TEFUnit integration test suite for MBMS Context support in the Common TSY.
       
    18 */
       
    19 
       
    20 #include "cctsyucasembms001.h"
       
    21 #include "cctsyactiveretriever.h"
       
    22 #include <etel.h>
       
    23 #include <etelmm.h>
       
    24 #include <et_clsvr.h>
       
    25 #include <ctsy/mmtsy_names.h>
       
    26 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    27 #include "tmockltsydata.h"
       
    28 #include <ctsy/serviceapi/gsmerror.h>
       
    29 
       
    30 #include <pcktcs.h>
       
    31 #include <pcktlist.h>
       
    32 #include "pcktretrieve.h"
       
    33 #include "CMmCommonStaticUtility.h"
       
    34 #include <ctsy/serviceapi/mmtsy_defaults.h>
       
    35 
       
    36 CTestSuite* CCTsyUCaseMbms001::CreateSuiteL(const TDesC& aName) 
       
    37 	{
       
    38 	SUB_SUITE;
       
    39     ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms001, CCtsyIntegrationTestMbms0001L );
       
    40 	END_SUITE;
       
    41 	}    
       
    42 
       
    43 //
       
    44 // Actual test cases
       
    45 //
       
    46 
       
    47 /**
       
    48  * @SYMTestCaseID BA-CTSY-INT-MB-0001
       
    49  * @SYMFssID BA/CTSY/PKTS-0001
       
    50  * @SYMTestCaseDesc MBMS Phone Support Requirements.
       
    51  * @SYMTestPriority High
       
    52  * @SYMTestActions RPacketService::GetStaticCaps
       
    53  * @SYMTestExpectedResults Pass - MBMS phone capability is supported.
       
    54  * @SYMTestType CIT
       
    55  * @SYMTestCaseDependencies live/manual
       
    56  *
       
    57  * Reason for test: to determinate whether phone supports MBMS or not.
       
    58  *
       
    59  * @return - none
       
    60  */
       
    61 void CCTsyUCaseMbms001::CCtsyIntegrationTestMbms0001L()
       
    62     {
       
    63         
       
    64 	//
       
    65 	// SET UP
       
    66 	//
       
    67 	        
       
    68     OpenEtelServerL( EUseExtendedError );
       
    69 	CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
       
    70 	OpenPhoneL();	
       
    71 	
       
    72 	RPacketService packetService;
       
    73     OpenPacketServiceL( packetService );
       
    74     CleanupClosePushL( packetService );
       
    75               
       
    76 	TInfoName contextId;
       
    77     RPacketMbmsContext packetMbmsContext;
       
    78     packetMbmsContext.OpenNewContext( packetService, contextId );
       
    79     CleanupClosePushL( packetMbmsContext );
       
    80     
       
    81 	//
       
    82 	// SET UP END
       
    83 	//    
       
    84             
       
    85 	//
       
    86 	// TEST START
       
    87 	//
       
    88 
       
    89   	TRequestStatus mockLtsyStatus;	
       
    90 	RBuf8 data;
       
    91 	CleanupClosePushL(data);
       
    92 
       
    93 	RBuf8 data2;
       
    94 	CleanupClosePushL(data2);
       
    95 
       
    96 	// Ensure RPacketService::GetStaticCaps returns caps KCapsMBMSSupported.			  	
       
    97     TUint staticCaps = 0;
       
    98    	TUint expectedCaps = 	RPacketService::KCapsSuspendSupported |
       
    99 							RPacketService::KCapsNetworkAvailabilitySupported | 
       
   100 							RPacketService::KCapsSetDefaultContextSupported | 
       
   101 							RPacketService::KCapsChangeAttachModeSupported | 
       
   102 							RPacketService::KCapsGetDataTransferredSupported | 
       
   103 							RPacketService::KCapsPreferredBearerSupported | 
       
   104 							RPacketService::KCapsPdpDataCompSupported | 
       
   105 							RPacketService::KCapsPdpHeaderCompSupported | 
       
   106 						    RPacketService::KCapsMSClassSupported |
       
   107 							RPacketService::KCapsNotifyMSClassSupported |
       
   108 							RPacketService::KCapsMBMSSupported;	
       
   109 									
       
   110 	TMockLtsyData1<TUint> ltsyData2(expectedCaps);
       
   111 	data2.Close();
       
   112 	ltsyData2.SerialiseL(data2);
       
   113 
       
   114 	iMockLTSY.NotifyTerminated(mockLtsyStatus);	
       
   115 	iMockLTSY.CompleteL( EPacketGetStaticCaps, KErrNone, data2 );
       
   116 	User::WaitForRequest(mockLtsyStatus);	
       
   117 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   118 			   		
       
   119    	TInt ret = packetService.GetStaticCaps(staticCaps, RPacketContext::EPdpTypeIPv4);
       
   120  	AssertMockLtsyStatusL();
       
   121 	ASSERT_EQUALS(KErrNone, ret);	
       
   122 				
       
   123 	ASSERT_EQUALS(expectedCaps, staticCaps);
       
   124 		
       
   125 	//
       
   126 	// TEST END
       
   127 	//	
       
   128 	
       
   129 	AssertMockLtsyStatusL();
       
   130 	CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this 
       
   131     }    
       
   132