mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscalleventmonitor.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
   109     */
   109     */
   110     RProperty::Set( NMusSessionInformationApi::KCategoryUid,
   110     RProperty::Set( NMusSessionInformationApi::KCategoryUid,
   111                      NMusSessionInformationApi::KMusCallEvent,
   111                      NMusSessionInformationApi::KMusCallEvent,
   112                      0 );
   112                      0 );
   113     
   113     
   114     iCallEventMonitor = CMusCallEventMonitor::NewL( iCall, *this, *this );
   114     iCallEventMonitor = CMusCallEventMonitor::NewL( iCall, *this );
   115     
   115     
   116     }
   116     }
   117 
   117 
   118 
   118 
   119 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   168                      val );
   168                      val );
   169     EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected);
   169     EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected);
   170 
   170 
   171 	// Test : Local Transfered. Means no call.
   171 	// Test : Local Transfered. Means no call.
   172     iCallEventMonitor->Cancel();
   172     iCallEventMonitor->Cancel();
       
   173     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
       
   174                     NMusSessionInformationApi::KMusCallEvent,
       
   175                     val );
       
   176     TInt callEnt = val;
   173     RTelHelper::SetCallEvent( RMobileCall::ELocalTransfer );    
   177     RTelHelper::SetCallEvent( RMobileCall::ELocalTransfer );    
   174     iCallEventMonitor->RunL();
   178     iCallEventMonitor->RunL();
   175     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   179     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   176                      NMusSessionInformationApi::KMusCallEvent,
   180                      NMusSessionInformationApi::KMusCallEvent,
   177                      val );
   181                      val );
   178                      
   182                      
   179     EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall);
   183     EUNIT_ASSERT( callEnt==val );
   180     
   184     
   181 	// Test : Remote is on hold
   185 	// Test : Remote is on hold
   182     iCallEventMonitor->Cancel();
   186     iCallEventMonitor->Cancel();
   183     RTelHelper::SetCallEvent( RMobileCall::ERemoteHold );
   187     RTelHelper::SetCallEvent( RMobileCall::ERemoteHold );
   184     iCallEventMonitor->RunL();
   188     iCallEventMonitor->RunL();
   210     EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall);
   214     EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall);
   211      */   
   215      */   
   212     
   216     
   213 	// Test : Remote is on conference
   217 	// Test : Remote is on conference
   214     iCallEventMonitor->Cancel();
   218     iCallEventMonitor->Cancel();
       
   219     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
       
   220                     NMusSessionInformationApi::KMusCallEvent,
       
   221                     val );
       
   222     callEnt = val;
   215     RTelHelper::SetCallEvent( RMobileCall::ERemoteConferenceCreate );
   223     RTelHelper::SetCallEvent( RMobileCall::ERemoteConferenceCreate );
   216     iCallEventMonitor->RunL();
   224     iCallEventMonitor->RunL();
   217     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   225     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   218                      NMusSessionInformationApi::KMusCallEvent,
   226                      NMusSessionInformationApi::KMusCallEvent,
   219                      val );
   227                      val );
   220     EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall);
   228     EUNIT_ASSERT( callEnt==val );
   221 
   229 
   222 	// Test : Remote conference transfer
   230 	// Test : Remote conference transfer
   223     iCallEventMonitor->Cancel();
   231     iCallEventMonitor->Cancel();
   224     RTelHelper::SetCallEvent( RMobileCall::ERemoteTransferring );
   232     RTelHelper::SetCallEvent( RMobileCall::ERemoteTransferring );
   225     iCallEventMonitor->RunL();
   233     iCallEventMonitor->RunL();
   226     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   234     RProperty::Get( NMusSessionInformationApi::KCategoryUid,
   227                      NMusSessionInformationApi::KMusCallEvent,
   235                      NMusSessionInformationApi::KMusCallEvent,
   228                      val );
   236                      val );
   229     EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall);//Previous state.   
   237     EUNIT_ASSERT( val==callEnt );
   230 
   238 
   231     // remote is connected state and local resume
   239     // remote is connected state and local resume
   232     iCallEventMonitor->Cancel();
   240     iCallEventMonitor->Cancel();
   233     RTelHelper::SetCallEvent( RMobileCall::ELocalResume );
   241     RTelHelper::SetCallEvent( RMobileCall::ELocalResume );
   234     iCallEventMonitor->iRemoteCallEvent = RMobileCall::ERemoteResume;
   242     iCallEventMonitor->iRemoteCallEvent = RMobileCall::ERemoteResume;
   290 //
   298 //
   291 void UT_CMusCallEventMonitor::UT_CMusCallEventMonitor_RunErrorL()
   299 void UT_CMusCallEventMonitor::UT_CMusCallEventMonitor_RunErrorL()
   292     {
   300     {
   293     EUNIT_ASSERT( iCallEventMonitor );
   301     EUNIT_ASSERT( iCallEventMonitor );
   294     TInt error = KErrNotFound;
   302     TInt error = KErrNotFound;
   295     iCallEventMonitor->RunError(error);
   303     EUNIT_ASSERT_EQUALS(iCallEventMonitor->RunError(error), KErrNone);
   296     }
   304     EUNIT_ASSERT_EQUALS(iCallEventMonitor->RunError(KErrNone), KErrNone);
   297 
   305     }
   298 
   306 
   299 // -----------------------------------------------------------------------------
   307 
   300 //  MusCallStateChanged from the MusCallStateObserver 
   308    
   301 // -----------------------------------------------------------------------------
       
   302 //
       
   303 void UT_CMusCallEventMonitor::MusCallStateChanged()
       
   304     {
       
   305     //NOP:
       
   306     }   
       
   307 
   309 
   308 
   310 
   309 //  TEST TABLE
   311 //  TEST TABLE
   310 
   312 
   311 EUNIT_BEGIN_TEST_TABLE(
   313 EUNIT_BEGIN_TEST_TABLE(