mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipsession.cpp
branchRCL_3
changeset 19 95754dcd27ad
parent 18 0da2e08216b6
child 21 ce86b6d44a6d
equal deleted inserted replaced
18:0da2e08216b6 19:95754dcd27ad
  1540     EUNIT_ASSERT( iObserver->iTranscodingNeededCalled )
  1540     EUNIT_ASSERT( iObserver->iTranscodingNeededCalled )
  1541     EUNIT_ASSERT( !iObserver->iDueUnknowCapas )
  1541     EUNIT_ASSERT( !iObserver->iDueUnknowCapas )
  1542           
  1542           
  1543     }
  1543     }
  1544 
  1544 
       
  1545 void UT_CMusEngClipSession::UT_IsRewindFromEndL()
       
  1546     {
       
  1547     // Try before establishing the session
       
  1548     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1549     
       
  1550     // Try with session, but without video out stream 
       
  1551     
       
  1552     CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile();
       
  1553   
       
  1554     iClipSession->iSession = CMceOutSession::NewL( 
       
  1555                                     *(iClipSession->iManager),
       
  1556                                     *profile,
       
  1557                                     KTestRecipientSipUri8() ); 
       
  1558     
       
  1559     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1560     
       
  1561     // Try with video out stream without source...
       
  1562     CMceVideoStream* videoOut = CMceVideoStream::NewLC();
       
  1563     
       
  1564     videoOut->AddSinkL( CMceRtpSink::NewLC() );
       
  1565     CleanupStack::Pop();
       
  1566      
       
  1567     iClipSession->iSession->AddStreamL( videoOut );
       
  1568     CleanupStack::Pop( videoOut );
       
  1569     
       
  1570     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1571     
       
  1572     // And with enabled source and stream     
       
  1573     videoOut->SetSourceL( CMceFileSource::NewLC( *iClipSession->iManager,
       
  1574                                                  iClipSession->iFileName ) );
       
  1575     CleanupStack::Pop();
       
  1576     
       
  1577     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1578     
       
  1579     // try with different position and duration
       
  1580     (static_cast<CMceFileSource*> (videoOut->Source()))->iPosition = 90;
       
  1581     (static_cast<CMceFileSource*> (videoOut->Source()))->iDuration = 111;
       
  1582     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1583     
       
  1584     // Disapling source
       
  1585     (static_cast<CMceFileSource*> (videoOut->Source()))->DisableL();
       
  1586     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1587 
       
  1588     // Disapling stream
       
  1589     videoOut->iState = CMceMediaStream::EDisabled;
       
  1590     EUNIT_ASSERT( iClipSession->IsRewindFromEnd() )
       
  1591        
       
  1592     // and finaly try with "real" end of clip 
       
  1593     (static_cast<CMceFileSource*> (videoOut->Source()))->iPosition = 0;
       
  1594     (static_cast<CMceFileSource*> (videoOut->Source()))->iDuration = 111;
       
  1595     
       
  1596     EUNIT_ASSERT( !iClipSession->IsRewindFromEnd() )
       
  1597     }
  1545 
  1598 
  1546 //  TEST TABLE
  1599 //  TEST TABLE
  1547 
  1600 
  1548 EUNIT_BEGIN_TEST_TABLE(
  1601 EUNIT_BEGIN_TEST_TABLE(
  1549     UT_CMusEngClipSession,
  1602     UT_CMusEngClipSession,
  1709     "CMusEngClipSession",
  1762     "CMusEngClipSession",
  1710     "EstablishSessionL",
  1763     "EstablishSessionL",
  1711     "FUNCTIONALITY",
  1764     "FUNCTIONALITY",
  1712     SetupL, UT_EstablishSessionLL, Teardown)    
  1765     SetupL, UT_EstablishSessionLL, Teardown)    
  1713 
  1766 
  1714         
  1767 EUNIT_TEST(
       
  1768     "IsRewindFromEnd - test ",
       
  1769     "CMusEngClipSession",
       
  1770     "IsRewindFromEnd",
       
  1771     "FUNCTIONALITY",
       
  1772     SetupL, UT_IsRewindFromEndL, Teardown)
       
  1773     
  1715 EUNIT_END_TEST_TABLE
  1774 EUNIT_END_TEST_TABLE
  1716 
  1775 
  1717 //  END OF FILE
  1776 //  END OF FILE
  1718 
  1777 
  1719 
  1778