camerasrv_plat/media_recorder_api/tsrc/src/camcTest_5.cpp
changeset 0 9b3e960ffc8a
child 42 605672cc2a86
equal deleted inserted replaced
-1:000000000000 0:9b3e960ffc8a
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Camcorder MMF API Test DLL
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "camcTest_5.h"
       
    22 #include "camcTest.h"
       
    23 #include <bldvariant.hrh>
       
    24 
       
    25 
       
    26 // EXTERNAL DATA STRUCTURES
       
    27 
       
    28 // EXTERNAL FUNCTION PROTOTYPES 
       
    29  
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // LOCAL CONSTANTS AND MACROS
       
    35 
       
    36 // MODULE DATA STRUCTURES
       
    37 
       
    38 // LOCAL FUNCTION PROTOTYPES
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 
       
    42 
       
    43 CCamcTest_5::CCamcTest_5 ()
       
    44     {
       
    45     }
       
    46 
       
    47 CCamcTest_5::~CCamcTest_5 ()
       
    48     {
       
    49     delete iCamcTestClient;
       
    50     iCamcTestClient = NULL;
       
    51     }
       
    52 
       
    53 
       
    54 void CCamcTest_5::setUpL ()
       
    55     {
       
    56     iCamcTestClient = CCamcTestClient_5::NewL( );
       
    57     
       
    58     iWaitScheduler = new (ELeave) CActiveSchedulerWait;	
       
    59 
       
    60     // Create a new Camera API implementation object, if supported
       
    61     TRAPD( err, iUiLevelCamera = CCamera::New2L( static_cast<MCameraObserver2&>(*this), 0 /*index*/, 0 /*Priority*/ ) );
       
    62     if ( err )
       
    63         {
       
    64         PRINT( ( _L( "CCamcTest_5::setUpL CCamera::New2L return code=%d" ), err ) ); 
       
    65         // Create old Camera API implementation object.
       
    66         iUiLevelCamera = CCamera::NewL( static_cast<MCameraObserver&>(*this), 0 /*Index*/ );
       
    67         }
       
    68     else 
       
    69        {
       
    70        PRINT( ( _L( "CCamcTest_5::setUp() using new MCameraObserver2" )) ); 
       
    71        }
       
    72 
       
    73 	iUiLevelCameraHandle = iUiLevelCamera->Handle();
       
    74 	iUiLevelCamera->Reserve();
       
    75 	iWaitScheduler->Start();    
       
    76     }
       
    77 
       
    78 
       
    79 void CCamcTest_5::tearDown ()
       
    80     {
       
    81     delete iCamcTestClient;
       
    82     iCamcTestClient = NULL;
       
    83     delete iWaitScheduler;
       
    84     delete iUiLevelCamera;        
       
    85 	REComSession::FinalClose();
       
    86     }
       
    87 
       
    88 
       
    89 //
       
    90 // Own test functions.
       
    91 //
       
    92 
       
    93 // //////////////////////////////////////////////////////////////////
       
    94 //                       Memory Failure tests
       
    95 // //////////////////////////////////////////////////////////////////
       
    96 
       
    97 /******************************/
       
    98 /*NUMBER OF META DATA ENTRIES */
       
    99 /******************************/
       
   100 
       
   101 void CCamcTest_5::NumberOfMetaDataEntriesL_001_L()
       
   102     {
       
   103     ///////////////////////////////////////
       
   104 	//   ID: CAMC_API.NUMBEROFMETADATAENTRIESL_001
       
   105     //   Action :
       
   106     //       Call NumberOfMetaDataEntriesL() when not recording
       
   107     //   Output : 
       
   108     //       Function should retrun 0.
       
   109     //   Precondition :
       
   110     //       Not recording
       
   111     ///////////////////////////////////////
       
   112 
       
   113         iCamcTestClient->Start_Active_ObjectL(K_Tc5_NumberOfMetaDataEntriesWhenNotRecording, iUiLevelCameraHandle);
       
   114     }
       
   115 
       
   116 void CCamcTest_5::NumberOfMetaDataEntriesL_002_L()
       
   117     {
       
   118     ///////////////////////////////////////
       
   119 	//   ID: CAMC_API.NUMBEROFMETADATAENTRIESL_002
       
   120     //   Action :
       
   121     //       Call NumberOfMetaDataEntriesL() when recording
       
   122     //   Output : 
       
   123     //       Function should retrun 0.
       
   124     //   Precondition :
       
   125     //       Recording
       
   126     ///////////////////////////////////////
       
   127 
       
   128         iCamcTestClient->Start_Active_ObjectL(K_Tc5_NumberOfMetaDataEntriesWhenRecording, iUiLevelCameraHandle);
       
   129     }
       
   130 
       
   131 /*******************************/
       
   132 /*      META DATA ENTRY        */
       
   133 /*******************************/
       
   134 
       
   135 void CCamcTest_5::MetaDataEntryL_001_L()
       
   136     {
       
   137     ///////////////////////////////////////
       
   138     //   ID: CAMC_API.METADATAENTRYL_001
       
   139     //   Action :
       
   140     //        Call MetaDataEntryL() when not recording
       
   141     //   Output : 
       
   142     //        Leave with KErrNotSupported
       
   143     ///////////////////////////////////////    
       
   144     
       
   145     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_MetaDataEntryWhenNotRecording, iUiLevelCameraHandle));
       
   146     assertTIntsEqualL( KErrNotSupported, err );
       
   147     }
       
   148 
       
   149 void CCamcTest_5::MetaDataEntryL_002_L()
       
   150     {
       
   151     ///////////////////////////////////////
       
   152     //   ID: CAMC_API.METADATAENTRYL_002
       
   153     //   Action :
       
   154     //        Call MetaDataEntryL() when recording
       
   155     //   Output : 
       
   156     //        Leave with KErrNotSupported
       
   157     ///////////////////////////////////////    
       
   158     
       
   159     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_MetaDataEntryWhenRecording, iUiLevelCameraHandle));
       
   160     assertTIntsEqualL( KErrNotSupported, err );
       
   161     }
       
   162 
       
   163 /*******************************/
       
   164 /*    ADD META DATA ENTRY      */
       
   165 /*******************************/
       
   166 
       
   167 void CCamcTest_5::AddMetaDataEntryL_001_L()
       
   168     {
       
   169     ///////////////////////////////////////
       
   170     //   ID: CAMC_API.ADDMETADATAENTRYL_001
       
   171     //   Action :
       
   172     //        Call AddMetaDataEntryL() when not recording
       
   173     //   Output : 
       
   174     //        Leave with KErrArgument
       
   175     ///////////////////////////////////////    
       
   176     
       
   177     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_AddMetaDataEntryWhenNotRecording, iUiLevelCameraHandle));
       
   178     assertTIntsEqualL( KErrNotSupported, err );
       
   179     }
       
   180 
       
   181 void CCamcTest_5::AddMetaDataEntryL_002_L()
       
   182     {
       
   183     ///////////////////////////////////////
       
   184     //   ID: CAMC_API.ADDMETADATAENTRYL_002
       
   185     //   Action :
       
   186     //        Call AddMetaDataEntryL() when recording
       
   187     //   Output : 
       
   188     //        Leave with KErrArgument
       
   189     ///////////////////////////////////////    
       
   190     
       
   191     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_AddMetaDataEntryWhenRecording, iUiLevelCameraHandle));
       
   192     assertTIntsEqualL( KErrNotSupported, err );
       
   193     }
       
   194 
       
   195 /********************************/
       
   196 /*    REMOVE META DATA ENTRY    */
       
   197 /********************************/
       
   198 
       
   199 void CCamcTest_5::RemoveMetaDataEntryL_001_L()
       
   200     {
       
   201     ///////////////////////////////////////
       
   202     //   ID: CAMC_API.REMOVEMETADATAENTRYL_001
       
   203     //   Action :
       
   204     //        Call RemoveMetaDataEntryL() when not recording
       
   205     //   Output : 
       
   206     //        Leave with KErrArgument
       
   207     ///////////////////////////////////////    
       
   208     
       
   209     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_RemoveMetaDataEntryWhenNotRecording, iUiLevelCameraHandle));
       
   210     assertTIntsEqualL( KErrArgument, err );
       
   211     }
       
   212 
       
   213 void CCamcTest_5::RemoveMetaDataEntryL_002_L()
       
   214     {
       
   215     ///////////////////////////////////////
       
   216     //   ID: CAMC_API.REMOVEMETADATAENTRYL_002
       
   217     //   Action :
       
   218     //        Call RemoveMetaDataEntryL() when recording
       
   219     //   Output : 
       
   220     //        Leave with KErrArgument
       
   221     ///////////////////////////////////////    
       
   222     
       
   223     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_RemoveMetaDataEntryWhenRecording, iUiLevelCameraHandle));
       
   224     assertTIntsEqualL( KErrArgument, err );
       
   225     }
       
   226 
       
   227 /*********************************/
       
   228 /*    REPLACE META DATA ENTRY    */
       
   229 /*********************************/
       
   230 
       
   231 void CCamcTest_5::ReplaceMetaDataEntryL_001_L()
       
   232     {
       
   233     ///////////////////////////////////////
       
   234     //   ID: CAMC_API.REPLACEMETADATAENTRYL_001
       
   235     //   Action :
       
   236     //        Call ReplaceMetaDataEntryL() when not recording
       
   237     //   Output : 
       
   238     //        Leave with KErrArgument
       
   239     ///////////////////////////////////////    
       
   240     
       
   241     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_ReplaceMetaDataEntryWhenNotRecording, iUiLevelCameraHandle));
       
   242     assertTIntsEqualL( KErrArgument, err );
       
   243     }
       
   244 
       
   245 void CCamcTest_5::ReplaceMetaDataEntryL_002_L()
       
   246     {
       
   247     ///////////////////////////////////////
       
   248     //   ID: CAMC_API.REPLACEMETADATAENTRYL_002
       
   249     //   Action :
       
   250     //        Call ReplaceMetaDataEntryL() when recording
       
   251     //   Output : 
       
   252     //        Leave with KErrArgument
       
   253     ///////////////////////////////////////    
       
   254     
       
   255     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_ReplaceMetaDataEntryWhenRecording, iUiLevelCameraHandle));
       
   256     assertTIntsEqualL( KErrArgument, err );
       
   257     }
       
   258 
       
   259 /**********************************/
       
   260 /*        SET PRIORITY            */
       
   261 /**********************************/
       
   262 
       
   263 void CCamcTest_5::SetPriorityL_005_L()
       
   264     {
       
   265     ///////////////////////////////////////
       
   266     //   ID: CAMC_API.SETPRIORITYL_005
       
   267     //   Action :
       
   268     //        Set wrong SetPriorityL() 
       
   269     //   Output : 
       
   270     //        Leave with KErrArgument
       
   271     ///////////////////////////////////////    
       
   272     
       
   273     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetPriorityWhenNotRecording, iUiLevelCameraHandle));
       
   274     assertTIntsEqualL( KErrArgument, err );
       
   275     }
       
   276 
       
   277 /**********************************/
       
   278 /*         GET PRIORITY           */
       
   279 /**********************************/
       
   280 
       
   281 void CCamcTest_5::GetPriorityL_001_L()
       
   282     {
       
   283     ///////////////////////////////////////
       
   284 	//   ID: CAMC_API.GETPRIORITYL_001
       
   285     //   Action :
       
   286     //       Call GetPriorityL() when not set
       
   287     //   Output : 
       
   288     //       
       
   289     //   Precondition :
       
   290     //       Not set
       
   291     ///////////////////////////////////////
       
   292 
       
   293         iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetPriorityWhenNotSet, iUiLevelCameraHandle);
       
   294     }
       
   295 
       
   296 /**********************************/
       
   297 /*         SET VIDEO FRAME RATE   */
       
   298 /**********************************/
       
   299 
       
   300 void CCamcTest_5::SetVideoFrameRateL_005_L()
       
   301     {
       
   302     ///////////////////////////////////////
       
   303     //   ID: CAMC_API.SETVIDEOFRAMERATEL_005
       
   304     //   Action :
       
   305     //        Set wrong SetVideoFrameRateL()
       
   306     //   Output : 
       
   307     //        Leave with KErrArgument
       
   308     ///////////////////////////////////////    
       
   309     
       
   310     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetVideoFrameRateWhenOpenNotPrepared, iUiLevelCameraHandle));
       
   311     assertTIntsEqualL( KErrArgument, err );
       
   312     }
       
   313 
       
   314 /**********************************/
       
   315 /*         VIDEO FRAME RATE       */
       
   316 /**********************************/
       
   317 
       
   318 void CCamcTest_5::VideoFrameRateL_001_L()
       
   319     {
       
   320     ///////////////////////////////////////
       
   321 	//   ID: CAMC_API.VIDEOFRAMERATEL_001
       
   322     //   Action :
       
   323     //       Call VideoFrameRateL() when not set
       
   324     //   Output : 
       
   325     //       Function should retrun 0.
       
   326     //   Precondition :
       
   327     //       
       
   328     ///////////////////////////////////////
       
   329 
       
   330         iCamcTestClient->Start_Active_ObjectL(K_Tc5_VideoFrameRateWhenNotSet, iUiLevelCameraHandle);
       
   331     }
       
   332 
       
   333 /**********************************/
       
   334 /*        SET VIDEO BIT RATE      */
       
   335 /**********************************/
       
   336 
       
   337 void CCamcTest_5::SetVideoBitRateL_005_L()
       
   338     {
       
   339     ///////////////////////////////////////
       
   340     //   ID: CAMC_API.SETVIDEOBITRATEL_005
       
   341     //   Action :
       
   342     //        Set wrong SetVideoBitRateL()
       
   343     //   Output : 
       
   344     //        Leave with KErrArgument
       
   345     ///////////////////////////////////////    
       
   346     
       
   347     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetVideoBitRateWhenOpenNotPrepared, iUiLevelCameraHandle));
       
   348     assertTIntsEqualL( KErrArgument, err );
       
   349     }
       
   350 
       
   351 /**********************************/
       
   352 /*         VIDEO BIT RATE         */
       
   353 /**********************************/
       
   354 
       
   355 void CCamcTest_5::VideoBitRateL_001_L()
       
   356     {
       
   357     ///////////////////////////////////////
       
   358 	//   ID: CAMC_API.VIDEOBITRATEL_001
       
   359     //   Action :
       
   360     //       Call VideoBitRateL() when not set
       
   361     //   Output : 
       
   362     //       Function should retrun 0.
       
   363     //   Precondition :
       
   364     //       
       
   365     ///////////////////////////////////////
       
   366 
       
   367 
       
   368         iCamcTestClient->Start_Active_ObjectL(K_Tc5_VideoBitRateWhenNotSet, iUiLevelCameraHandle);
       
   369 
       
   370     }
       
   371 
       
   372 /**********************************/
       
   373 /*        SET AUDIO BIT RATE      */
       
   374 /**********************************/
       
   375 
       
   376 void CCamcTest_5::SetAudioBitRateL_005_L()
       
   377     {
       
   378     ///////////////////////////////////////
       
   379     //   ID: CAMC_API.SETAUDIOBITRATEL_005
       
   380     //   Action :
       
   381     //        Set wrong SetAudioBitRateL()
       
   382     //   Output : 
       
   383     //        Leave with KErrArgument
       
   384     ///////////////////////////////////////    
       
   385     
       
   386     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetAudioBitRateWhenOpenNotPrepared, iUiLevelCameraHandle));
       
   387     assertTIntsEqualL( KErrArgument, err );
       
   388     }
       
   389 
       
   390 /**********************************/
       
   391 /*        AUDIO BIT RATE          */
       
   392 /**********************************/
       
   393 
       
   394 void CCamcTest_5::AudioBitRateL_001_L()
       
   395     {
       
   396     ///////////////////////////////////////
       
   397 	//   ID: CAMC_API.AUDIOBITRATEL_001
       
   398     //   Action :
       
   399     //       Call AudioBitRateL() when not set
       
   400     //   Output : 
       
   401     //       Function should retrun 0.
       
   402     //   Precondition :
       
   403     //       
       
   404     ///////////////////////////////////////
       
   405 
       
   406         iCamcTestClient->Start_Active_ObjectL(K_Tc5_AudioBitRateWhenNotSet, iUiLevelCameraHandle);
       
   407     }
       
   408 
       
   409 /**********************************/
       
   410 /*        SET AUDIO ENABLED       */
       
   411 /**********************************/
       
   412 
       
   413 void CCamcTest_5::SetAudioEnabledL_005_L()
       
   414     {
       
   415     ///////////////////////////////////////
       
   416     //   ID: CAMC_API.SETAUDIOENABLEDL_005
       
   417     //   Action :
       
   418     //        SetAudioEnabledL when controller is open, but not prepared.
       
   419     //   Output : 
       
   420     //        OK
       
   421     //////////////////////////////////////   
       
   422     
       
   423     iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetAudioEnabledWhenOpenNotPrepared, iUiLevelCameraHandle);
       
   424     }
       
   425 
       
   426 /**********************************/
       
   427 /*        AUDIO ENABLED           */
       
   428 /**********************************/
       
   429 
       
   430 void CCamcTest_5::AudioEnabledL_001_L()
       
   431     {
       
   432     ///////////////////////////////////////
       
   433     //   ID: CAMC_API.AUDIOENABLEDL_001
       
   434     //   Action :
       
   435     //        AudioEnabledL when not set
       
   436     //   Output : 
       
   437     //        
       
   438     //////////////////////////////////////   
       
   439     
       
   440     iCamcTestClient->Start_Active_ObjectL(K_Tc5_AudioEnabledWhenNotSet, iUiLevelCameraHandle);
       
   441     }
       
   442 
       
   443 /**********************************/
       
   444 /*        SET VIDEO FRAME SIZE    */
       
   445 /**********************************/
       
   446 
       
   447 void CCamcTest_5::SetVideoFrameSizeL_006_L()
       
   448     {
       
   449     ///////////////////////////////////////
       
   450     //   ID: CAMC_API.SETVIDEOFRAMESIZEL_006
       
   451     //   Action :
       
   452     //        Set wrong SetVideoFrameSizeL()
       
   453     //   Output : 
       
   454     //        Leave with KErrArgument
       
   455     ///////////////////////////////////////    
       
   456     
       
   457     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetVideoFrameSizeWhenOpenNotPrepared, iUiLevelCameraHandle));
       
   458     assertTIntsEqualL( KErrArgument, err );
       
   459     }
       
   460 
       
   461 /**********************************/
       
   462 /*        GET VIDEO FRAME SIZE    */
       
   463 /**********************************/
       
   464 
       
   465 void CCamcTest_5::GetVideoFrameSizeL_001_L()
       
   466     {
       
   467     ///////////////////////////////////////
       
   468 	//   ID: CAMC_API.GETVIDEOFRAMESIZEL_001
       
   469     //   Action :
       
   470     //       Call GetVideoFrameSizeL() when not set
       
   471     //   Output : 
       
   472     //       Function should retrun 0.
       
   473     //   Precondition :
       
   474     //       
       
   475     ///////////////////////////////////////
       
   476 
       
   477         iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetVideoFrameSizeWhenNotSet, iUiLevelCameraHandle);
       
   478     }
       
   479 
       
   480 /**********************************/
       
   481 /*            PAUSE               */
       
   482 /**********************************/
       
   483 
       
   484 void CCamcTest_5::PauseL_001_L()
       
   485     {
       
   486     ///////////////////////////////////////
       
   487     //   ID: CAMC_API.PAUSEL_001
       
   488     //   Action :
       
   489     //        Pauses recording per request when recording
       
   490     //   Output : 
       
   491     //        Leave?
       
   492     ///////////////////////////////////////   
       
   493     
       
   494     iCamcTestClient->Start_Active_ObjectL(K_Tc5_PauseWhenRecording, iUiLevelCameraHandle);
       
   495     }
       
   496 
       
   497 void CCamcTest_5::PauseL_002_L()
       
   498     {
       
   499     ///////////////////////////////////////
       
   500     //   ID: CAMC_API.PAUSEL_001
       
   501     //   Action :
       
   502     //        Ignores request to pause when not recording
       
   503     //   Output : 
       
   504     //        Leave?
       
   505     ///////////////////////////////////////   
       
   506     
       
   507     iCamcTestClient->Start_Active_ObjectL(K_Tc5_PauseWhenStopped, iUiLevelCameraHandle);
       
   508     }
       
   509 
       
   510 /**********************************/
       
   511 /*        SET MAX CLIP SIZE    */
       
   512 /**********************************/
       
   513 
       
   514 void CCamcTest_5::SetMaxClipSizeL_005_L()
       
   515     {
       
   516     ///////////////////////////////////////
       
   517     //   ID: CAMC_API.SETMAXCLIPSIZEL_005
       
   518     //   Action :
       
   519     //        Set invalid size for SetMaxClipSizeL when not recording
       
   520     //   Output : 
       
   521     //        Leave with KErrArgument
       
   522     //////////////////////////////////////    
       
   523     
       
   524     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetMaxClipSizeLWhenNotRecording, iUiLevelCameraHandle));
       
   525     assertTIntsEqualL( KErrArgument, err );
       
   526     }
       
   527 
       
   528 /**********************************/
       
   529 /*          SET GAIN              */
       
   530 /**********************************/
       
   531 
       
   532 void CCamcTest_5::SetGainL_001_L()
       
   533     {
       
   534     ///////////////////////////////////////
       
   535     //   ID: CAMC_API.SETGAINL_001
       
   536     //   Action :
       
   537     //        Set acceptable & ask, SetGainL when not recording.
       
   538     //   Output : 
       
   539     //        compare
       
   540     //////////////////////////////////////   
       
   541     
       
   542     iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetGainWhenNotRecording, iUiLevelCameraHandle);
       
   543     }
       
   544 
       
   545 void CCamcTest_5::SetGainL_002_L()
       
   546     {
       
   547     ///////////////////////////////////////
       
   548     //   ID: CAMC_API.SETGAINL_002
       
   549     //   Action :
       
   550     //        Set wrong SetGainL()
       
   551     //   Output : 
       
   552     //        The value is corrected inside the Video Recorder, 
       
   553     //        the user is not warned of his error.
       
   554     ///////////////////////////////////////    
       
   555     
       
   556     TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetGainWhenNotRecordingAndSetWrong, iUiLevelCameraHandle));
       
   557     assertTIntsEqualL( KErrNone, err );
       
   558     }
       
   559 
       
   560 void CCamcTest_5::SetGainL_003_L()
       
   561     {
       
   562     ///////////////////////////////////////
       
   563     //   ID: CAMC_API.SETGAINL_003
       
   564     //   Action :
       
   565     //        Set acceptable & ask, SetGainL when recording.
       
   566     //   Output : 
       
   567     //        compare
       
   568     //////////////////////////////////////   
       
   569     
       
   570     iCamcTestClient->Start_Active_ObjectL(K_Tc5_SetGainWhenRecording, iUiLevelCameraHandle);
       
   571     }
       
   572 
       
   573 /**********************************/
       
   574 /*              GAIN              */
       
   575 /**********************************/
       
   576 
       
   577 void CCamcTest_5::GainL_001_L()
       
   578     {
       
   579     ///////////////////////////////////////
       
   580 	//   ID: CAMC_API.GAINL_001
       
   581     //   Action :
       
   582     //       Call GainL() when not set
       
   583     //   Output : 
       
   584     //       Function should retrun 0.
       
   585     //   Precondition :
       
   586     //       
       
   587     ///////////////////////////////////////
       
   588 
       
   589         iCamcTestClient->Start_Active_ObjectL(K_Tc5_GainWhenNotSet, iUiLevelCameraHandle);
       
   590     }
       
   591 
       
   592 /**********************************/
       
   593 /*           MAX GAIN             */
       
   594 /**********************************/
       
   595 
       
   596 void CCamcTest_5::MaxGainL_001_L()
       
   597     {
       
   598     ///////////////////////////////////////
       
   599 	//   ID: CAMC_API.MAXGAINL_001
       
   600     //   Action :
       
   601     //       Call MaxGainL() when not recording
       
   602     //   Output : 
       
   603     //       Function should retrun 0???
       
   604     //   Precondition :
       
   605     //       
       
   606     ///////////////////////////////////////
       
   607 
       
   608         iCamcTestClient->Start_Active_ObjectL(K_Tc5_MaxGainWhenNotRecording, iUiLevelCameraHandle);
       
   609     }
       
   610 
       
   611 void CCamcTest_5::MaxGainL_002_L()
       
   612     {
       
   613     ///////////////////////////////////////
       
   614 	//   ID: CAMC_API.MAXGAINL_002
       
   615     //   Action :
       
   616     //       Call MaxGainL() when recording
       
   617     //   Output : 
       
   618     //       Function should retrun 0???
       
   619     //   Precondition :
       
   620     //       
       
   621     ///////////////////////////////////////
       
   622 
       
   623         iCamcTestClient->Start_Active_ObjectL(K_Tc5_MaxGainWhenRecording, iUiLevelCameraHandle);
       
   624     }
       
   625 
       
   626 /**********************************/
       
   627 /*             STOP               */
       
   628 /**********************************/
       
   629 
       
   630 void CCamcTest_5::Stop_001_L()
       
   631     {
       
   632     ///////////////////////////////////////
       
   633     //   ID: CAMC_API.STOP_001
       
   634     //   Action :
       
   635     //        Call stop when recording
       
   636     //   Output : 
       
   637     //        Video Recording is stopped.
       
   638     ///////////////////////////////////////   
       
   639     
       
   640     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenRecording, iUiLevelCameraHandle);
       
   641     }
       
   642 
       
   643 void CCamcTest_5::Stop_002_L()
       
   644     {
       
   645     ///////////////////////////////////////
       
   646     //   ID: CAMC_API.STOP_002
       
   647     //   Action :
       
   648     //        Call Stop when not recording or paused
       
   649     //   Output : 
       
   650     //        Nothing
       
   651     ///////////////////////////////////////   
       
   652 
       
   653     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenNotRecording, iUiLevelCameraHandle);
       
   654     }
       
   655 
       
   656 void CCamcTest_5::Stop_003_L()
       
   657     {
       
   658     ///////////////////////////////////////
       
   659     //   ID: CAMC_API.STOP_003
       
   660     //   Action :
       
   661     //        Stop + start timer + close + prepare
       
   662     //   Output : 
       
   663     //        New prepare complete, Prepare ready in 2 seconds
       
   664     ///////////////////////////////////////   
       
   665 
       
   666     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenRecordingNewPrepareCorrect, iUiLevelCameraHandle);
       
   667     }
       
   668 
       
   669 void CCamcTest_5::Stop_004_L()
       
   670     {
       
   671     ///////////////////////////////////////
       
   672     //   ID: CAMC_API.STOP_004
       
   673     //   Action :
       
   674     //        Stop + close + open file
       
   675     //   Output : 
       
   676     //        File can be opened for reading
       
   677     ///////////////////////////////////////   
       
   678 
       
   679     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenRecordingAfterOpenFile, iUiLevelCameraHandle);
       
   680 
       
   681 /* File can be opened for reading */
       
   682     RFile file; 
       
   683     RFs fsSession;
       
   684     fsSession.Connect();
       
   685     TFileName fileName;
       
   686     AddDriveLetterToPath(_L("recordQCIF.3gp"),fileName);
       
   687     TInt err = file.Open(fsSession,fileName,EFileShareAny);    
       
   688     file.Close();
       
   689     fsSession.Close();
       
   690     assertTIntsEqualL( KErrNone, err );
       
   691     }
       
   692 
       
   693 void CCamcTest_5::Stop_005_L()
       
   694     {
       
   695     ///////////////////////////////////////
       
   696     //   ID: CAMC_API.STOP_005
       
   697     //   Action :
       
   698     //        Stop + close + open file
       
   699     //   Output : 
       
   700     //        File can be opened for reading
       
   701     ///////////////////////////////////////   
       
   702 
       
   703     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenRecordingAfterOpenFileNew, iUiLevelCameraHandle);
       
   704 
       
   705 /* File can be opened for reading */
       
   706     RFile file; 
       
   707     RFs fsSession;
       
   708     fsSession.Connect();
       
   709     TFileName fileName;
       
   710     AddDriveLetterToPath(_L("recordQCIF.3g2"),fileName);
       
   711     TInt err = file.Open(fsSession,fileName,EFileShareAny);    
       
   712     file.Close();
       
   713     fsSession.Close();
       
   714     assertTIntsEqualL( KErrNone, err );
       
   715     }
       
   716 
       
   717 void CCamcTest_5::Stop_007_L()
       
   718     {
       
   719     ///////////////////////////////////////
       
   720     //   ID: CAMC_API.STOP_007
       
   721     //   Action :
       
   722     //        Stop + close + open file
       
   723     //   Output : 
       
   724     //        File can be opened for reading
       
   725     ///////////////////////////////////////   
       
   726 
       
   727     iCamcTestClient->Start_Active_ObjectL(K_Tc5_StopWhenRecordingAfterOpenFileNew_MPEG4, iUiLevelCameraHandle);
       
   728 
       
   729 /* File can be opened for reading */
       
   730     RFile file; 
       
   731     RFs fsSession;
       
   732     fsSession.Connect();
       
   733     TFileName fileName;
       
   734     AddDriveLetterToPath(_L("recordQCIF.mp4"),fileName);
       
   735     TInt err = file.Open(fsSession,fileName,EFileShareAny);    
       
   736     file.Close();
       
   737     fsSession.Close();
       
   738     assertTIntsEqualL( KErrNone, err );
       
   739     }
       
   740 
       
   741 void CCamcTest_5::GetSupportedVideoTypes_001_L()
       
   742     {
       
   743     ///////////////////////////////////////
       
   744     //   ID: CAMC_API.GETSUPPORTEDVIDEOTYPESL_001
       
   745     //   Action :
       
   746     //        GetSupportedVideoTypesL when open, not recording
       
   747     //   Output : 
       
   748     //        must be sensible
       
   749     ///////////////////////////////////////   
       
   750     
       
   751     iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetSupportedVideoTypesWhenOpenNotRecording, iUiLevelCameraHandle);
       
   752     }
       
   753 
       
   754 void CCamcTest_5::GetSupportedVideoTypes_002_L()
       
   755     {
       
   756     ///////////////////////////////////////
       
   757     //   ID: CAMC_API.GETSUPPORTEDVIDEOTYPESL_002
       
   758     //   Action :
       
   759     //        GetSupportedVideoTypesL when open, not recording
       
   760     //   Output : 
       
   761     //        must be sensible
       
   762     ///////////////////////////////////////   
       
   763     
       
   764     iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetSupportedVideoTypesWhenOpenNotRecordingNew, iUiLevelCameraHandle);
       
   765     }
       
   766 
       
   767 void CCamcTest_5::GetSupportedAudioTypes_001_L()
       
   768     {
       
   769     ///////////////////////////////////////
       
   770     //   ID: CAMC_API.GETSUPPORTEDAUDIOTYPESL_001
       
   771     //   Action :
       
   772     //        GetSupportedAudioTypesL when open, not recording
       
   773     //   Output : 
       
   774     //        must be sensible
       
   775     ///////////////////////////////////////   
       
   776     
       
   777     iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetSupportedAudioTypesWhenOpenNotRecordingAMR, iUiLevelCameraHandle);
       
   778     }
       
   779 
       
   780 void CCamcTest_5::GetSupportedAudioTypes_003_L()
       
   781     {
       
   782     ///////////////////////////////////////
       
   783     //   ID: CAMC_API.GETSUPPORTEDAUDIOTYPESL_003
       
   784     //   Action :
       
   785     //        GetSupportedAudioTypesL when open, not recording
       
   786     //   Output : 
       
   787     //        must be sensible
       
   788     ///////////////////////////////////////   
       
   789     
       
   790     iCamcTestClient->Start_Active_ObjectL(K_Tc5_GetSupportedAudioTypesWhenOpenNotRecordingAAC, iUiLevelCameraHandle);
       
   791     }
       
   792     
       
   793     
       
   794 
       
   795 // //////////////////////////////////////////////////////////////////
       
   796 //   Dummy Camera API callback functions
       
   797 // //////////////////////////////////////////////////////////////////
       
   798 void CCamcTest_5::ReserveComplete(TInt /*aError*/)
       
   799     {
       
   800     RDebug::Print(_L("CCamcTest_5::ReserveComplete"));
       
   801         
       
   802     // UI level camera is being initialized        
       
   803     if (iWaitScheduler->IsStarted())
       
   804 	    {
       
   805     	 iUiLevelCamera->PowerOn();
       
   806     	 return;
       
   807 	    }
       
   808     }
       
   809 
       
   810 void CCamcTest_5::PowerOnComplete(TInt /*aError*/)
       
   811     {   
       
   812     RDebug::Print(_L("CCamcTest_5::PowerOnComplete"));
       
   813         
       
   814     // UI level camera is being initialized
       
   815     if (iWaitScheduler->IsStarted())
       
   816 	    {
       
   817     	 iWaitScheduler->AsyncStop();
       
   818     	 return;
       
   819     	}        
       
   820     }
       
   821 
       
   822 void CCamcTest_5::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
       
   823     {
       
   824     }
       
   825 void CCamcTest_5::ImageReady(CFbsBitmap* /*aBitmap */,HBufC8* /*aData*/,TInt /*aError*/)
       
   826     {    
       
   827     }
       
   828 void CCamcTest_5::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,TInt /*aError*/ )
       
   829     {
       
   830     }
       
   831   
       
   832 // -----------------------------------------------------------------------------
       
   833 // CCamcTest_5::HandleEvent
       
   834 // MCameraObserver2 call-back handler
       
   835 // -----------------------------------------------------------------------------
       
   836 //
       
   837 void CCamcTest_5::HandleEvent( const TECAMEvent& aEvent)
       
   838     {
       
   839     PRINT(( _L( "CCamcTest_5::HandleEvent() entering, type=%x, err=%d" ), aEvent.iEventType.iUid, aEvent.iErrorCode ));
       
   840 
       
   841     if ( aEvent.iEventType == KUidECamEventCameraNoLongerReserved )
       
   842         {
       
   843         PRINT(( _L( "CCamcTest_5::HandleEvent() KUidECamEventCameraNoLongerReserved" ) ));
       
   844         }
       
   845     else if ( aEvent.iEventType == KUidECamEventPowerOnComplete )
       
   846         {
       
   847         PRINT(( _L( "CCamcTest_5::HandleEvent() KUidECamEventPowerOnComplete" ) ));
       
   848         PowerOnComplete( aEvent.iErrorCode );
       
   849         }
       
   850     else if ( aEvent.iEventType == KUidECamEventReserveComplete )
       
   851        {
       
   852        PRINT(( _L( "CCamcTest_5::HandleEvent() KUidECamEventReserveComplete" ) ));
       
   853        ReserveComplete( aEvent.iErrorCode );
       
   854        }
       
   855 
       
   856     PRINT(( _L( "CCamcTestClient_7::HandleEvent() returning" ) ));
       
   857     }
       
   858 
       
   859 // -----------------------------------------------------------------------------
       
   860 // CCamcTest_5::ViewFinderReady
       
   861 // MCameraObserver2 call-back handler
       
   862 // -----------------------------------------------------------------------------
       
   863 //
       
   864 void CCamcTest_5::ViewFinderReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   865     {
       
   866     PRINT(( _L( "CCamcTest_5::ViewFinderReady() NOT HANDLED err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   867     CFbsBitmap *buffer = NULL;
       
   868     if ( !aError )
       
   869         {
       
   870 	    aCameraBuffer.Release();
       
   871         }
       
   872     ViewFinderFrameReady( *buffer );
       
   873     }
       
   874 
       
   875 // -----------------------------------------------------------------------------
       
   876 // CCamcTest_5::ImageBufferReady
       
   877 // MCameraObserver2 call-back handler
       
   878 // -----------------------------------------------------------------------------
       
   879 //
       
   880 void CCamcTest_5::ImageBufferReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   881     {
       
   882     PRINT(( _L( "CCamcTest_5::ImageBufferReady() BUFFER NOT HANDLED, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   883 	
       
   884     if ( !aError )
       
   885         {
       
   886 	    aCameraBuffer.Release();
       
   887         }
       
   888     ImageReady( NULL, NULL, aError );
       
   889     }
       
   890     
       
   891 // -----------------------------------------------------------------------------
       
   892 // CCamcTest_5::VideoBufferReady
       
   893 // MCameraObserver2 call-back handler
       
   894 // -----------------------------------------------------------------------------
       
   895 //
       
   896 void CCamcTest_5::VideoBufferReady( MCameraBuffer& aCameraBuffer, TInt aError)
       
   897     {
       
   898     PRINT(( _L( "CCamcTest_5::VideoBufferReady() entering, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() ));
       
   899     MFrameBuffer* buffer = NULL;
       
   900 	
       
   901     if ( !aError )
       
   902         {
       
   903         aCameraBuffer.Release();
       
   904         }
       
   905     // Call old Camera-API observer handler
       
   906     FrameBufferReady( buffer, aError );
       
   907     
       
   908     PRINT(( _L( "CCamcTest_5::VideoBufferReady() returning" )));
       
   909     }
       
   910 
       
   911 
       
   912 
       
   913 
       
   914 //
       
   915 // An own static function to collect the test functions into one 
       
   916 // suite of tests. The framework will run the tests and free the
       
   917 // memory allocated for the test suite.
       
   918 // 
       
   919 
       
   920 MTest* CCamcTest_5::suiteL ()
       
   921     {
       
   922     // Always use NewL (Do not use NewLC) !!!
       
   923     CTestSuite *suite = CTestSuite::NewL(_L8("CCamcTest_5"));
       
   924 
       
   925     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.NUMBEROFMETADATAENTRIESL_001"), &NumberOfMetaDataEntriesL_001_L));
       
   926     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.NUMBEROFMETADATAENTRIESL_002"), &NumberOfMetaDataEntriesL_002_L));
       
   927  
       
   928     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.METADATAENTRYL_001"), &MetaDataEntryL_001_L));
       
   929     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.METADATAENTRYL_002"), &MetaDataEntryL_002_L));
       
   930 
       
   931     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.ADDMETADATAENTRYL_001"), &AddMetaDataEntryL_001_L));
       
   932     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.ADDMETADATAENTRYL_002"), &AddMetaDataEntryL_002_L));
       
   933 
       
   934     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.REMOVEMETADATAENTRYL_001"), &RemoveMetaDataEntryL_001_L));   
       
   935     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.REMOVEMETADATAENTRYL_002"), &RemoveMetaDataEntryL_002_L));
       
   936     
       
   937     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.REPLACEMETADATAENTRYL_001"), &ReplaceMetaDataEntryL_001_L));
       
   938     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.REPLACEMETADATAENTRYL_002"), &ReplaceMetaDataEntryL_002_L));
       
   939 
       
   940     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETPRIORITYL_005"), &SetPriorityL_005_L));     
       
   941     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETPRIORITYL_001"), &GetPriorityL_001_L));
       
   942 
       
   943     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETVIDEOFRAMERATEL_005"), &SetVideoFrameRateL_005_L));
       
   944     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.VIDEOFRAMERATEL_001"), &VideoFrameRateL_001_L));
       
   945 
       
   946     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETVIDEOBITRATEL_005"), &SetVideoBitRateL_005_L));
       
   947     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.VIDEOBITRATEL_001"), &VideoBitRateL_001_L));
       
   948 
       
   949     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETAUDIOBITRATEL_005"), &SetAudioBitRateL_005_L));
       
   950     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.AUDIOBITRATEL_001"), &AudioBitRateL_001_L));
       
   951  
       
   952     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETAUDIOENABLEDL_005"), &SetAudioEnabledL_005_L));
       
   953     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.AUDIOENABLEDL_001"), &AudioEnabledL_001_L));
       
   954 
       
   955     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETVIDEOFRAMESIZEL_006"), &SetVideoFrameSizeL_006_L));
       
   956     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETVIDEOFRAMESIZEL_001"), &GetVideoFrameSizeL_001_L));
       
   957 
       
   958     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.PAUSEL_001"), &PauseL_001_L));
       
   959     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.PAUSEL_002"), &PauseL_002_L));
       
   960 
       
   961     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETMAXCLIPSIZEL_005"), &SetMaxClipSizeL_005_L));
       
   962      
       
   963     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETGAINL_001"), &SetGainL_001_L));
       
   964     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETGAINL_002"), &SetGainL_002_L));
       
   965     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.SETGAINL_003"), &SetGainL_003_L));
       
   966     
       
   967     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GAINL_001"), &GainL_001_L));
       
   968    
       
   969     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.MAXGAINL_001"), &MaxGainL_001_L));
       
   970     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.MAXGAINL_002"), &MaxGainL_002_L));
       
   971  
       
   972     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_001"), &Stop_001_L));
       
   973     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_002"), &Stop_002_L));
       
   974     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_003"), &Stop_003_L));
       
   975     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_004"), &Stop_004_L));
       
   976     
       
   977 #ifdef __MPEG4_VIDEO_ENCODING
       
   978     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_005"), &Stop_005_L));
       
   979 #endif
       
   980 #ifndef __MPEG4_VIDEO_ENCODING
       
   981     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETSUPPORTEDVIDEOTYPESL_001"), &GetSupportedVideoTypes_001_L));
       
   982 #else
       
   983     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETSUPPORTEDVIDEOTYPESL_002"), &GetSupportedVideoTypes_002_L));
       
   984 #endif
       
   985 
       
   986 #if ((!defined __WINS__) || (!defined __WINSCW__)) // AAC supported only in HW
       
   987     // MP4 AAC + AMR
       
   988     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETSUPPORTEDAUDIOTYPESL_003"), &GetSupportedAudioTypes_003_L));
       
   989     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.STOP_007"), &Stop_007_L));
       
   990 #endif
       
   991     // AMR-only
       
   992     suite->addTestL(CTestCaller<CCamcTest_5>::NewL(_L8("CAMC_API.GETSUPPORTEDAUDIOTYPESL_001"), &GetSupportedAudioTypes_001_L));
       
   993     return suite;
       
   994     }
       
   995