Esempio n. 1
0
void EventSink::_OnMouseMove(wxMouseEvent &event)
{
    if( m_pParentShape->GetEventProcessing() & wxSFControlShape::evtMOUSE2CANVAS )
    {
        wxMouseEvent updatedEvent(event);

        UpdateMouseEvent(updatedEvent);
        SendEvent(updatedEvent);
    }

    // process the event also by an original handler if requested
    if( m_pParentShape->GetEventProcessing() & wxSFControlShape::evtMOUSE2GUI ) event.Skip();
}
void UT_CMceStateOffering::UT_CMceStateOffering_EntryL_WithOtherEventsL()
    {
    TMceIds ids;
    CMceMsgBase* msg = NULL;   
    
    // user cancel (not ready)
    iSipSession->iSubState = CMceSipSession::EOffering;
    iSipSession->PendingTransactions()[0]->iState = CSIPTransactionBase::ETrying;
    TMceStateTransitionEvent cancelEvent( *iSipSession, EMceItcCancel, ids, *msg );
    iState->EntryL( cancelEvent );
   
    MCE_ASSERT_STUBS( CMCETls::ECloseSession, //mmaction 
                      CMCETls::ENone, //mmsdpaction 
                      SipStrConsts::EEmpty, //sentMethod 
                      KErrNotFound ); //sentResponse
    
    EUNIT_ASSERT_EQUALS( 1, iSipSession->PendingTransactions().Count() );
    EUNIT_ASSERT_EQUALS( EMceItcCancel , cancelEvent.Code() );
    MCE_RESET_STUBS();

    // user cancel (ready)
    iSipSession->iSubState = CMceSipSession::EOffering;
    iSipSession->InviteTransaction()->iState = CSIPTransactionBase::EProceeding;
    TMceStateTransitionEvent cancelEvent2( *iSipSession, EMceItcCancel, ids, *msg );
    iState->EntryL( cancelEvent2 );
    
    MCE_ASSERT_STUBS( CMCETls::ECloseSession, //mmaction 
                      CMCETls::ENone, //mmsdpaction
                      SipStrConsts::ECancel, //sentMethod 
                      KErrNotFound ); //sentResponse
    
    EUNIT_ASSERT_EQUALS( 2, iSipSession->PendingTransactions().Count() )
    MCE_RESET_STUBS();

    iSipSession->iSubState = CMceSipSession::EOffering;
    TMceStateTransitionEvent updatedEvent( *iSipSession, EMceMediaUpdated );
    iState->EntryL( updatedEvent );
    
    MCE_ASSERT_STUBS( CMCETls::ENone, //mmaction 
                      CMCETls::ENone, //mmsdpaction 
                      SipStrConsts::EEmpty, //sentMethod, 
                      KErrNotFound ); //sentResponse
    
    EUNIT_ASSERT_EQUALS( 2, iSipSession->PendingTransactions().Count() )

    iSipSession->iSubState = CMceSipSession::EOffering;
    
    updatedEvent.ParamStatus() = KErrGeneral;
    iState->EntryL( updatedEvent );// NOP
    
    MCE_ASSERT_STUBS( CMCETls::ENone, //mmaction 
                      CMCETls::ENone, //mmsdpaction 
                      SipStrConsts::EEmpty, //sentMethod 
                      KErrNotFound );  //sentResponse
    
    EUNIT_ASSERT_EQUALS( 2, iSipSession->PendingTransactions().Count() )
    MCE_RESET_STUBS();

    // update and ready
    iStorage->iMediaManagerUpdateStatus = KMceReady;
    iSipSession->iSubState = CMceSipSession::EUpdating;
    iSipSession->iNewBodyCandidate = iSipSession->iBody->CloneL();
    iSipSession->iResponse = iSipSession->PendingTransactions()[0];
    MCETestHelper::SetResponseL( 
        *iSipSession->iResponse, 
        KMceSipOK, SipStrConsts::EPhraseOk, ETrue );
      
    TMceStateTransitionEvent okResponseEvent( *iSipSession, EMceResponse );
    iState->EntryL( okResponseEvent );
    
    MCE_CHECK_MEMORY_LEAVE( iStorage->iMediaManagerSdpAction != CMCETls::EDecode )
    MCE_ASSERT_STUBS( CMCETls::ECloseSession, //mmaction 
                      CMCETls::EDecode, //mmsdpaction 
                      SipStrConsts::EAck, //sentMethod 
                      KErrNotFound ); //sentResponse
    
    EUNIT_ASSERT ( iStorage->iAckSent );
    EUNIT_ASSERT_EQUALS( 2, iSipSession->PendingTransactions().Count() )
    EUNIT_ASSERT ( okResponseEvent.Code() == EMceMediaUpdated );

    // refresing with bad SDP
    iSipSession->iSubState = CMceSipSession::ERefreshing;
    MCE_RESET_STUBS();
    iSipSession->iResponse = iSipSession->PendingTransactions()[0];
    MCETestHelper::SetResponseBADL( *iSipSession->iResponse, KMceSipOK, SipStrConsts::EPhraseOk );
    
    TMceStateTransitionEvent badResponseEvent( *iSipSession, EMceResponse );
    iState->EntryL( badResponseEvent );
    
    EUNIT_ASSERT ( iStorage->iMediaManagerAction == CMCETls::ENone );
    EUNIT_ASSERT ( iStorage->iSipSentMethod == SIPStrings::StringF( SipStrConsts::EAck ) );
    EUNIT_ASSERT ( iStorage->iAckSent );
    EUNIT_ASSERT_EQUALS( 2, iSipSession->PendingTransactions().Count() )   
    }