mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivesession.cpp
branchRCL_3
changeset 23 bc78a40cd63c
parent 22 73a1feb507fb
equal deleted inserted replaced
22:73a1feb507fb 23:bc78a40cd63c
    22 #include "musengtestdefs.h"
    22 #include "musengtestdefs.h"
    23 #include "musenglivesession.h"
    23 #include "musenglivesession.h"
    24 #include "mussipprofilehandler.h"
    24 #include "mussipprofilehandler.h"
    25 #include "musengmceutils.h"
    25 #include "musengmceutils.h"
    26 #include "mussettings.h"
    26 #include "mussettings.h"
    27 #include "mussessionproperties.h"
       
    28 #include "musenglivevideoplayer.h"
       
    29 
    27 
    30 //  SYSTEM INCLUDES
    28 //  SYSTEM INCLUDES
    31 #include <digia/eunit/eunitmacros.h>
    29 #include <digia/eunit/eunitmacros.h>
    32 #include <mceoutsession.h>
    30 #include <mceoutsession.h>
    33 #include <mcestreambundle.h>
    31 #include <mcestreambundle.h>
    38 #include <mceh263codec.h>
    36 #include <mceh263codec.h>
    39 #include <mceavccodec.h>
    37 #include <mceavccodec.h>
    40 #include <mceaudiocodec.h>
    38 #include <mceaudiocodec.h>
    41 
    39 
    42 
    40 
       
    41 _LIT8( KMusAvcBitrateLevel1TestText, "TestTextForAvcBrL1Level" );
       
    42 _LIT8( KMusAvcBitrateLevel1bTestText, "TestTextForAvcBrL1bLevel" );
       
    43 _LIT8( KMusAvcBitrateLevel1_1TestText, "TestTextForAvcBrL1_1Level" );
       
    44 _LIT8( KMusAvcBitrateLevel1_2TestText, "TestTextForAvcBrL1_2Level" );
       
    45 _LIT8( KMusAvcBitrateLevel1_3TestText, "TestTextForAvcBrL1_3Level" );
       
    46 _LIT8( KMusAvcBitrateLevel2TestText, "TestTextForAvcBrL2Level" );
       
    47 
       
    48 _LIT8( KMusAvcBitrateLevel_1b_ConfigKey, "AvcBrL1b=TestTextForAvcBrL1bLevel;" );
       
    49 
       
    50 _LIT8( KMusAvcBitrateLevel_1_1_ConfigKey, 
       
    51 "AvcBrL1_1=TestTextForAvcBrL1_1Level;");
       
    52 
       
    53 _LIT8( KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys, 
       
    54 "AvcBrL1_1=TestTextForAvcBrL1_1Level;\
       
    55 AvcBrL1b=TestTextForAvcBrL1bLevel;" );
       
    56 
       
    57 _LIT8( KMusAvcAllLevelsConcatenation,
       
    58 "AvcBrL1=TestTextForAvcBrL1Level;\
       
    59 AvcBrL1b=TestTextForAvcBrL1bLevel;\
       
    60 AvcBrL1_1=TestTextForAvcBrL1_1Level;\
       
    61 AvcBrL1_2=TestTextForAvcBrL1_2Level;\
       
    62 AvcBrL1_3=TestTextForAvcBrL1_3Level;\
       
    63 AvcBrL2=TestTextForAvcBrL2Level;" );
       
    64 
       
    65 
    43 
    66 
    44 //use step in different time period
    67 //use step in different time period
    45 const TInt KZoomBigStepCount = 15;
    68 const TInt KZoomBigStepCount = 15;
    46 const TInt KZoomSmallStepCount = KZoomBigStepCount*2;
    69 const TInt KZoomSmallStepCount = KZoomBigStepCount*2;
    47 const TInt KZoomStepMinSize = 1;
    70 const TInt KZoomStepMinSize = 1;
   114 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   115 //
   138 //
   116 // -----------------------------------------------------------------------------
   139 // -----------------------------------------------------------------------------
   117 //
   140 //
   118 void UT_CMusEngLiveSession::SetupL()
   141 void UT_CMusEngLiveSession::SetupL()
   119     {    
   142     {
   120     iLcSessionObserver = new( ELeave )CLcSessionObserverStub;
   143     iObserver = new( ELeave ) CMusEngObserverStub;
   121     iLcUiProvider = new( ELeave )CLcUiProviderStub;
   144     
   122     iAudioRoutingObserver = new( ELeave )CMusEngObserverStub;    
   145     iLiveSession = CMusEngLiveSession::NewL( TRect(0, 0, 100, 100),
   123     
   146                                              *iObserver,
   124     iLiveSession = CMusEngLiveSession::NewL();
   147                                              *iObserver,
   125     iLiveSession->SetLcSessionObserver( iLcSessionObserver );
   148                                              *iObserver );
   126     iLiveSession->SetLcUiProvider( iLcUiProvider );
       
   127                                              
   149                                              
   128     iRecordedLiveSession = CMusEngLiveSession::NewL();
   150     iRecordedLiveSession = CMusEngLiveSession::NewL( KTestVideoFileName(),
   129     iRecordedLiveSession->SetLcSessionObserver( iLcSessionObserver );
   151                                                      TRect(0, 0, 100, 100),
   130     iRecordedLiveSession->SetLcUiProvider( iLcUiProvider );
   152                                                      *iObserver,
   131     MLcDestinationFileControl* destinationFileControl =
   153                                                      *iObserver,
   132         iRecordedLiveSession->LocalVideoPlayer()->LcDestinationFileControl();
   154                                                      *iObserver );    
   133     destinationFileControl->SetLcFileNameL( KTestVideoFileName() );
   155 
   134     
       
   135     User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid,
       
   136                                         NMusSessionApi::KRemoteSipAddress,
       
   137                                         KTestRecipientSipUri ) );
       
   138     }
   156     }
   139 
   157 
   140 
   158 
   141 // -----------------------------------------------------------------------------
   159 // -----------------------------------------------------------------------------
   142 //
   160 //
   144 //
   162 //
   145 void UT_CMusEngLiveSession::Teardown()
   163 void UT_CMusEngLiveSession::Teardown()
   146     {
   164     {
   147     delete iLiveSession;
   165     delete iLiveSession;
   148     delete iRecordedLiveSession;
   166     delete iRecordedLiveSession;
   149     delete iLcSessionObserver;
   167     delete iObserver;
   150     delete iLcUiProvider;
   168     
   151     delete iAudioRoutingObserver;
       
   152     PropertyHelper::Close();
       
   153     // Delete static data from CenRep stub
   169     // Delete static data from CenRep stub
   154     CRepository::iStaticWriteAvcKeysToStaticData = EFalse;
   170     CRepository::iStaticWriteAvcKeysToStaticData = EFalse;
   155     CRepository::DeleteStubAvcConfigKeys();
   171     CRepository::DeleteStubAvcConfigKeys();
   156     CRepository::ResetStubGlobal();
       
   157     CRepository::iForceFailWithCode = KErrNone;
   172     CRepository::iForceFailWithCode = KErrNone;
   158     }
   173     }
   159 
   174 
   160 
   175 
   161 
   176 
   162 // TEST CASES
   177 // TEST CASES
   163 
   178 
       
   179 
   164 // -----------------------------------------------------------------------------
   180 // -----------------------------------------------------------------------------
   165 //
   181 //
   166 // -----------------------------------------------------------------------------
   182 // -----------------------------------------------------------------------------
   167 //
   183 //
   168 void UT_CMusEngLiveSession::UT_NewLL()
   184 void UT_CMusEngLiveSession::UT_NewLL()
   169     {
   185     {
   170     EUNIT_ASSERT( iLiveSession )
   186     EUNIT_ASSERT( iLiveSession );
   171     EUNIT_ASSERT( iRecordedLiveSession )
   187     EUNIT_ASSERT( iLiveSession->iRecordedFile == KNullDesC() );     
   172     EUNIT_ASSERT( iLiveSession->iCameraHandler.iCameraUsage == MusSettingsKeys::EUseCameraSwapping );     
   188     EUNIT_ASSERT( iRecordedLiveSession ); 
   173     EUNIT_ASSERT( iLiveSession->iMceManagerUid == TUid::Uid( KMusUiUid ) );
   189     EUNIT_ASSERT( iRecordedLiveSession->iRecordedFile == KTestVideoFileName() );
   174 
   190     }
   175     delete iLiveSession;
   191 
   176     iLiveSession = NULL;
   192 
   177     CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage,
   193 // -----------------------------------------------------------------------------
   178                                 MusSettingsKeys::EUseOnlySecondaryCamera );
   194 //
   179 
   195 // -----------------------------------------------------------------------------
   180     iLiveSession = CMusEngLiveSession::NewL();
   196 //
   181     
   197 void UT_CMusEngLiveSession::UT_CurrentZoomLL()
   182     EUNIT_ASSERT_EQUALS( TInt( iLiveSession->iCameraHandler.iCameraUsage ),
   198     {
   183                          TInt( MusSettingsKeys::EUseOnlySecondaryCamera ) );     
   199     // Check that checking current zoom is not possible before invite
   184     
   200     TRAPD( error, iLiveSession->CurrentZoomL() );
   185     delete iLiveSession;
   201     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
   186     iLiveSession = NULL;
   202     EUNIT_ASSERT( error == KErrNotReady );
   187     CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage,
   203     
   188                                 MusSettingsKeys::EUseOnlyMainCamera );
   204     // simulate session establishment
   189 
   205     ESTABLISH_OUT_SESSION( iLiveSession );
   190     iLiveSession = CMusEngLiveSession::NewL();   
   206 
   191     
   207     CMceCameraSource* camera = 
   192     EUNIT_ASSERT_EQUALS( TInt( iLiveSession->iCameraHandler.iCameraUsage ),
   208                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
   193                          TInt( MusSettingsKeys::EUseOnlyMainCamera ) );
   209     
   194     }
   210     // Check that originally current and default zoom are the same
       
   211     EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == 
       
   212                   iLiveSession->CurrentZoomL() );
       
   213     
       
   214     // Zoom to maximum optical value
       
   215     while ( camera->iZoomFactor < iLiveSession->iCameraInfo.iMaxZoom )
       
   216         {
       
   217         iLiveSession->ZoomInL();
       
   218         }
       
   219     
       
   220     EUNIT_ASSERT( iLiveSession->iCameraInfo.iMaxZoom == 
       
   221                   iLiveSession->CurrentZoomL() );    
       
   222 
       
   223     // Zoom using digital zoom
       
   224     
       
   225     iLiveSession->ZoomInL();
       
   226     
       
   227     EUNIT_ASSERT( iLiveSession->CurrentZoomL() == 
       
   228                     iLiveSession->iCameraInfo.iMaxZoom + 
       
   229                     camera->iDigitalZoomFactor )
       
   230                   
       
   231     }
       
   232 
       
   233 
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 // -----------------------------------------------------------------------------
       
   237 //
       
   238 void UT_CMusEngLiveSession::UT_CMusEngLiveSession_SetZoomLL()
       
   239     {
       
   240     TRAPD( error, iLiveSession->SetZoomL(2) );
       
   241     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   242     EUNIT_ASSERT( error == KErrNotReady );
       
   243     ESTABLISH_OUT_SESSION( iLiveSession );
       
   244     CMceCameraSource* camera = 
       
   245                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   246     EUNIT_ASSERT( camera->iZoomFactor == 1 );
       
   247     EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 );
       
   248     TRAPD( err, iLiveSession->SetZoomL(0) );
       
   249     EUNIT_ASSERT( err == KErrArgument );
       
   250     iLiveSession->SetZoomL(2);
       
   251     EUNIT_ASSERT( camera->iZoomFactor == 2 );
       
   252     TRAPD( err1, iLiveSession->SetZoomL(14) );
       
   253     EUNIT_ASSERT( err1 == KErrArgument );
       
   254     iLiveSession->SetZoomL( 5 );
       
   255     EUNIT_ASSERT( camera->iDigitalZoomFactor == 2 );
       
   256     }
       
   257 void UT_CMusEngLiveSession::UT_MaxZoomLL()
       
   258     {
       
   259     // Check that checking maximum zoom is not possible before invite
       
   260     TRAPD( error, iLiveSession->MaxZoomL() );
       
   261     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   262     EUNIT_ASSERT( error == KErrNotReady );
       
   263 
       
   264     // simulate session establishment
       
   265     ESTABLISH_OUT_SESSION( iLiveSession );
       
   266     
       
   267     EUNIT_ASSERT( iLiveSession->MaxZoomL() == 
       
   268                     iLiveSession->iCameraInfo.iMaxZoom + 
       
   269                     iLiveSession->iCameraInfo.iMaxDigitalZoom );
       
   270     }
       
   271 
       
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 //
       
   275 // -----------------------------------------------------------------------------
       
   276 //
       
   277 void UT_CMusEngLiveSession::UT_ZoomInLL()
       
   278     {    
       
   279     // Check that zooming is not possible before invite
       
   280     TRAPD( error, iLiveSession->ZoomInL() );
       
   281     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   282     EUNIT_ASSERT( error == KErrNotReady );
       
   283     
       
   284     // simulate session establishment
       
   285     ESTABLISH_OUT_SESSION( iLiveSession );
       
   286     
       
   287     CMceCameraSource* camera = 
       
   288                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   289     
       
   290     // Check the default value
       
   291     EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor );
       
   292 
       
   293     // Check that zoom factor can be increased
       
   294     USER_SLEEP;  //insure that small step is used
       
   295     iLiveSession->ZoomInL();
       
   296     EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iDefaultZoomFactor +
       
   297             iLiveSession->iSmallZoomStep );
       
   298     
       
   299    //Check the "burst" mode (immediate second ZoomIn), big step should be used
       
   300     TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor;
       
   301     iLiveSession->ZoomInL();
       
   302     TInt nStep = camera->iZoomFactor + camera->iDigitalZoomFactor - nZoom;
       
   303     EUNIT_ASSERT( nStep == iLiveSession->iBigZoomStep );
       
   304 
       
   305     // Zoom to maximum optical value
       
   306     while ( camera->iZoomFactor < iLiveSession->iCameraInfo.iMaxZoom )
       
   307         {
       
   308         iLiveSession->ZoomInL();
       
   309         }
       
   310         
       
   311     TInt maxOpticalZoomFactor = camera->ZoomFactorL();
       
   312     
       
   313     // Check that digital zoom is used instead of optical
       
   314     iLiveSession->ZoomInL();
       
   315     EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor );
       
   316     EUNIT_ASSERT( camera->iDigitalZoomFactor > 0 );
       
   317     
       
   318     // Zoom to maximum digital value
       
   319     while ( camera->iDigitalZoomFactor < 
       
   320             iLiveSession->iCameraInfo.iMaxDigitalZoom )
       
   321         {
       
   322         iLiveSession->ZoomInL();
       
   323         }
       
   324     
       
   325     TInt maxDigitalZoomFactor = camera->DigitalZoomFactorL();
       
   326     
       
   327     // Check that further zooming is impossible
       
   328     iLiveSession->ZoomInL();
       
   329     EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor );
       
   330     EUNIT_ASSERT( camera->iDigitalZoomFactor == maxDigitalZoomFactor );
       
   331     
       
   332     }
       
   333 
       
   334 
       
   335 // -----------------------------------------------------------------------------
       
   336 //
       
   337 // -----------------------------------------------------------------------------
       
   338 //
       
   339 void UT_CMusEngLiveSession::UT_ZoomOutLL()
       
   340     {
       
   341     // Check that zooming is not possible before invite
       
   342     TRAPD( error, iLiveSession->ZoomOutL() );
       
   343     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   344     EUNIT_ASSERT( error == KErrNotReady );
       
   345     
       
   346     // simulate session establishment
       
   347     ESTABLISH_OUT_SESSION( iLiveSession );
       
   348     
       
   349     CMceCameraSource* camera = 
       
   350                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   351     
       
   352     // Check the default value
       
   353     EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor );
       
   354     
       
   355     // Simulate maximum zoom 
       
   356     camera->iZoomFactor = iLiveSession->iCameraInfo.iMaxZoom;
       
   357     camera->iDigitalZoomFactor = iLiveSession->iCameraInfo.iMaxDigitalZoom;
       
   358     
       
   359     // Check that digital zoom factor can be decreased
       
   360     USER_SLEEP;  //insure that small step is used
       
   361     iLiveSession->ZoomOutL();
       
   362     EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iCameraInfo.iMaxZoom );
       
   363     EUNIT_ASSERT( camera->iDigitalZoomFactor == 
       
   364                     iLiveSession->iCameraInfo.iMaxDigitalZoom - 
       
   365                     iLiveSession->iSmallZoomStep );
       
   366     
       
   367     //Check the "burst" mode (immediate second ZoomOut), big step should be used
       
   368     TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor;
       
   369     iLiveSession->ZoomOutL();
       
   370     TInt nStep;
       
   371     nStep = nZoom - (camera->iZoomFactor + camera->iDigitalZoomFactor );
       
   372     EUNIT_ASSERT( nStep == iLiveSession->iBigZoomStep );
       
   373  
       
   374     // Simulate maximum zoom again
       
   375     camera->iZoomFactor = iLiveSession->iCameraInfo.iMaxZoom;
       
   376     camera->iDigitalZoomFactor = iLiveSession->iCameraInfo.iMaxDigitalZoom;
       
   377     
       
   378     // Zoom to minimum digital zoom
       
   379     while ( camera->iDigitalZoomFactor > 0 )
       
   380         {
       
   381         iLiveSession->ZoomOutL();
       
   382         }
       
   383     
       
   384     EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iCameraInfo.iMaxZoom );
       
   385     EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 );
       
   386     
       
   387     // Check that optical zoom is decreased instead of digital
       
   388     USER_SLEEP;  //insure that step is the small one
       
   389     iLiveSession->ZoomOutL();
       
   390     EUNIT_ASSERT( camera->iZoomFactor == 
       
   391                     iLiveSession->iCameraInfo.iMaxZoom -
       
   392                     iLiveSession->iSmallZoomStep );
       
   393     EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 );
       
   394     
       
   395     // Zoom to minimum optical zoom
       
   396     while ( camera->iZoomFactor > iLiveSession->iCameraInfo.iMinZoom )
       
   397         {
       
   398         iLiveSession->ZoomOutL();
       
   399         }
       
   400     
       
   401     // Check that further zooming is impossible
       
   402     iLiveSession->ZoomOutL();
       
   403     EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iCameraInfo.iMinZoom );
       
   404     EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 );
       
   405     }
       
   406 
       
   407 
       
   408 // -----------------------------------------------------------------------------
       
   409 //
       
   410 // -----------------------------------------------------------------------------
       
   411 //
       
   412 void UT_CMusEngLiveSession::UT_ZoomDefaultLL()
       
   413     {
       
   414     // Check that zooming is not possible before invite
       
   415     TRAPD( error, iLiveSession->ZoomDefaultL() );
       
   416     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   417     EUNIT_ASSERT( error == KErrNotReady );
       
   418     
       
   419     // simulate session establishment
       
   420     ESTABLISH_OUT_SESSION( iLiveSession );
       
   421     
       
   422     CMceCameraSource* camera = 
       
   423                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   424     
       
   425     // Check the default value
       
   426     EUNIT_ASSERT( iLiveSession->iDefaultZoomFactor == camera->iZoomFactor );
       
   427     
       
   428     // increase zoom factor so much that optical zoom is in maximum value
       
   429     // and digital zoom is in use
       
   430     while ( camera->iDigitalZoomFactor == 0 )
       
   431         {
       
   432         iLiveSession->ZoomInL();
       
   433         }
       
   434     EUNIT_ASSERT( camera->iZoomFactor > iLiveSession->iDefaultZoomFactor );
       
   435     EUNIT_ASSERT( camera->iDigitalZoomFactor > 0 );
       
   436     
       
   437     // back to default
       
   438     iLiveSession->ZoomDefaultL();
       
   439     EUNIT_ASSERT( camera->iZoomFactor == iLiveSession->iDefaultZoomFactor  );
       
   440     EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 );
       
   441     }
       
   442 
       
   443 
       
   444 // -----------------------------------------------------------------------------
       
   445 //
       
   446 // -----------------------------------------------------------------------------
       
   447 //
       
   448 void UT_CMusEngLiveSession::UT_SetBrightnessLL()
       
   449     {
       
   450     // Check that setting brightness is not possible before invite
       
   451     EUNIT_ASSERT_SPECIFIC_LEAVE( 
       
   452                         iLiveSession->SetBrightnessL( KTestSomeBrightness ),
       
   453                         KErrNotReady )
       
   454     
       
   455     // simulate session establishment
       
   456     ESTABLISH_OUT_SESSION( iLiveSession );
       
   457 
       
   458     CMceCameraSource* camera = 
       
   459                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   460    
       
   461     camera->iCameraInfo.iOptionsSupported =
       
   462     camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported;
       
   463 
       
   464     // Check that originally current and default brightness are the same
       
   465     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness,
       
   466                          iLiveSession->CurrentBrightnessL() )
       
   467 
       
   468     // Test setting brightness
       
   469     iLiveSession->SetBrightnessL( KTestSomeBrightness );
       
   470 
       
   471     EUNIT_ASSERT_EQUALS( KTestSomeBrightness,
       
   472                          iLiveSession->CurrentBrightnessL() )
       
   473     }
       
   474 
       
   475 
       
   476 
       
   477 // -----------------------------------------------------------------------------
       
   478 //
       
   479 // -----------------------------------------------------------------------------
       
   480 //
       
   481 void UT_CMusEngLiveSession::UT_CurrentBrightnessLL()
       
   482     {
       
   483     // Check that checking current brightness is not possible before invite
       
   484     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->CurrentBrightnessL(),
       
   485                                  KErrNotReady )
       
   486     
       
   487     // All the other stuff checked in tests of SetBrightnessL
       
   488     }
       
   489 
       
   490 // -----------------------------------------------------------------------------
       
   491 //
       
   492 // -----------------------------------------------------------------------------
       
   493 //
       
   494 void UT_CMusEngLiveSession::UT_MaxBrightnessLL()
       
   495     {
       
   496     // MaxBrightness should return a constant
       
   497 
       
   498     EUNIT_ASSERT_EQUALS( KTestMaxBrightness, iLiveSession->MaxBrightnessL() )
       
   499     }
       
   500 
       
   501 // -----------------------------------------------------------------------------
       
   502 //
       
   503 // -----------------------------------------------------------------------------
       
   504 //
       
   505 void UT_CMusEngLiveSession::UT_MinBrightnessLL()
       
   506     {
       
   507     // MinBrightness should return a constant
       
   508 
       
   509     EUNIT_ASSERT_EQUALS( KTestMinBrightness, iLiveSession->MinBrightnessL() )
       
   510     }
       
   511 
       
   512 // -----------------------------------------------------------------------------
       
   513 //
       
   514 // -----------------------------------------------------------------------------
       
   515 //
       
   516 void UT_CMusEngLiveSession::UT_IncreaseBrightnessLL()
       
   517     {
       
   518     // Check that increasing brightness is not possible before invite
       
   519     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IncreaseBrightnessL(),
       
   520                                  KErrNotReady )
       
   521 
       
   522     // simulate session establishment
       
   523     ESTABLISH_OUT_SESSION( iLiveSession );
       
   524 
       
   525     CMceCameraSource* camera = 
       
   526                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   527 
       
   528     camera->iCameraInfo.iOptionsSupported =
       
   529     camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported;
       
   530     
       
   531     // Check that originally current and default brightness are the same
       
   532     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness,
       
   533                          iLiveSession->CurrentBrightnessL() )
       
   534 
       
   535     // Check that brightness can be increased...
       
   536     iLiveSession->IncreaseBrightnessL();
       
   537 
       
   538     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness + KTestBrightnessStepSize,
       
   539                          iLiveSession->CurrentBrightnessL() )
       
   540                          
       
   541     // ... but only to maximum
       
   542     
       
   543     iLiveSession->SetBrightnessL( KTestMaxBrightness );
       
   544     
       
   545     iLiveSession->IncreaseBrightnessL();
       
   546     
       
   547     EUNIT_ASSERT_EQUALS( KTestMaxBrightness,
       
   548                          iLiveSession->CurrentBrightnessL() )
       
   549     }
       
   550 
       
   551 // -----------------------------------------------------------------------------
       
   552 //
       
   553 // -----------------------------------------------------------------------------
       
   554 //
       
   555 void UT_CMusEngLiveSession::UT_DecreaseBrightnessLL()
       
   556     {
       
   557     // Check that decreasing brightness is not possible before invite
       
   558     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->DecreaseBrightnessL(),
       
   559                                  KErrNotReady )
       
   560 
       
   561     // simulate session establishment
       
   562     ESTABLISH_OUT_SESSION( iLiveSession );
       
   563 
       
   564     CMceCameraSource* camera = 
       
   565                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   566 
       
   567     camera->iCameraInfo.iOptionsSupported =
       
   568     camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported;
       
   569     
       
   570     // Check that originally current and default brightness are the same
       
   571     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness,
       
   572                          iLiveSession->CurrentBrightnessL() )
       
   573 
       
   574     // Check that brightness can be decreased...
       
   575     iLiveSession->DecreaseBrightnessL();
       
   576 
       
   577     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness - KTestBrightnessStepSize,
       
   578                          iLiveSession->CurrentBrightnessL() )
       
   579     
       
   580     // ... but only to minimum
       
   581     
       
   582     iLiveSession->SetBrightnessL( KTestMinBrightness );
       
   583     
       
   584     iLiveSession->DecreaseBrightnessL();
       
   585     
       
   586     EUNIT_ASSERT_EQUALS( KTestMinBrightness,
       
   587                          iLiveSession->CurrentBrightnessL() )
       
   588 	}
       
   589 
       
   590 // -----------------------------------------------------------------------------
       
   591 //
       
   592 // -----------------------------------------------------------------------------
       
   593 //
       
   594 void UT_CMusEngLiveSession::UT_BrightnessDefaultLL()
       
   595     {
       
   596     // Check that setting default brightness is not possible before invite
       
   597     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->BrightnessDefaultL(),
       
   598                                  KErrNotReady )
       
   599 
       
   600     // simulate session establishment
       
   601     ESTABLISH_OUT_SESSION( iLiveSession );
       
   602 
       
   603     CMceCameraSource* camera = 
       
   604                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   605 
       
   606     camera->iCameraInfo.iOptionsSupported =
       
   607     camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported;
       
   608     
       
   609     // Check that originally current and default brightness are the same
       
   610     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness,
       
   611                          iLiveSession->CurrentBrightnessL() )
       
   612 
       
   613     // set brightness to max
       
   614     iLiveSession->SetBrightnessL( KTestMaxBrightness );
       
   615     EUNIT_ASSERT_NOT_EQUALS( iLiveSession->iDefaultBrightness,
       
   616                              iLiveSession->CurrentBrightnessL() )
       
   617     
       
   618     // set brightness to default and check it
       
   619     iLiveSession->BrightnessDefaultL();
       
   620 
       
   621     EUNIT_ASSERT_EQUALS( iLiveSession->iDefaultBrightness,
       
   622                          iLiveSession->CurrentBrightnessL() )
       
   623     }
       
   624 
       
   625 // -----------------------------------------------------------------------------
       
   626 //
       
   627 // -----------------------------------------------------------------------------
       
   628 //
       
   629 void UT_CMusEngLiveSession::UT_BrightnessAutoLL()
       
   630     {
       
   631     // Check that setting brightness to auto is not possible before invite
       
   632     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->BrightnessAutoL(),
       
   633                                  KErrNotReady );
       
   634 
       
   635     // simulate session establishment
       
   636     ESTABLISH_OUT_SESSION( iLiveSession );
       
   637 
       
   638     CMceCameraSource* camera = 
       
   639                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   640 
       
   641     camera->iCameraInfo.iOptionsSupported =
       
   642     camera->iCameraInfo.iOptionsSupported | TCameraInfo::EBrightnessSupported;
       
   643     
       
   644     // Check that originally brightness is not auto
       
   645     EUNIT_ASSERT_NOT_EQUALS( CCamera::EBrightnessAuto, 
       
   646                              iLiveSession->CurrentBrightnessL() )
       
   647 
       
   648     // check that brightness is set to auto
       
   649     iLiveSession->BrightnessAutoL();
       
   650     EUNIT_ASSERT_EQUALS( CCamera::EBrightnessAuto,
       
   651                          iLiveSession->CurrentBrightnessL() )
       
   652     }
       
   653 
       
   654 
       
   655 // -----------------------------------------------------------------------------
       
   656 //
       
   657 // -----------------------------------------------------------------------------
       
   658 //
       
   659 void UT_CMusEngLiveSession::UT_RecordL_and_IsRecordingLL()
       
   660     {
       
   661     // Check that recording is not possible before invite
       
   662     EUNIT_ASSERT_SPECIFIC_LEAVE( iRecordedLiveSession->RecordL( ETrue ),
       
   663                                  KErrNotReady )
       
   664     
       
   665     // simulate session establishment
       
   666     ESTABLISH_OUT_SESSION( iLiveSession );
       
   667     ESTABLISH_OUT_SESSION( iRecordedLiveSession );
       
   668     
       
   669     // Check that recording is off by default
       
   670     EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() );
       
   671     
       
   672     // Check that recording can be set on
       
   673     iRecordedLiveSession->RecordL( ETrue );
       
   674     EUNIT_ASSERT( iRecordedLiveSession->IsRecording() );
       
   675     
       
   676     // Check that recording  cannot be set on if recording stream does not exist
       
   677      EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->RecordL( ETrue ),
       
   678                                   KErrNotReady )
       
   679     
       
   680     // Check that setting on the recording twice does not harm
       
   681     iRecordedLiveSession->RecordL( ETrue );
       
   682     EUNIT_ASSERT( iRecordedLiveSession->IsRecording() );
       
   683     
       
   684     // Check that recording can be set off again
       
   685     iRecordedLiveSession->RecordL( EFalse );
       
   686     EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() );
       
   687     
       
   688     // Check that setting off the recording twice does not harm
       
   689     iRecordedLiveSession->RecordL( EFalse );
       
   690     EUNIT_ASSERT( !iRecordedLiveSession->IsRecording() );
       
   691     }
       
   692     
       
   693 
       
   694 // -----------------------------------------------------------------------------
       
   695 //
       
   696 // -----------------------------------------------------------------------------
       
   697 //    
       
   698 void UT_CMusEngLiveSession::UT_PlayLL()
       
   699     {
       
   700     // Check that resuming is not possible before invite
       
   701     TRAPD( error, iLiveSession->PlayL() );
       
   702     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   703     EUNIT_ASSERT( error == KErrNotReady );
       
   704     
       
   705     ESTABLISH_OUT_SESSION( iLiveSession );
       
   706 
       
   707     iLiveSession->PauseL();
       
   708     
       
   709     CMceCameraSource* camera = 
       
   710                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   711      
       
   712     iLiveSession->PlayL();
       
   713 
       
   714     EUNIT_ASSERT( camera->IsEnabled() );
       
   715  
       
   716     // Try to enable camera again, request should be ignored
       
   717     
       
   718     iLiveSession->PlayL();
       
   719 
       
   720     EUNIT_ASSERT( camera->IsEnabled() );
       
   721  
       
   722     }
       
   723     
       
   724 
       
   725 // -----------------------------------------------------------------------------
       
   726 //
       
   727 // -----------------------------------------------------------------------------
       
   728 //    
       
   729 void UT_CMusEngLiveSession::UT_PauseLL()
       
   730     {
       
   731     // Check that pausing is not possible before invite
       
   732     TRAPD( error, iLiveSession->PauseL() );
       
   733     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
       
   734     EUNIT_ASSERT( error == KErrNotReady );
       
   735     
       
   736     ESTABLISH_OUT_SESSION( iLiveSession );
       
   737     
       
   738     iLiveSession->PlayL();
       
   739     
       
   740     CMceCameraSource* camera = 
       
   741                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
   742                     
       
   743     iLiveSession->PauseL();
       
   744 
       
   745     EUNIT_ASSERT( !camera->IsEnabled() );
       
   746     
       
   747     // Try to disable camera again, request should be ignored
       
   748     
       
   749     iLiveSession->PauseL();
       
   750 
       
   751     EUNIT_ASSERT( !camera->IsEnabled() );
       
   752     
       
   753     }
       
   754 
       
   755 
       
   756 // -----------------------------------------------------------------------------
       
   757 //
       
   758 // -----------------------------------------------------------------------------
       
   759 //    
       
   760 void UT_CMusEngLiveSession::UT_IsPlayingLL()
       
   761     {
       
   762     // Try without a session 
       
   763     EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IsPlayingL(), KErrNotReady );
       
   764     
       
   765     // Normal cases
       
   766     ESTABLISH_OUT_SESSION( iLiveSession );
       
   767     
       
   768     iLiveSession->PlayL();
       
   769     EUNIT_ASSERT( iLiveSession->IsPlayingL() )
       
   770     
       
   771     iLiveSession->PauseL();
       
   772     EUNIT_ASSERT( !iLiveSession->IsPlayingL() )
       
   773     }
       
   774 
   195 
   775 
   196 // -----------------------------------------------------------------------------
   776 // -----------------------------------------------------------------------------
   197 //
   777 //
   198 // -----------------------------------------------------------------------------
   778 // -----------------------------------------------------------------------------
   199 //
   779 //
   200 void UT_CMusEngLiveSession::UT_CompleteSessionStructureLL()
   780 void UT_CMusEngLiveSession::UT_CompleteSessionStructureLL()
   201     {
   781     {
       
   782     
   202     CMceStreamBundle* localBundle = 
   783     CMceStreamBundle* localBundle = 
   203         CMceStreamBundle::NewLC( CMceStreamBundle::ELS );
   784                             CMceStreamBundle::NewLC( CMceStreamBundle::ELS );
   204     
   785     
   205     // Check that structure cannot be completed before creating the session
   786     // Check that structure cannot be completed before creating the session
   206     TRAPD( error, iLiveSession->CompleteSessionStructureL( *localBundle ) );
   787     TRAPD( error, iLiveSession->CompleteSessionStructureL( *localBundle ) );
   207     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
   788     MUS_TEST_FORWARD_ALLOC_FAILURE( error );
   208     EUNIT_ASSERT( error == KErrNotReady );
   789     EUNIT_ASSERT( error == KErrNotReady );
   223     EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() == 1 );
   804     EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() == 1 );
   224     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo );
   805     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo );
   225     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source() );
   806     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source() );
   226     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source()->Type() ==
   807     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source()->Type() ==
   227                   KMceCameraSource );
   808                   KMceCameraSource );
       
   809     EUNIT_ASSERT( !iLiveSession->IsPlayingL() )
   228     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks().Count() == 1 );
   810     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks().Count() == 1 );
   229     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks()[0]->Type() ==
   811     EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks()[0]->Type() ==
   230                   KMceRTPSink );
   812                   KMceRTPSink );
   231     
   813     
   232     // Test that also recording stream is constructed if needed
   814     // Test that also recording stream is constructed if needed
   260             }
   842             }
   261         }
   843         }
   262         
   844         
   263     EUNIT_ASSERT( file )
   845     EUNIT_ASSERT( file )
   264     
   846     
   265   
   847     CleanupStack::PopAndDestroy( localBundle );
   266 
   848                                    
   267     EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera ==
   849     }
   268                         TMusEngCameraHandler::EBackCamera );
   850 
   269     
   851 
   270     delete iLiveSession->iSession; 
   852 // -----------------------------------------------------------------------------
   271     iLiveSession->iSession = NULL; 
   853 //
   272     
   854 // -----------------------------------------------------------------------------
   273     iLiveSession->iSession = CMceOutSession::NewL( 
   855 //
   274                                     *(iLiveSession->iManager),
   856 void UT_CMusEngLiveSession::UT_HandleSessionStateChangedL()
   275                                     *profile,
   857     {
   276                                     KTestRecipientSipUri8() );
   858     // Make Repository empty, config keys must be written
   277     
   859     CRepository::SetStubAvcConfigKeysL( KNullDesC8() );
   278     iLiveSession->iCameraHandler.iCameraUsage = MusSettingsKeys::EUseOnlySecondaryCamera;     
   860     
   279     iLiveSession->CompleteSessionStructureL( *localBundle );
   861     // Invite    
   280     
   862     iLiveSession->InviteL( KTestRecipientSipUri );
   281     EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera ==
   863     iLiveSession->iSession->iState = CMceSession::EEstablished;
   282                         TMusEngCameraHandler::EFrontCamera );
   864     
   283     
   865     // Force failure on CenRep
   284     
   866     CRepository::iForceFailWithCode = KErrNoMemory;
   285     CleanupStack::PopAndDestroy( localBundle );                                 
   867     
   286     }
   868     // Simulate session state transition notification
       
   869     iLiveSession->HandleSessionStateChanged( 
       
   870                         *iLiveSession->iSession,
       
   871                         200, KNullDesC8() );
       
   872 
       
   873     EUNIT_ASSERT( iObserver->iSessionFailedCalled );
       
   874     
       
   875     // Normal case, something will be written to CenRep
       
   876     iRecordedLiveSession->InviteL( KTestRecipientSipUri );
       
   877     iRecordedLiveSession->iSession->iState = CMceSession::EEstablished;
       
   878     iRecordedLiveSession->HandleSessionStateChanged( 
       
   879                         *iRecordedLiveSession->iSession,
       
   880                         200, KNullDesC8() );
       
   881     
       
   882     HBufC8* info = MultimediaSharingSettings::EncoderConfigInfoLC();
       
   883     EUNIT_ASSERT_NOT_EQUALS( *info, KMusAvcBitrateLevel_1b_ConfigKey() )
       
   884     CleanupStack::PopAndDestroy( info );
       
   885     }
       
   886     
   287 
   887 
   288 // -----------------------------------------------------------------------------
   888 // -----------------------------------------------------------------------------
   289 //
   889 //
   290 // -----------------------------------------------------------------------------
   890 // -----------------------------------------------------------------------------
   291 //
   891 //
   296     CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() );    
   896     CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() );    
   297     CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() );
   897     CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() );
   298     CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() );
   898     CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() );
   299     CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() );
   899     CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() );
   300         
   900         
   301     iLiveSession->AdjustVideoCodecL( *codecH263, KMceCameraSource );
   901     iLiveSession->AdjustVideoCodecL( *codecH263 );
   302     iLiveSession->AdjustVideoCodecL( *codecH2632000, KMceCameraSource );    
   902     iLiveSession->AdjustVideoCodecL( *codecH2632000 );    
   303     iLiveSession->AdjustVideoCodecL( *codecAvc, KMceCameraSource );  
   903     iLiveSession->AdjustVideoCodecL( *codecAvc );  
   304     iLiveSession->AdjustVideoCodecL( *codecUnknown, KMceCameraSource );
   904     iLiveSession->AdjustVideoCodecL( *codecUnknown );
   305 
   905 
   306     // Test that bit rates has been set to H263 & AVC codecs
   906     // Test that bit rates has been set to H263 & AVC codecs
   307     EUNIT_ASSERT( codecH263->iAllowedBitrates == KMceAllowedH263BitrateAll )
   907     EUNIT_ASSERT( codecH263->iAllowedBitrates == KMceAllowedH263BitrateAll )
   308     EUNIT_ASSERT( codecH263->iMaxBitRate == KMceH263Level45Bitrate )
   908     EUNIT_ASSERT( codecH263->iMaxBitRate == KMceH263Level45Bitrate )
   309     EUNIT_ASSERT( codecH263->iBitrate == 80000 )
   909     EUNIT_ASSERT( codecH263->iBitrate == 80000 )
   334     
   934     
   335     CleanupStack::PopAndDestroy( codecUnknown );
   935     CleanupStack::PopAndDestroy( codecUnknown );
   336     CleanupStack::PopAndDestroy( codecAvc );
   936     CleanupStack::PopAndDestroy( codecAvc );
   337     CleanupStack::PopAndDestroy( codecH2632000 );
   937     CleanupStack::PopAndDestroy( codecH2632000 );
   338     CleanupStack::PopAndDestroy( codecH263 );
   938     CleanupStack::PopAndDestroy( codecH263 );
   339     }
   939     
       
   940     }
       
   941 
   340 
   942 
   341 // -----------------------------------------------------------------------------
   943 // -----------------------------------------------------------------------------
   342 //
   944 //
   343 // -----------------------------------------------------------------------------
   945 // -----------------------------------------------------------------------------
   344 //
   946 //
   353     
   955     
   354     EUNIT_ASSERT( codec->iPayloadType == 97 )
   956     EUNIT_ASSERT( codec->iPayloadType == 97 )
   355     
   957     
   356     CleanupStack::PopAndDestroy( codec );
   958     CleanupStack::PopAndDestroy( codec );
   357     }
   959     }
       
   960 
   358 
   961 
   359 // -----------------------------------------------------------------------------
   962 // -----------------------------------------------------------------------------
   360 //
   963 //
   361 // -----------------------------------------------------------------------------
   964 // -----------------------------------------------------------------------------
   362 //
   965 //
   379     // No assumptions so all the codecs are left to stream 
   982     // No assumptions so all the codecs are left to stream 
   380     iLiveSession->DoCodecSelectionL( *stream );    
   983     iLiveSession->DoCodecSelectionL( *stream );    
   381     EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 3 )
   984     EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 3 )
   382     
   985     
   383     // Check that AVC codecs are removed if they are known to be not supported
   986     // Check that AVC codecs are removed if they are known to be not supported
   384     delete iLiveSession->iVideoCodecList;
   987     iLiveSession->SetSupportedVideoCodecListL( _L( "SomethingThatIsNotAVC" ) );
   385     iLiveSession->iVideoCodecList = NULL;
       
   386     iLiveSession->iVideoCodecList = _L8("SomethingThatIsNotAVC").AllocL();
       
   387     iLiveSession->DoCodecSelectionL( *stream );
   988     iLiveSession->DoCodecSelectionL( *stream );
   388     EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 2 )
   989     EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 2 )
   389     EUNIT_ASSERT( stream->Codecs()[0]->SdpName() != KMceSDPNameH264() )
   990     EUNIT_ASSERT( stream->Codecs()[0]->SdpName() != KMceSDPNameH264() )
   390     EUNIT_ASSERT( stream->Codecs()[1]->SdpName() != KMceSDPNameH264() )
   991     EUNIT_ASSERT( stream->Codecs()[1]->SdpName() != KMceSDPNameH264() )
   391     
   992     
   392     CleanupStack::PopAndDestroy( stream );
   993     CleanupStack::PopAndDestroy( stream );
   393     }
   994     
       
   995     }
       
   996     
   394 
   997 
   395 // -----------------------------------------------------------------------------
   998 // -----------------------------------------------------------------------------
   396 // Although all states are not meaningfull for LiveSession, all states are
   999 // Although all states are not meaningfull for LiveSession, all states are
   397 // tested in order to force the updating of unit tests when behavior is changed 
  1000 // tested in order to force the updating of unit tests when behavior is changed 
   398 // -----------------------------------------------------------------------------
  1001 // -----------------------------------------------------------------------------
   404     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1007     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   405                                                             *videoStream );
  1008                                                             *videoStream );
   406     CleanupStack::PopAndDestroy( videoStream );
  1009     CleanupStack::PopAndDestroy( videoStream );
   407     
  1010     
   408     // Simulate sending invite
  1011     // Simulate sending invite
   409     iLiveSession->EstablishLcSessionL();
  1012     iLiveSession->InviteL( KTestRecipientSipUri() );
   410     
  1013     
   411     // Try all the stream states
  1014     // Try all the stream states
   412     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
  1015     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
   413     
  1016     
   414     // EUninitialized, stream is created, unexpected change, nothing happens
  1017     // EUninitialized, stream is created, unexpected change, nothing happens
   415     changedStream->iState = CMceMediaStream::EUninitialized;
  1018     changedStream->iState = CMceMediaStream::EUninitialized;
   416     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1019     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   417                                                             *changedStream );
  1020                                                             *changedStream );
   418     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1021     EUNIT_ASSERT( iObserver->IsReseted() );
   419     
  1022     
   420     // EInitialized, stream is initialized
  1023     // EInitialized, stream is initialized
   421     changedStream->iState = CMceMediaStream::EInitialized;
  1024     changedStream->iState = CMceMediaStream::EInitialized;
   422     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1025     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   423                                                             *changedStream );
  1026                                                             *changedStream );
   424     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1027     EUNIT_ASSERT( iObserver->IsReseted() );
   425     
  1028     
   426     // EBuffering, stream is buffering
  1029     // EBuffering, stream is buffering
   427     changedStream->iState = CMceMediaStream::EBuffering;
  1030     changedStream->iState = CMceMediaStream::EBuffering;
   428     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1031     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   429                                                             *changedStream );
  1032                                                             *changedStream );
   430     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1033     EUNIT_ASSERT( iObserver->IsReseted() );
   431     
  1034     
   432     // EIdle, stream is not receiving RTP
  1035     // EIdle, stream is not receiving RTP
   433     changedStream->iState = CMceMediaStream::EIdle;
  1036     changedStream->iState = CMceMediaStream::EIdle;
   434     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1037     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   435                                                             *changedStream );
  1038                                                             *changedStream );
   436     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1039     EUNIT_ASSERT( iObserver->iStreamIdleCalled );
   437     
  1040     
   438     // EStreaming, stream is streaming
  1041     // EStreaming, stream is streaming
   439     changedStream->iState = CMceMediaStream::EStreaming;
  1042     changedStream->iState = CMceMediaStream::EStreaming;
   440     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( *changedStream );
  1043     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   441     EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ),
  1044                                                             *changedStream );
   442                          TInt( CLcSessionObserverStub::EPlayerStateChanged ) )
  1045     EUNIT_ASSERT( iObserver->iStreamStreamingCalled );
   443     iLcSessionObserver->Reset();
  1046     iObserver->Reset();
   444     
  1047     
   445     // EDisabled, stream is explicitly disabled
  1048     // EDisabled, stream is explicitly disabled
   446     changedStream->iState = CMceMediaStream::EDisabled;
  1049     changedStream->iState = CMceMediaStream::EDisabled;
   447     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1050     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   448                                                             *changedStream );
  1051                                                             *changedStream );
   449     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1052     EUNIT_ASSERT( iObserver->IsReseted() );
   450     
  1053     
   451     // ENoResources, stream has no needed resources to stream
  1054     // ENoResources, stream has no needed resources to stream
   452     changedStream->iState = CMceMediaStream::ENoResources;
  1055     changedStream->iState = CMceMediaStream::ENoResources;
   453     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1056     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   454                                                             *changedStream );
  1057                                                             *changedStream );
   455     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1058     EUNIT_ASSERT( iObserver->IsReseted() );
   456     
  1059     
   457     // ETranscodingRequired, stream requires non-realtime transcoding
  1060     // ETranscodingRequired, stream requires non-realtime transcoding
   458     changedStream->iState = CMceMediaStream::ETranscodingRequired;
  1061     changedStream->iState = CMceMediaStream::ETranscodingRequired;
   459     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1062     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   460                                                             *changedStream );
  1063                                                             *changedStream );
   461     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1064     EUNIT_ASSERT( iObserver->IsReseted() );
   462     
  1065     
   463     // ETranscoding, stream is transcoding in non-realtime
  1066     // ETranscoding, stream is transcoding in non-realtime
   464     changedStream->iState = CMceMediaStream::ETranscoding;
  1067     changedStream->iState = CMceMediaStream::ETranscoding;
   465     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1068     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   466                                                             *changedStream );
  1069                                                             *changedStream );
   467     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1070     EUNIT_ASSERT( iObserver->IsReseted() );
   468     }
  1071     }
       
  1072 
   469 
  1073 
   470 // -----------------------------------------------------------------------------
  1074 // -----------------------------------------------------------------------------
   471 // Although all states are not meaningfull for LiveSession, all states are
  1075 // Although all states are not meaningfull for LiveSession, all states are
   472 // tested in order to force the updating of unit tests when behavior is changed 
  1076 // tested in order to force the updating of unit tests when behavior is changed 
   473 // -----------------------------------------------------------------------------
  1077 // -----------------------------------------------------------------------------
   481                     *CMceCameraSource::NewLC( *iLiveSession->iManager ) );
  1085                     *CMceCameraSource::NewLC( *iLiveSession->iManager ) );
   482     CleanupStack::PopAndDestroy(); // camera
  1086     CleanupStack::PopAndDestroy(); // camera
   483     CleanupStack::PopAndDestroy( videoStream );
  1087     CleanupStack::PopAndDestroy( videoStream );
   484     
  1088     
   485     // Simulate sending invite
  1089     // Simulate sending invite
   486     iLiveSession->EstablishLcSessionL();
  1090     iLiveSession->InviteL( KTestRecipientSipUri() );
   487     
  1091     
   488     // Try all the stream states
  1092     // Try all the stream states
   489     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
  1093     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
   490     CMceMediaSource* changedSource = changedStream->Source();
  1094     CMceMediaSource* changedSource = changedStream->Source();
   491     
  1095     
   492     // EUninitialized, stream is created, unexpected change, nothing happens
  1096     // EUninitialized, stream is created, unexpected change, nothing happens
   493     changedStream->iState = CMceMediaStream::EUninitialized;
  1097     changedStream->iState = CMceMediaStream::EUninitialized;
   494     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1098     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   495                             *changedStream, *changedSource );
  1099                             *changedStream, *changedSource );
   496     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1100     EUNIT_ASSERT( iObserver->IsReseted() );
   497     
  1101     
   498     // EInitialized, stream is initialized
  1102     // EInitialized, stream is initialized
   499     changedStream->iState = CMceMediaStream::EInitialized;
  1103     changedStream->iState = CMceMediaStream::EInitialized;
   500     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1104     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   501                             *changedStream, *changedSource );;
  1105                             *changedStream, *changedSource );;
   502     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1106     EUNIT_ASSERT( iObserver->IsReseted() );
   503     
  1107     
   504     // EBuffering, stream is buffering
  1108     // EBuffering, stream is buffering
   505     changedStream->iState = CMceMediaStream::EBuffering;
  1109     changedStream->iState = CMceMediaStream::EBuffering;
   506     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1110     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   507                             *changedStream, *changedSource );
  1111                             *changedStream, *changedSource );
   508     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1112     EUNIT_ASSERT( iObserver->IsReseted() );
   509     
  1113     
   510     // EIdle, stream is not receiving RTP
  1114     // EIdle, stream is not receiving RTP
   511     changedStream->iState = CMceMediaStream::EIdle;
  1115     changedStream->iState = CMceMediaStream::EIdle;
   512     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1116     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   513                             *changedStream, *changedSource );
  1117                             *changedStream, *changedSource );
   514     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1118     EUNIT_ASSERT( iObserver->iStreamIdleCalled );
   515     
  1119     
   516     // EStreaming, stream is streaming
  1120     // EStreaming, stream is streaming
   517     changedStream->iState = CMceMediaStream::EStreaming;
  1121     changedStream->iState = CMceMediaStream::EStreaming;
   518     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1122     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   519                             *changedStream, *changedSource );
  1123                             *changedStream, *changedSource );
   520     EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ),
  1124     EUNIT_ASSERT( iObserver->iStreamStreamingCalled );
   521                          TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) 
  1125     iObserver->Reset();
   522     iLcSessionObserver->Reset();
       
   523     
  1126     
   524     // EDisabled, stream is explicitly disabled
  1127     // EDisabled, stream is explicitly disabled
   525     changedStream->iState = CMceMediaStream::EDisabled;
  1128     changedStream->iState = CMceMediaStream::EDisabled;
   526     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1129     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   527                             *changedStream, *changedSource );
  1130                             *changedStream, *changedSource );
   528     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1131     EUNIT_ASSERT( iObserver->IsReseted() );
   529     
  1132     
   530     // ENoResources, stream has no needed resources to stream
  1133     // ENoResources, stream has no needed resources to stream
   531     changedStream->iState = CMceMediaStream::ENoResources;
  1134     changedStream->iState = CMceMediaStream::ENoResources;
   532     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1135     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   533                             *changedStream, *changedSource );
  1136                             *changedStream, *changedSource );
   534     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1137     EUNIT_ASSERT( iObserver->IsReseted() );
   535     
  1138     
   536     // ETranscodingRequired, stream requires non-realtime transcoding
  1139     // ETranscodingRequired, stream requires non-realtime transcoding
   537     changedStream->iState = CMceMediaStream::ETranscodingRequired;
  1140     changedStream->iState = CMceMediaStream::ETranscodingRequired;
   538     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1141     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   539                             *changedStream, *changedSource );
  1142                             *changedStream, *changedSource );
   540     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1143     EUNIT_ASSERT( iObserver->IsReseted() );
   541     
  1144     
   542     // ETranscoding, stream is transcoding in non-realtime
  1145     // ETranscoding, stream is transcoding in non-realtime
   543     changedStream->iState = CMceMediaStream::ETranscoding;
  1146     changedStream->iState = CMceMediaStream::ETranscoding;
   544     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
  1147     static_cast<MMceStreamObserver*>(iLiveSession)->StreamStateChanged( 
   545                             *changedStream, *changedSource );
  1148                             *changedStream, *changedSource );
   546     EUNIT_ASSERT( iLcSessionObserver->IsReseted() );
  1149     EUNIT_ASSERT( iObserver->IsReseted() );
   547     }
  1150     }
   548     
  1151     
       
  1152 
   549 // -----------------------------------------------------------------------------
  1153 // -----------------------------------------------------------------------------
   550 // Although all states are not meaningfull for LiveSession, all states are
  1154 // Although all states are not meaningfull for LiveSession, all states are
   551 // tested in order to force the updating of unit tests when behavior is changed 
  1155 // tested in order to force the updating of unit tests when behavior is changed 
   552 // -----------------------------------------------------------------------------
  1156 // -----------------------------------------------------------------------------
   553 //
  1157 //
   561                 *iLiveSession->iSession->Streams()[0]->Sinks()[0] );
  1165                 *iLiveSession->iSession->Streams()[0]->Sinks()[0] );
   562     
  1166     
   563     // Try with session
  1167     // Try with session
   564     
  1168     
   565     ESTABLISH_OUT_SESSION( iRecordedLiveSession )
  1169     ESTABLISH_OUT_SESSION( iRecordedLiveSession )
   566     MLcDestinationFileControl* destinationFileControl =
  1170     iRecordedLiveSession->RecordL( ETrue );
   567         iRecordedLiveSession->LocalVideoPlayer()->LcDestinationFileControl();
       
   568     destinationFileControl->LcRecordL( ETrue );
       
   569     
  1171     
   570     // Test state CMceMediaStream::ENoResources
  1172     // Test state CMceMediaStream::ENoResources
   571                     
  1173                     
   572     // Try without recording stream, nothing happens
  1174     // Try without recording stream, nothing happens
   573     
  1175     
   574     iLiveSession->StreamStateChanged(
  1176     iLiveSession->StreamStateChanged(
   575                 *iLiveSession->iSession->Streams()[0],
  1177                 *iLiveSession->iSession->Streams()[0],
   576                 *iLiveSession->iSession->Streams()[0]->Sinks()[0] );
  1178                 *iLiveSession->iSession->Streams()[0]->Sinks()[0] );
   577     EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ),
  1179     EUNIT_ASSERT( iObserver->iStreamStreamingCalled )
   578                          TInt( CLcSessionObserverStub::EPlayerStateChanged ) )
  1180     iObserver->Reset();
   579     iLcSessionObserver->Reset();
       
   580 
  1181 
   581     // Try again with recording stream, but indicate change in another stream,
  1182     // Try again with recording stream, but indicate change in another stream,
   582     // nothing happens    
  1183     // nothing happens    
   583     iRecordedLiveSession->StreamStateChanged(
  1184     iRecordedLiveSession->StreamStateChanged(
   584                 *iLiveSession->iSession->Streams()[0],
  1185                 *iLiveSession->iSession->Streams()[0],
   609     recordingStream->Sinks()[0]->iIsEnabled = EFalse;
  1210     recordingStream->Sinks()[0]->iIsEnabled = EFalse;
   610     
  1211     
   611     iRecordedLiveSession->StreamStateChanged( *recordingStream,
  1212     iRecordedLiveSession->StreamStateChanged( *recordingStream,
   612                                               *recordingStream->Sinks()[0] );
  1213                                               *recordingStream->Sinks()[0] );
   613     
  1214     
   614     EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ),
  1215     EUNIT_ASSERT( iObserver->iDiskFullCalled )
   615                          TInt( CLcSessionObserverStub::ESessionFailed ) )
  1216     iObserver->Reset();
   616     EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError,
       
   617                          TInt( MLcSession::EDiskFull ) )
       
   618     iLcSessionObserver->Reset();
       
   619     
  1217     
   620     
  1218     
   621     // Test default stream state change behavior
  1219     // Test default stream state change behavior
   622     
  1220     
   623     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
  1221     CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0];
   624     CMceMediaSink* changedSink = changedStream->Sinks()[0];
  1222     CMceMediaSink* changedSink = changedStream->Sinks()[0];
   625     
  1223     
   626     // EUninitialized, stream is created, unexpected change, nothing happens
  1224     // EUninitialized, stream is created, unexpected change, nothing happens
   627     changedStream->iState = CMceMediaStream::EUninitialized;
  1225     changedStream->iState = CMceMediaStream::EUninitialized;
   628     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1226     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   629     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1227     EUNIT_ASSERT( iObserver->IsReseted() );
   630     
  1228     
   631     // EInitialized, stream is initialized
  1229     // EInitialized, stream is initialized
   632     changedStream->iState = CMceMediaStream::EInitialized;
  1230     changedStream->iState = CMceMediaStream::EInitialized;
   633     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1231     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   634     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1232     EUNIT_ASSERT( iObserver->IsReseted() );
   635     
  1233     
   636     // EBuffering, stream is buffering
  1234     // EBuffering, stream is buffering
   637     changedStream->iState = CMceMediaStream::EBuffering;
  1235     changedStream->iState = CMceMediaStream::EBuffering;
   638     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1236     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   639     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1237     EUNIT_ASSERT( iObserver->IsReseted() );
   640     
  1238     
   641     // EIdle, stream is not receiving RTP
  1239     // EIdle, stream is not receiving RTP
   642     changedStream->iState = CMceMediaStream::EIdle;
  1240     changedStream->iState = CMceMediaStream::EIdle;
   643     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1241     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   644     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1242     EUNIT_ASSERT( iObserver->iStreamIdleCalled );
   645     
  1243     
   646     // EStreaming, stream is streaming
  1244     // EStreaming, stream is streaming
   647     changedStream->iState = CMceMediaStream::EStreaming;
  1245     changedStream->iState = CMceMediaStream::EStreaming;
   648     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1246     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   649     EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ),
  1247     EUNIT_ASSERT( iObserver->iStreamStreamingCalled );
   650                          TInt( CLcSessionObserverStub::EPlayerStateChanged ) )
  1248     iObserver->Reset();
   651     iLcSessionObserver->Reset();
       
   652     
  1249     
   653     // EDisabled, stream is explicitly disabled
  1250     // EDisabled, stream is explicitly disabled
   654     changedStream->iState = CMceMediaStream::EDisabled;
  1251     changedStream->iState = CMceMediaStream::EDisabled;
   655     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1252     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   656     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1253     EUNIT_ASSERT( iObserver->IsReseted() );
   657     
  1254     
   658     // ENoResources, stream has no needed resources to stream
  1255     // ENoResources, stream has no needed resources to stream
   659     // This state has non-default meaning, tested before defaults
  1256     // This state has non-default meaning, tested before defaults
   660     
  1257     
   661     // ETranscodingRequired, stream requires non-realtime transcoding
  1258     // ETranscodingRequired, stream requires non-realtime transcoding
   662     changedStream->iState = CMceMediaStream::ETranscodingRequired;
  1259     changedStream->iState = CMceMediaStream::ETranscodingRequired;
   663     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1260     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   664     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1261     EUNIT_ASSERT( iObserver->IsReseted() );
   665     
  1262     
   666     // ETranscoding, stream is transcoding in non-realtime
  1263     // ETranscoding, stream is transcoding in non-realtime
   667     changedStream->iState = CMceMediaStream::ETranscoding;
  1264     changedStream->iState = CMceMediaStream::ETranscoding;
   668     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
  1265     iLiveSession->StreamStateChanged( *changedStream, *changedSink );
   669     EUNIT_ASSERT( iLcSessionObserver->IsReseted() )
  1266     EUNIT_ASSERT( iObserver->IsReseted() );
   670     
  1267     
   671     }
  1268     }
   672 
  1269 
   673 
  1270 
   674 // -----------------------------------------------------------------------------
  1271 // -----------------------------------------------------------------------------
   675 //
  1272 //
   676 // -----------------------------------------------------------------------------
  1273 // -----------------------------------------------------------------------------
   677 //
  1274 //
   678 void UT_CMusEngLiveSession::UT_EstablishLcSessionL()
  1275 void UT_CMusEngLiveSession::UT_SetEncodingDeviceLL()
   679     {
  1276     {
   680     iLiveSession->EstablishLcSessionL();
  1277     CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() );
   681     EUNIT_ASSERT_EQUALS( TInt( CMceSession::EOffering ),
  1278     
   682                          TInt( iLiveSession->iSession->iState ) )
  1279     // Generic error in CenRep, leave expected
   683     }
  1280     CRepository::iForceFailWithCode = KErrNotReady;
   684 
  1281     EUNIT_ASSERT_LEAVE( iLiveSession->SetEncodingDeviceL( *codec ) )
   685 // -----------------------------------------------------------------------------
  1282     EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, TUid::Uid( 0 ) )
   686 //
  1283     
   687 // -----------------------------------------------------------------------------
  1284     // No entry in CenRep, default value expected
   688 //
  1285     CRepository::iForceFailWithCode = KErrNotFound;
   689 void UT_CMusEngLiveSession::UT_LocalVideoPlayerL()
  1286     const TUid KDefaultEncodingDevice( TUid::Uid( 0x20001C13 ) );
   690     {
  1287     iLiveSession->SetEncodingDeviceL( *codec );
   691     EUNIT_ASSERT( iLiveSession->LocalVideoPlayer() == 
  1288     EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, 
   692                   iLiveSession->iLiveVideoPlayer )
  1289                          KDefaultEncodingDevice )
   693     }
  1290     
       
  1291     // Entry in CenRep
       
  1292     const TInt KSomeEncodingDevice( 0x20001C15 );
       
  1293     CRepository::iStaticEncoderUid = KSomeEncodingDevice;
       
  1294     iLiveSession->SetEncodingDeviceL( *codec );
       
  1295     EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, 
       
  1296                          TUid::Uid( KSomeEncodingDevice ) )
       
  1297                                              
       
  1298     CleanupStack::PopAndDestroy( codec );
       
  1299     }
       
  1300 
       
  1301 
       
  1302 // -----------------------------------------------------------------------------
       
  1303 //
       
  1304 // -----------------------------------------------------------------------------
       
  1305 //
       
  1306 void UT_CMusEngLiveSession::UT_SetCodecConfigKeyLL()
       
  1307     {
       
  1308     CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() );
       
  1309     codec->SetAllowedBitrates( KMceAvcBitrateLevel1b );
       
  1310 
       
  1311     // Generic error in CenRep, leave expected
       
  1312     CRepository::iForceFailWithCode = KErrNotReady;
       
  1313     EUNIT_ASSERT_LEAVE( iLiveSession->SetCodecConfigKeyL( *codec ) );
       
  1314     EUNIT_ASSERT( !codec->iConfigKey )
       
  1315     EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo )
       
  1316     CRepository::iForceFailWithCode = KErrNone;
       
  1317     
       
  1318     // No entry in CenRep, nothing happens
       
  1319     iLiveSession->SetCodecConfigKeyL( *codec );
       
  1320     EUNIT_ASSERT( !codec->iConfigKey )
       
  1321     EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo )
       
  1322     
       
  1323     // Empty entry in CenRep
       
  1324     CRepository::SetStubAvcConfigKeysL( KNullDesC8() );
       
  1325     iLiveSession->SetCodecConfigKeyL( *codec );
       
  1326     EUNIT_ASSERT( !codec->iConfigKey )
       
  1327     EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo )
       
  1328     iLiveSession->iStoreEncoderConfigInfo = EFalse; // emulate original situation
       
  1329     
       
  1330     // Entry in CenRep
       
  1331     CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel_1b_ConfigKey );
       
  1332     iLiveSession->SetCodecConfigKeyL( *codec );
       
  1333     EUNIT_ASSERT( codec->iConfigKey )
       
  1334     HBufC8* key = codec->ConfigKeyL();
       
  1335     CleanupStack::PushL( key );
       
  1336     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText() )
       
  1337     CleanupStack::PopAndDestroy( key );
       
  1338     EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo )
       
  1339     
       
  1340     CleanupStack::PopAndDestroy( codec );
       
  1341     }
       
  1342 
       
  1343 
       
  1344 // -----------------------------------------------------------------------------
       
  1345 //
       
  1346 // -----------------------------------------------------------------------------
       
  1347 //
       
  1348 void UT_CMusEngLiveSession::UT_ReadCodecConfigKeyLL()
       
  1349     {
       
  1350     HBufC8* key( NULL );
       
  1351     
       
  1352     // Try with H263, leave expected
       
  1353     CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() );  
       
  1354     EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codecH263 ) )
       
  1355     CleanupStack::PopAndDestroy( codecH263 );
       
  1356     
       
  1357     // Try without an entry in CenRep, leave expected
       
  1358     CMceVideoCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() );
       
  1359     codec->SetAllowedBitrates( 0 | KMceAvcBitrateLevel1 );
       
  1360     EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codec ) )
       
  1361 
       
  1362     // Create CenRep entry which does not include wanted bitrate, NULL value
       
  1363     // expected
       
  1364     CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel1bTestText() );
       
  1365     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1366     EUNIT_ASSERT( !key )
       
  1367     
       
  1368     // Create entry with all AVC keys and try with all the values
       
  1369     CRepository::SetStubAvcConfigKeysL( KMusAvcAllLevelsConcatenation() );                           
       
  1370     
       
  1371     // KMceAvcBitrateLevel1
       
  1372     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1373     EUNIT_ASSERT( key );
       
  1374     CleanupStack::PushL( key );
       
  1375     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1TestText );
       
  1376     CleanupStack::PopAndDestroy( key );
       
  1377     
       
  1378     // KMceAvcBitrateLevel1b
       
  1379     codec->SetAllowedBitrates( KMceAvcBitrateLevel1b );
       
  1380     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1381     EUNIT_ASSERT( key );
       
  1382     CleanupStack::PushL( key );
       
  1383     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText );
       
  1384     CleanupStack::PopAndDestroy( key );
       
  1385     
       
  1386     // KMceAvcBitrateLevel1_1
       
  1387     codec->SetAllowedBitrates( KMceAvcBitrateLevel1_1 );
       
  1388     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1389     EUNIT_ASSERT( key );
       
  1390     CleanupStack::PushL( key );
       
  1391     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_1TestText );
       
  1392     CleanupStack::PopAndDestroy( key );
       
  1393     
       
  1394     // KMceAvcBitrateLevel1_2
       
  1395     codec->SetAllowedBitrates( KMceAvcBitrateLevel1_2 );
       
  1396     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1397     EUNIT_ASSERT( key );
       
  1398     CleanupStack::PushL( key );
       
  1399     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_2TestText );
       
  1400     CleanupStack::PopAndDestroy( key );
       
  1401     
       
  1402     // KMceAvcBitrateLevel1_3
       
  1403     codec->SetAllowedBitrates( KMceAvcBitrateLevel1_3 );
       
  1404     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1405     EUNIT_ASSERT( key );
       
  1406     CleanupStack::PushL( key );
       
  1407     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_3TestText );
       
  1408     CleanupStack::PopAndDestroy( key );
       
  1409     
       
  1410     // KMceAvcBitrateLevel2
       
  1411     codec->SetAllowedBitrates( KMceAvcBitrateLevel2 );
       
  1412     key = iLiveSession->ReadCodecConfigKeyL( *codec );
       
  1413     EUNIT_ASSERT( key );
       
  1414     CleanupStack::PushL( key );
       
  1415     EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel2TestText );
       
  1416     CleanupStack::PopAndDestroy( key );
       
  1417    
       
  1418     CleanupStack::PopAndDestroy( codec );
       
  1419 
       
  1420     }
       
  1421 
       
  1422 
       
  1423 // -----------------------------------------------------------------------------
       
  1424 //
       
  1425 // -----------------------------------------------------------------------------
       
  1426 //
       
  1427 void UT_CMusEngLiveSession::UT_StoreEncoderConfigInfoLL()
       
  1428     {
       
  1429     CRepository::iStaticWriteAvcKeysToStaticData = ETrue;
       
  1430     
       
  1431     // Try with clean CenRep
       
  1432     MultimediaSharingSettings::SetEncoderConfigInfoL( KNullDesC8() );   
       
  1433     
       
  1434     ESTABLISH_OUT_SESSION( iLiveSession ) // calls StoreEncoderConfigInfoL
       
  1435     // If StoreEncoderConfigInfoL leaves with KErrNoMemory,
       
  1436     // MMusEngSessionObserver::SessionFailed will be called.
       
  1437     __ASSERT_ALWAYS( !iObserver->iSessionFailedCalled, 
       
  1438                      User::Leave( KErrNoMemory ) );
       
  1439                      
       
  1440     HBufC8* keys = MultimediaSharingSettings::EncoderConfigInfoLC();    
       
  1441     EUNIT_ASSERT_EQUALS( *keys, KMusAvcBitrateLevel_1b_ConfigKey() )
       
  1442     CleanupStack::PopAndDestroy( keys );
       
  1443     
       
  1444     // Try without a clean CenRep 
       
  1445     MultimediaSharingSettings::SetEncoderConfigInfoL(
       
  1446                                         KMusAvcBitrateLevel_1_1_ConfigKey() );   
       
  1447     
       
  1448     ESTABLISH_OUT_SESSION( iRecordedLiveSession )
       
  1449     // If StoreEncoderConfigInfoL leaves with KErrNoMemory,
       
  1450     // MMusEngSessionObserver::SessionFailed will be called.
       
  1451     __ASSERT_ALWAYS( !iObserver->iSessionFailedCalled, 
       
  1452                      User::Leave( KErrNoMemory ) );
       
  1453                      
       
  1454     keys = MultimediaSharingSettings::EncoderConfigInfoLC();
       
  1455     EUNIT_ASSERT_EQUALS( *keys, 
       
  1456                          KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys() )
       
  1457     CleanupStack::PopAndDestroy( keys );
       
  1458     }
       
  1459     
       
  1460 // -----------------------------------------------------------------------------
       
  1461 //
       
  1462 // -----------------------------------------------------------------------------
       
  1463 //
       
  1464 void UT_CMusEngLiveSession::UT_InitializeZoomStepSizeL()
       
  1465     {
       
  1466     //Check that zooming steps have defualt values before session establishment
       
  1467     iLiveSession->InitializeZoomStepSize();
       
  1468     EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize );
       
  1469     EUNIT_ASSERT( iLiveSession->iBigZoomStep == KZoomStepMinSize );
       
  1470     
       
  1471     // simulate session establishment
       
  1472     ESTABLISH_OUT_SESSION( iLiveSession );
       
  1473     
       
  1474     CMceCameraSource* camera = 
       
  1475                         MusEngMceUtils::GetCameraL( *(iLiveSession->iSession) );
       
  1476     
       
  1477     //Check that zooming step sizes have default value KZoomStepMinSize 
       
  1478     //in case of zooming values range is smaller than KZoomBigStepCount
       
  1479     iLiveSession->iCameraInfo.iMinZoom = 0;
       
  1480     iLiveSession->iCameraInfo.iMaxZoom = 0;
       
  1481     iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount / 2;    
       
  1482     iLiveSession->InitializeZoomStepSize();
       
  1483     EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize );
       
  1484     EUNIT_ASSERT( iLiveSession->iBigZoomStep == KZoomStepMinSize );
       
  1485     
       
  1486     
       
  1487     //Check that zooming step sizes have default value KZoomStepMinSize 
       
  1488     //in case of zooming values range is bigger than KZoomBigStepCount,
       
  1489     //but smaller than 2*KZoomBigStepCount (KZoomSmallStepCount)
       
  1490     iLiveSession->iCameraInfo.iMaxDigitalZoom = 2*KZoomBigStepCount - 1;
       
  1491     iLiveSession->InitializeZoomStepSize();
       
  1492     EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize );
       
  1493     EUNIT_ASSERT( iLiveSession->iBigZoomStep == KZoomStepMinSize );
       
  1494 
       
  1495     
       
  1496     //Check zooming steps sizes in case of zooming values range is
       
  1497     //bigger than 2*KZoomBigStepCount and smaller than 2*KZoomSmallStepCount
       
  1498     iLiveSession->iCameraInfo.iMinZoom = - KZoomBigStepCount;
       
  1499     iLiveSession->iCameraInfo.iMaxZoom = KZoomBigStepCount;
       
  1500     iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount;
       
  1501     //zooming range is (-KZoomBigStepCount, 2*KZoomBigStepCount)
       
  1502     iLiveSession->InitializeZoomStepSize();
       
  1503     EUNIT_ASSERT( iLiveSession->iSmallZoomStep == KZoomStepMinSize );
       
  1504     EUNIT_ASSERT( iLiveSession->iBigZoomStep == 3 );
       
  1505 
       
  1506     
       
  1507     //Check zooming steps sizes in case of zooming values range is
       
  1508     //bigger than 2*KZoomSmallStepCount
       
  1509     iLiveSession->iCameraInfo.iMaxZoom = KZoomSmallStepCount;
       
  1510     iLiveSession->iCameraInfo.iMaxDigitalZoom = KZoomSmallStepCount;
       
  1511     iLiveSession->iCameraInfo.iMinZoom = - KZoomSmallStepCount;
       
  1512     //zooming range is (-KZoomSmallStepCount, 2*KZoomSmallStepCount)
       
  1513     iLiveSession->InitializeZoomStepSize();
       
  1514     EUNIT_ASSERT( iLiveSession->iSmallZoomStep == 3 );
       
  1515     EUNIT_ASSERT( iLiveSession->iBigZoomStep == 6 );    
       
  1516     }
       
  1517     
   694 
  1518 
   695 //  TEST TABLE
  1519 //  TEST TABLE
       
  1520 
   696 EUNIT_BEGIN_TEST_TABLE(
  1521 EUNIT_BEGIN_TEST_TABLE(
   697     UT_CMusEngLiveSession,
  1522     UT_CMusEngLiveSession,
   698     "UT_CMusEngLiveSesssion",
  1523     "UT_CMusEngLiveSesssion",
   699     "UNIT" )
  1524     "UNIT" )
   700 
  1525 
   704     "NewL",
  1529     "NewL",
   705     "FUNCTIONALITY",
  1530     "FUNCTIONALITY",
   706     SetupL, UT_NewLL, Teardown)
  1531     SetupL, UT_NewLL, Teardown)
   707 
  1532 
   708 EUNIT_TEST(
  1533 EUNIT_TEST(
       
  1534     "CurrentZoomL - test ",
       
  1535     "CMusEngLiveSession",
       
  1536     "CurrentZoomL",
       
  1537     "FUNCTIONALITY",
       
  1538     SetupL, UT_CurrentZoomLL, Teardown)
       
  1539 
       
  1540 EUNIT_TEST(
       
  1541     "MaxZoomL - test ",
       
  1542     "CMusEngLiveSession",
       
  1543     "MaxZoomL",
       
  1544     "FUNCTIONALITY",
       
  1545     SetupL, UT_MaxZoomLL, Teardown)
       
  1546     
       
  1547 EUNIT_TEST(
       
  1548     "ZoomInL - test ",
       
  1549     "CMusEngLiveSession",
       
  1550     "ZoomInL",
       
  1551     "FUNCTIONALITY",
       
  1552     SetupL, UT_ZoomInLL, Teardown)
       
  1553 
       
  1554 EUNIT_TEST(
       
  1555     "ZoomOutL - test ",
       
  1556     "CMusEngLiveSession",
       
  1557     "ZoomOutL",
       
  1558     "FUNCTIONALITY",
       
  1559     SetupL, UT_ZoomOutLL, Teardown)
       
  1560 
       
  1561 EUNIT_TEST(
       
  1562     "ZoomDefaultL - test ",
       
  1563     "CMusEngLiveSession",
       
  1564     "ZoomDefaultL",
       
  1565     "FUNCTIONALITY",
       
  1566     SetupL, UT_ZoomDefaultLL, Teardown)
       
  1567 
       
  1568 EUNIT_TEST(
       
  1569     "SetBrightnessL - test ",
       
  1570     "CMusEngLiveSession",
       
  1571     "SetBrightnessL",
       
  1572     "FUNCTIONALITY",
       
  1573     SetupL, UT_SetBrightnessLL, Teardown)
       
  1574 
       
  1575 EUNIT_TEST(
       
  1576     "CurrentBrightnessL - test ",
       
  1577     "CMusEngLiveSession",
       
  1578     "CurrentBrightnessL",
       
  1579     "FUNCTIONALITY",
       
  1580     SetupL, UT_CurrentBrightnessLL, Teardown)
       
  1581 
       
  1582 EUNIT_TEST(
       
  1583     "MaxBrightnessL - test ",
       
  1584     "CMusEngLiveSession",
       
  1585     "MaxBrightnessL",
       
  1586     "FUNCTIONALITY",
       
  1587     SetupL, UT_MaxBrightnessLL, Teardown)
       
  1588 
       
  1589 EUNIT_TEST(
       
  1590     "MinBrightnessL - test ",
       
  1591     "CMusEngLiveSession",
       
  1592     "MinBrightnessL",
       
  1593     "FUNCTIONALITY",
       
  1594     SetupL, UT_MinBrightnessLL, Teardown)
       
  1595 
       
  1596 EUNIT_TEST(
       
  1597     "IncreaseBrightnessL - test ",
       
  1598     "CMusEngLiveSession",
       
  1599     "IncreaseBrightnessL",
       
  1600     "FUNCTIONALITY",
       
  1601     SetupL, UT_IncreaseBrightnessLL, Teardown)
       
  1602 
       
  1603 EUNIT_TEST(
       
  1604     "DecreaseBrightnessL - test ",
       
  1605     "CMusEngLiveSession",
       
  1606     "DecreaseBrightnessL",
       
  1607     "FUNCTIONALITY",
       
  1608     SetupL, UT_DecreaseBrightnessLL, Teardown)
       
  1609 
       
  1610 EUNIT_TEST(
       
  1611     "BrightnessDefaultL - test ",
       
  1612     "CMusEngLiveSession",
       
  1613     "BrightnessDefaultL",
       
  1614     "FUNCTIONALITY",
       
  1615     SetupL, UT_BrightnessDefaultLL, Teardown)
       
  1616 
       
  1617 EUNIT_TEST(
       
  1618     "BrightnessAutoL - test ",
       
  1619     "CMusEngLiveSession",
       
  1620     "BrightnessAutoL",
       
  1621     "FUNCTIONALITY",
       
  1622     SetupL, UT_BrightnessAutoLL, Teardown)
       
  1623 
       
  1624 EUNIT_TEST(
       
  1625     "RecordL_and_IsRecordingL - test ",
       
  1626     "CMusEngLiveSession",
       
  1627     "RecordL_and_IsRecordingL",
       
  1628     "FUNCTIONALITY",
       
  1629     SetupL, UT_RecordL_and_IsRecordingLL, Teardown)
       
  1630 
       
  1631 EUNIT_TEST(
       
  1632     "PlayL - test ",
       
  1633     "CMusEngLiveSession",
       
  1634     "PlayL",
       
  1635     "FUNCTIONALITY",
       
  1636     SetupL, UT_PlayLL, Teardown)
       
  1637 
       
  1638 EUNIT_TEST(
       
  1639     "PauseL - test ",
       
  1640     "CMusEngLiveSession",
       
  1641     "PauseL",
       
  1642     "FUNCTIONALITY",
       
  1643     SetupL, UT_PauseLL, Teardown)
       
  1644 
       
  1645 EUNIT_TEST(
       
  1646     "IsPlayingL - test ",
       
  1647     "CMusEngLiveSession",
       
  1648     "IsPlayingL",
       
  1649     "FUNCTIONALITY",
       
  1650     SetupL, UT_IsPlayingLL, Teardown)
       
  1651 
       
  1652 EUNIT_TEST(
   709     "CompleteSessionStructureL - test ",
  1653     "CompleteSessionStructureL - test ",
   710     "CMusEngLiveSession",
  1654     "CMusEngLiveSession",
   711     "CompleteSessionStructureL",
  1655     "CompleteSessionStructureL",
   712     "FUNCTIONALITY",
  1656     "FUNCTIONALITY",
   713     SetupL, UT_CompleteSessionStructureLL, Teardown)
  1657     SetupL, UT_CompleteSessionStructureLL, Teardown)
   714 
  1658 
   715 EUNIT_TEST(
  1659 EUNIT_TEST(
       
  1660     "HandleSessionStateChanged - test ",
       
  1661     "CMusEngLiveSession",
       
  1662     "HandleSessionStateChanged",
       
  1663     "FUNCTIONALITY",
       
  1664     SetupL, UT_HandleSessionStateChangedL, Teardown)
       
  1665 
       
  1666 EUNIT_TEST(
   716     "AdjustVideoCodecL - test ",
  1667     "AdjustVideoCodecL - test ",
   717     "CMusEngLiveSession",
  1668     "CMusEngLiveSession",
   718     "AdjustVideoCodecL",
  1669     "AdjustVideoCodecL",
   719     "FUNCTIONALITY",
  1670     "FUNCTIONALITY",
   720     SetupL, UT_AdjustVideoCodecLL, Teardown)
  1671     SetupL, UT_AdjustVideoCodecLL, Teardown)
   750 EUNIT_TEST(
  1701 EUNIT_TEST(
   751     "StreamStateChangedL( sink ) - test ",
  1702     "StreamStateChangedL( sink ) - test ",
   752     "CMusEngLiveSession",
  1703     "CMusEngLiveSession",
   753     "StreamStateChangedL( sink )",
  1704     "StreamStateChangedL( sink )",
   754     "FUNCTIONALITY",
  1705     "FUNCTIONALITY",
   755     SetupL, UT_StreamStateChangedWithSinkL, Teardown) 
  1706     SetupL, UT_StreamStateChangedWithSinkL, Teardown)
   756 
  1707 
   757 EUNIT_TEST(
  1708 EUNIT_TEST(
   758     "EstablishLcSessionL - test ",
  1709     "SetEncodingDeviceL - test ",
   759     "CMusEngLiveSession",
  1710     "CMusEngLiveSession",
   760     "EstablishLcSessionL",
  1711     "SetEncodingDeviceL",
   761     "FUNCTIONALITY",
  1712     "FUNCTIONALITY",
   762     SetupL, UT_EstablishLcSessionL, Teardown)
  1713     SetupL, UT_SetEncodingDeviceLL, Teardown)   
   763     
  1714 
   764 EUNIT_TEST(
  1715 EUNIT_TEST(
   765     "LocalVideoPlayer - test ",
  1716     "SetCodecConfigKeyL - test ",
   766     "CMusEngLiveSession",
  1717     "CMusEngLiveSession",
   767     "LocalVideoPlayer",
  1718     "SetCodecConfigKeyL",
   768     "FUNCTIONALITY",
  1719     "FUNCTIONALITY",
   769     SetupL, UT_LocalVideoPlayerL, Teardown)
  1720     SetupL, UT_SetCodecConfigKeyLL, Teardown)    
   770     
  1721 
       
  1722 EUNIT_TEST(
       
  1723     "ReadCodecConfigKeyL - test ",
       
  1724     "CMusEngLiveSession",
       
  1725     "ReadCodecConfigKeyL",
       
  1726     "FUNCTIONALITY",
       
  1727     SetupL, UT_ReadCodecConfigKeyLL, Teardown)        
       
  1728 
       
  1729 EUNIT_TEST(
       
  1730     "StoreEncoderConfigInfoL - test ",
       
  1731     "CMusEngLiveSession",
       
  1732     "StoreEncoderConfigInfoL",
       
  1733     "FUNCTIONALITY",
       
  1734     SetupL, UT_StoreEncoderConfigInfoLL, Teardown)      
       
  1735     
       
  1736 EUNIT_TEST(
       
  1737     "InitializeZoomStepSize - test ",
       
  1738     "CMusEngLiveSession",
       
  1739     "InitializeZoomStepSize",
       
  1740     "FUNCTIONALITY",
       
  1741     SetupL, UT_InitializeZoomStepSizeL, Teardown)      
       
  1742 
       
  1743       
   771 EUNIT_END_TEST_TABLE
  1744 EUNIT_END_TEST_TABLE
   772 
  1745 
   773 //  END OF FILE
  1746 //  END OF FILE
   774 
  1747 
   775 
  1748