startupservices/startupanimation/tsrc/Tsanimihl/src/TsanimihlBlocks.cpp
changeset 77 b01c07dfcf84
equal deleted inserted replaced
74:1505405bc645 77:b01c07dfcf84
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains testclass implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // [INCLUDE FILES] - do not remove
       
    19 #include <e32svr.h>
       
    20 #include <StifParser.h>
       
    21 #include <StifTestInterface.h>
       
    22 #include "Tsanimihl.h"
       
    23 
       
    24 
       
    25 #include "sanimimageplugin.h"
       
    26 
       
    27 #include "testwaiter.h"
       
    28 #include <ecom/ecom.h>
       
    29 
       
    30 
       
    31 
       
    32 // Praveen
       
    33 
       
    34 const TInt KSAnimIhlPluginImplUid = 0x2000B11C;
       
    35 const TInt K1Second = 1000000;
       
    36 
       
    37 _LIT( KUnknownFile, "C:\\temp\\unknown.gif" );
       
    38 _LIT( KCorruptFile, "C:\\temp\\corrupt.gif" );
       
    39 _LIT( KStillImageGray2File, "C:\\temp\\still_image_gray2.gif" );
       
    40 _LIT( KStillImageColourFile, "C:\\temp\\gif_2kb.gif" );
       
    41 _LIT( KStillImageBgColourFile, "C:\\temp\\testimg_1.gif" );
       
    42 _LIT( KMbmFile, "C:\\temp\\startupnokia_qvga.mbm" );
       
    43 _LIT( KAnimationFile, "C:\\temp\\testanim_7.gif" );
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // TMockIhlAnimationObserver::UpdateScreen
       
    47 //
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 void TMockIhlAnimationObserver::UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ )
       
    51     {
       
    52     iTestSuite.iFrameCounter++;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // TMockIhlAnimationObserver::UpdateScreen
       
    58 //
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 void TMockIhlAnimationObserver::UpdateScreen( const CFbsBitmap& /*aFrame*/ )
       
    62     {
       
    63     iTestSuite.iFrameCounter++;
       
    64     }
       
    65 
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CSAnimIhlPluginTestSuite::NewL
       
    69 //
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 /*
       
    73 CTsanimihl* CTsanimihl::NewL()
       
    74     {
       
    75     CTsanimihl* self = CTsanimihl::NewLC();
       
    76     CleanupStack::Pop( self );
       
    77     return self;
       
    78     }
       
    79 
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // CSAnimIhlPluginTestSuite::NewLC
       
    83 //
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 CTsanimihl* CTsanimihl::NewLC()
       
    87     {
       
    88     CTsanimihl* self = new( ELeave ) CTsanimihl;
       
    89     CleanupStack::PushL( self );
       
    90     self->ConstructL();
       
    91     return self;
       
    92     }
       
    93 
       
    94 */
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CTsanimihl::RunMethodL
       
    98 // Run specified method. Contains also table of test mothods and their names.
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 TInt CTsanimihl::RunMethodL( 
       
   102     CStifItemParser& aItem ) 
       
   103     {
       
   104 
       
   105     static TStifFunctionInfo const KFunctions[] =
       
   106         {  
       
   107         // Copy this line for every implemented function.
       
   108         // First string is the function name used in TestScripter script file.
       
   109         // Second is the actual implementation member function. 
       
   110         ENTRY("Example", CTsanimihl::ExampleL ),
       
   111         ENTRY("SetupEmpty",CTsanimihl::SetupEmptyL),
       
   112         ENTRY("SetupObj",CTsanimihl::SetupObjL),
       
   113         ENTRY("SetupStillImage",CTsanimihl::SetupStillImageL),
       
   114         ENTRY("SetupAnimation",CTsanimihl::SetupAnimationL),
       
   115         ENTRY("SetupMultiFrame",CTsanimihl::SetupMultiFrameL),
       
   116         ENTRY("SetupStillImageWithBgColour",CTsanimihl::SetupStillImageWithBgColourL),
       
   117         ENTRY("Teardown",CTsanimihl::Teardown),
       
   118         ENTRY("TestConstructor",CTsanimihl::TestConstructorL),
       
   119         ENTRY("TestConstructorNoMemory",CTsanimihl::TestConstructorNoMemoryL),
       
   120         ENTRY("TestUnknownFile",CTsanimihl::TestUnknownFileL),
       
   121         ENTRY("TestCorruptFile",CTsanimihl::TestCorruptFileL),
       
   122         ENTRY("TestLoadStillImageGray2",CTsanimihl::TestLoadStillImageGray2L),
       
   123         ENTRY("TestLoadStillImageColour",CTsanimihl::TestLoadStillImageColourL),
       
   124         ENTRY("TestLoadAnimation",CTsanimihl::TestLoadAnimationL),
       
   125         ENTRY("TestLoadMultiFrame",CTsanimihl::TestLoadMultiFrameL),
       
   126         ENTRY("TestLoadStillImageNoMemory",CTsanimihl::TestLoadStillImageNoMemoryL),
       
   127         ENTRY("TestLoadAnimationNoMemory",CTsanimihl::TestLoadAnimationNoMemoryL),
       
   128         ENTRY("TestCancelLoadStillImage",CTsanimihl::TestCancelLoadStillImageL),
       
   129         ENTRY("TestCancelLoadAnimation",CTsanimihl::TestCancelLoadAnimationL),
       
   130         ENTRY("TestCancelLoadMultiFrame",CTsanimihl::TestCancelLoadMultiFrameL),
       
   131         ENTRY("TestShowStillImage",CTsanimihl::TestShowStillImageL),
       
   132         ENTRY("TestShowStillImageWithFrameDelay",CTsanimihl::TestShowStillImageWithFrameDelayL),
       
   133         ENTRY("TestShowAnimation",CTsanimihl::TestShowAnimationL),
       
   134         ENTRY("TestShowMultiFrame",CTsanimihl::TestShowMultiFrameL),
       
   135         ENTRY("TestCancelPlay",CTsanimihl::TestCancelPlayL),
       
   136         ENTRY("TestBgColour",CTsanimihl::TestBgColourL),
       
   137         ENTRY("TestBgColourBeforeLoad",CTsanimihl::TestBgColourBeforeLoadL),
       
   138         ENTRY("TestScaleStillImage",CTsanimihl::TestScaleStillImageL)
       
   139                 //ADD NEW ENTRY HERE
       
   140         // [test cases entries] - Do not remove
       
   141 
       
   142         };
       
   143 
       
   144     const TInt count = sizeof( KFunctions ) / 
       
   145                         sizeof( TStifFunctionInfo );
       
   146 
       
   147     return RunInternalL( KFunctions, count, aItem );
       
   148 
       
   149     }
       
   150 
       
   151 // ---------------------------------------------------------------------------
       
   152 // CSAnimIhlPluginTestSuite::CSAnimIhlPluginTestSuite
       
   153 //
       
   154 // ---------------------------------------------------------------------------
       
   155 //
       
   156 /*
       
   157 CTsanimihl::CTsanimihl() : iObserver( *this )
       
   158     {
       
   159     }
       
   160 */
       
   161 
       
   162 // ---------------------------------------------------------------------------
       
   163 // CSAnimIhlPluginTestSuite::ConstructL
       
   164 //
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 /*
       
   168 void CTsanimihl::ConstructL()
       
   169     {
       
   170    // REComSession::FinalClose();
       
   171     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
       
   172     // It generates the test case table.
       
   173    
       
   174     }
       
   175 */
       
   176 
       
   177 // ---------------------------------------------------------------------------
       
   178 // CSAnimIhlPluginTestSuite::SetupEmptyL
       
   179 //
       
   180 // ---------------------------------------------------------------------------
       
   181 //
       
   182 TInt  CTsanimihl::SetupEmptyL()
       
   183     {
       
   184     iTestObj = NULL;
       
   185     iDtorKey = TUid::Uid( 0 );
       
   186     User::LeaveIfError( iFs.Connect() );
       
   187     User::LeaveIfError( iFs.ShareProtected() );
       
   188     iWaiter = CTestWaiter::NewL();
       
   189     iFrameCounter = 0;
       
   190     return KErrNone;
       
   191     }
       
   192 
       
   193 
       
   194 // ---------------------------------------------------------------------------
       
   195 // CSAnimIhlPluginTestSuite::SetupObjL
       
   196 //
       
   197 // ---------------------------------------------------------------------------
       
   198 //
       
   199 TInt CTsanimihl::SetupObjL()
       
   200     {
       
   201     SetupEmptyL();
       
   202     iTestObj = static_cast<CSAnimImagePlugin*>(
       
   203             REComSession::CreateImplementationL(
       
   204             TUid::Uid( KSAnimIhlPluginImplUid ), iDtorKey , &iObserver) );
       
   205     return KErrNone;
       
   206     
       
   207        
       
   208     }
       
   209 
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // CSAnimIhlPluginTestSuite::SetupStillImageL
       
   213 //
       
   214 // ---------------------------------------------------------------------------
       
   215 //
       
   216 TInt CTsanimihl::SetupStillImageL()
       
   217     {
       
   218     SetupObjL();
       
   219     iTestObj->Load( iFs, KStillImageGray2File, iWaiter->iStatus );
       
   220     iWaiter->Activate();
       
   221     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   222     return KErrNone;
       
   223     }
       
   224 
       
   225 
       
   226 // ---------------------------------------------------------------------------
       
   227 // CSAnimIhlPluginTestSuite::SetupAnimationL
       
   228 //
       
   229 // ---------------------------------------------------------------------------
       
   230 //
       
   231 TInt CTsanimihl::SetupAnimationL()
       
   232     {
       
   233     SetupObjL();
       
   234     iTestObj->Load( iFs, KAnimationFile, iWaiter->iStatus );
       
   235     iWaiter->Activate();
       
   236     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   237     return KErrNone;
       
   238     }
       
   239 
       
   240 
       
   241 // ---------------------------------------------------------------------------
       
   242 // CSAnimIhlPluginTestSuite::SetupMultiFrameL
       
   243 //
       
   244 // ---------------------------------------------------------------------------
       
   245 //
       
   246 TInt CTsanimihl::SetupMultiFrameL()
       
   247     {
       
   248     SetupObjL();
       
   249     iTestObj->Load( iFs, KMbmFile, iWaiter->iStatus );
       
   250     iWaiter->Activate();
       
   251     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   252     return KErrNone;
       
   253     }
       
   254 
       
   255 
       
   256 // ---------------------------------------------------------------------------
       
   257 // CSAnimIhlPluginTestSuite::SetupStillImageWithBgColourL
       
   258 //
       
   259 // ---------------------------------------------------------------------------
       
   260 //
       
   261 TInt CTsanimihl::SetupStillImageWithBgColourL()
       
   262     {
       
   263     SetupObjL();
       
   264     iTestObj->Load( iFs, KStillImageBgColourFile, iWaiter->iStatus );
       
   265     iWaiter->Activate();
       
   266     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   267     return KErrNone;
       
   268     }
       
   269 
       
   270 
       
   271 // ---------------------------------------------------------------------------
       
   272 // CSAnimIhlPluginTestSuite::Teardown
       
   273 //
       
   274 // ---------------------------------------------------------------------------
       
   275 //
       
   276 TInt CTsanimihl::Teardown()
       
   277     {
       
   278     delete iTestObj;
       
   279     iTestObj = NULL;
       
   280 
       
   281     REComSession::DestroyedImplementation( iDtorKey );
       
   282 
       
   283     delete iWaiter;
       
   284     iWaiter = NULL;
       
   285 
       
   286     iFs.Close();
       
   287 
       
   288     REComSession::FinalClose();
       
   289     return KErrNone;
       
   290     }
       
   291 
       
   292 
       
   293 // ---------------------------------------------------------------------------
       
   294 // CSAnimIhlPluginTestSuite::TestConstructorL
       
   295 //
       
   296 // ---------------------------------------------------------------------------
       
   297 //
       
   298 TInt CTsanimihl::TestConstructorL()
       
   299     {
       
   300     TAny* ptr = NULL;
       
   301      ptr = REComSession::CreateImplementationL(TUid::Uid( KSAnimIhlPluginImplUid ), iDtorKey, &iObserver );
       
   302 
       
   303     iTestObj = static_cast<CSAnimImagePlugin*>( ptr );
       
   304    // STIF_ASSERT( iTestObj );
       
   305     delete iTestObj;
       
   306     iTestObj = NULL;
       
   307     return KErrNone;
       
   308     }
       
   309 
       
   310 
       
   311 // ---------------------------------------------------------------------------
       
   312 // CSAnimIhlPluginTestSuite::TestConstructorNoMemoryL
       
   313 //
       
   314 // ---------------------------------------------------------------------------
       
   315 //
       
   316 TInt CTsanimihl::TestConstructorNoMemoryL()
       
   317     {
       
   318     TAny* ptr = NULL;
       
   319     ptr = REComSession::CreateImplementationL(TUid::Uid( KSAnimIhlPluginImplUid ), iDtorKey, &iObserver );
       
   320     //STIF_ASSERT( !ptr );
       
   321     return KErrNone;
       
   322     }
       
   323 
       
   324 
       
   325 // ---------------------------------------------------------------------------
       
   326 // CSAnimIhlPluginTestSuite::TestUnknownFileL
       
   327 //
       
   328 // ---------------------------------------------------------------------------
       
   329 //
       
   330 TInt CTsanimihl::TestUnknownFileL()
       
   331     {
       
   332     iTestObj->Load( iFs, KUnknownFile, iWaiter->iStatus );
       
   333     iWaiter->Activate();
       
   334     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   335     if (iWaiter->iStatus.Int()== KErrNotFound )
       
   336     {
       
   337     
       
   338     }
       
   339     return KErrNone;
       
   340     }
       
   341 
       
   342 
       
   343 // ---------------------------------------------------------------------------
       
   344 // CSAnimIhlPluginTestSuite::TestCorruptFileL
       
   345 //
       
   346 // ---------------------------------------------------------------------------
       
   347 //
       
   348 TInt CTsanimihl::TestCorruptFileL()
       
   349     {
       
   350     iTestObj->Load( iFs, KCorruptFile, iWaiter->iStatus );
       
   351     iWaiter->Activate();
       
   352     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   353     if( iWaiter->iStatus.Int()== KErrNotFound ) // For some reason, IHL returns KErrNotFound...
       
   354         {
       
   355         
       
   356         }
       
   357     return KErrNone;
       
   358     }
       
   359 
       
   360 
       
   361 // ---------------------------------------------------------------------------
       
   362 // CSAnimIhlPluginTestSuite::TestLoadStillImageGray2L
       
   363 //
       
   364 // ---------------------------------------------------------------------------
       
   365 //
       
   366 TInt CTsanimihl::TestLoadStillImageGray2L()
       
   367     {
       
   368     iTestObj->Load( iFs, KStillImageGray2File, iWaiter->iStatus );
       
   369     iWaiter->Activate();
       
   370     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   371     if ( iWaiter->iStatus.Int()== KErrNone )
       
   372                 {
       
   373         
       
   374                 }
       
   375     return KErrNone;
       
   376     }
       
   377 
       
   378 
       
   379 // ---------------------------------------------------------------------------
       
   380 // CSAnimIhlPluginTestSuite::TestLoadStillImageColourL
       
   381 //
       
   382 // ---------------------------------------------------------------------------
       
   383 //
       
   384 TInt CTsanimihl::TestLoadStillImageColourL()
       
   385     {
       
   386     iTestObj->Load( iFs, KStillImageColourFile, iWaiter->iStatus );
       
   387     iWaiter->Activate();
       
   388     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   389     if ( iWaiter->iStatus.Int()== KErrNone )
       
   390         {
       
   391         
       
   392         }
       
   393     return KErrNone;
       
   394     }
       
   395 
       
   396 
       
   397 // ---------------------------------------------------------------------------
       
   398 // CSAnimIhlPluginTestSuite::TestLoadAnimationL
       
   399 //
       
   400 // ---------------------------------------------------------------------------
       
   401 //
       
   402 TInt CTsanimihl::TestLoadAnimationL()
       
   403     {
       
   404     iTestObj->Load( iFs, KAnimationFile, iWaiter->iStatus );
       
   405     iWaiter->Activate();
       
   406     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   407     if ( iWaiter->iStatus.Int()== KErrNone )
       
   408         {
       
   409         
       
   410         }
       
   411     return KErrNone;
       
   412     }
       
   413 
       
   414 
       
   415 // ---------------------------------------------------------------------------
       
   416 // CSAnimIhlPluginTestSuite::TestLoadMultiFrameL
       
   417 //
       
   418 // ---------------------------------------------------------------------------
       
   419 //
       
   420 TInt CTsanimihl::TestLoadMultiFrameL()
       
   421     {
       
   422     iTestObj->Load( iFs, KMbmFile, iWaiter->iStatus );
       
   423     iWaiter->Activate();
       
   424     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   425     if ( iWaiter->iStatus.Int()== KErrNone )
       
   426         {
       
   427         
       
   428         }
       
   429     return KErrNone;
       
   430     }
       
   431 
       
   432 
       
   433 // ---------------------------------------------------------------------------
       
   434 // CSAnimIhlPluginTestSuite::TestLoadStillImageNoMemoryL
       
   435 //
       
   436 // ---------------------------------------------------------------------------
       
   437 //
       
   438 TInt CTsanimihl::TestLoadStillImageNoMemoryL()
       
   439     {
       
   440     iTestObj->Load( iFs, KStillImageColourFile, iWaiter->iStatus );
       
   441     iWaiter->Activate();
       
   442     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   443     if ( iWaiter->iStatus.Int()== KErrNoMemory )
       
   444         {
       
   445         
       
   446         }
       
   447     return KErrNone;
       
   448     }
       
   449 
       
   450 
       
   451 // ---------------------------------------------------------------------------
       
   452 // CSAnimIhlPluginTestSuite::TestLoadAnimationNoMemoryL
       
   453 //
       
   454 // ---------------------------------------------------------------------------
       
   455 //
       
   456 TInt CTsanimihl::TestLoadAnimationNoMemoryL()
       
   457     {
       
   458     iTestObj->Load( iFs, KAnimationFile, iWaiter->iStatus );
       
   459     iWaiter->Activate();
       
   460     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   461     if ( iWaiter->iStatus.Int()== KErrNoMemory )
       
   462         {
       
   463         
       
   464         }
       
   465     return KErrNone;
       
   466     }
       
   467 
       
   468 
       
   469 // ---------------------------------------------------------------------------
       
   470 // CSAnimIhlPluginTestSuite::TestCancelLoadStillImageL
       
   471 //
       
   472 // ---------------------------------------------------------------------------
       
   473 //
       
   474 TInt CTsanimihl::TestCancelLoadStillImageL()
       
   475     {
       
   476     iTestObj->Load( iFs, KStillImageGray2File, iWaiter->iStatus );
       
   477     iWaiter->Activate();
       
   478     iTestObj->Cancel();
       
   479     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   480     if ( iWaiter->iStatus.Int()== KErrCancel )
       
   481         {
       
   482         
       
   483         }
       
   484     return KErrNone;
       
   485     }
       
   486 
       
   487 
       
   488 // ---------------------------------------------------------------------------
       
   489 // CSAnimIhlPluginTestSuite::TestCancelLoadAnimationL
       
   490 //
       
   491 // ---------------------------------------------------------------------------
       
   492 //
       
   493 TInt CTsanimihl::TestCancelLoadAnimationL()
       
   494     {
       
   495     iTestObj->Load( iFs, KAnimationFile, iWaiter->iStatus );
       
   496     iWaiter->Activate();
       
   497     iTestObj->Cancel();
       
   498     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   499     if ( iWaiter->iStatus.Int()== KErrCancel )
       
   500         {
       
   501         
       
   502         }
       
   503     return KErrNone;
       
   504     }
       
   505 
       
   506 
       
   507 // ---------------------------------------------------------------------------
       
   508 // CSAnimIhlPluginTestSuite::TestCancelLoadMultiFrameL
       
   509 //
       
   510 // ---------------------------------------------------------------------------
       
   511 //
       
   512 TInt CTsanimihl::TestCancelLoadMultiFrameL()
       
   513     {
       
   514     iTestObj->Load( iFs, KMbmFile, iWaiter->iStatus );
       
   515     iWaiter->Activate();
       
   516     iTestObj->Cancel();
       
   517     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   518     if ( iWaiter->iStatus.Int() == KErrCancel )
       
   519         {
       
   520         
       
   521         }
       
   522     return KErrNone;
       
   523     }
       
   524 
       
   525 
       
   526 // ---------------------------------------------------------------------------
       
   527 // CSAnimIhlPluginTestSuite::TestShowStillImageL
       
   528 //
       
   529 // ---------------------------------------------------------------------------
       
   530 //
       
   531 TInt CTsanimihl::TestShowStillImageL()
       
   532     {
       
   533     iTestObj->Start( iWaiter->iStatus );
       
   534     iWaiter->Activate();
       
   535     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   536     if ( iWaiter->iStatus.Int()== KErrNone )
       
   537         {
       
   538         
       
   539         }
       
   540     //STIF_ASSERT_EQUALS( iFrameCounter, 1 );
       
   541     return KErrNone;
       
   542     }
       
   543 
       
   544 
       
   545 // ---------------------------------------------------------------------------
       
   546 // CSAnimIhlPluginTestSuite::TestShowStillImageWithFrameDelayL
       
   547 //
       
   548 // ---------------------------------------------------------------------------
       
   549 //
       
   550 TInt CTsanimihl::TestShowStillImageWithFrameDelayL()
       
   551     {
       
   552     iTestObj->SetFrameDelay( K1Second );
       
   553     iTestObj->Start( iWaiter->iStatus );
       
   554     iWaiter->Activate();
       
   555     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   556     if ( iWaiter->iStatus.Int()==  KErrNone )
       
   557         {
       
   558         
       
   559         }
       
   560     //STIF_ASSERT_EQUALS( iFrameCounter, 1 );
       
   561     return KErrNone;
       
   562     }
       
   563 
       
   564 
       
   565 // ---------------------------------------------------------------------------
       
   566 // CSAnimIhlPluginTestSuite::TestShowAnimationL
       
   567 //
       
   568 // ---------------------------------------------------------------------------
       
   569 //
       
   570 TInt CTsanimihl::TestShowAnimationL()
       
   571     {
       
   572     iTestObj->Start( iWaiter->iStatus );
       
   573     iWaiter->Activate();
       
   574     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   575     if ( iWaiter->iStatus.Int() == KErrNone )
       
   576         {
       
   577         
       
   578         }
       
   579     //STIF_ASSERT_EQUALS( iFrameCounter, 43 );
       
   580     return KErrNone;
       
   581     }
       
   582 
       
   583 
       
   584 // ---------------------------------------------------------------------------
       
   585 // CSAnimIhlPluginTestSuite::TestShowMultiFrameL
       
   586 //
       
   587 // ---------------------------------------------------------------------------
       
   588 //
       
   589 TInt CTsanimihl::TestShowMultiFrameL()
       
   590     {
       
   591     iTestObj->Start( iWaiter->iStatus );
       
   592     iWaiter->Activate();
       
   593     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   594     if ( iWaiter->iStatus.Int() == KErrNone )
       
   595         {
       
   596         
       
   597         }
       
   598     //STIF_ASSERT_EQUALS( iFrameCounter, 34 );
       
   599     return KErrNone;
       
   600     }
       
   601 
       
   602 
       
   603 // ---------------------------------------------------------------------------
       
   604 // CSAnimIhlPluginTestSuite::TestCancelPlayL
       
   605 //
       
   606 // ---------------------------------------------------------------------------
       
   607 //
       
   608 TInt CTsanimihl::TestCancelPlayL()
       
   609     {
       
   610     iTestObj->SetFrameDelay( K1Second );
       
   611     iTestObj->Start( iWaiter->iStatus );
       
   612     iWaiter->Activate();
       
   613     iTestObj->Cancel();
       
   614     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   615     if ( iWaiter->iStatus.Int()== KErrCancel )
       
   616         {
       
   617         
       
   618         }
       
   619     return KErrNone;
       
   620     }
       
   621 
       
   622 
       
   623 // ---------------------------------------------------------------------------
       
   624 // CSAnimIhlPluginTestSuite::TestBgColourL
       
   625 //
       
   626 // ---------------------------------------------------------------------------
       
   627 //
       
   628 TInt CTsanimihl::TestBgColourL()
       
   629     {
       
   630     TRgb bgColour = iTestObj->BackroundColour();
       
   631     RDebug::Print( _L( "BG color: 0x%08x" ), bgColour.Value() );
       
   632     if ( bgColour.Value()== 0x00bf8040 )
       
   633         {
       
   634         
       
   635         }
       
   636     return KErrNone;
       
   637     }
       
   638 
       
   639 
       
   640 // ---------------------------------------------------------------------------
       
   641 // CSAnimIhlPluginTestSuite::TestBgColourBeforeLoadL
       
   642 //
       
   643 // ---------------------------------------------------------------------------
       
   644 //
       
   645 TInt CTsanimihl::TestBgColourBeforeLoadL()
       
   646     {
       
   647     TRgb bgColour = iTestObj->BackroundColour();
       
   648    // STIF_ASSERT_EQUALS( bgColour.Value(), 0x00FFFFFF );
       
   649     return KErrNone;
       
   650     }
       
   651 
       
   652 
       
   653 // ---------------------------------------------------------------------------
       
   654 // CSAnimIhlPluginTestSuite::TestScaleStillImageL
       
   655 //
       
   656 // ---------------------------------------------------------------------------
       
   657 //
       
   658 TInt CTsanimihl::TestScaleStillImageL()
       
   659     {
       
   660     iTestObj->SetSize( TSize( 126, 126 ) );
       
   661 
       
   662     iTestObj->Load( iFs, KStillImageGray2File, iWaiter->iStatus );
       
   663     iWaiter->Activate();
       
   664     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   665     if ( iWaiter->iStatus.Int()== KErrNone )
       
   666         {
       
   667         
       
   668         }
       
   669 
       
   670     iTestObj->Start( iWaiter->iStatus );
       
   671     iWaiter->Activate();
       
   672     CActiveScheduler::Start(); // Waiter stops it when request completes.
       
   673     if ( iWaiter->iStatus.Int() == KErrNone )
       
   674         {
       
   675         
       
   676         }
       
   677     //STIF_ASSERT_EQUALS( iFrameCounter, 1 );
       
   678     return KErrNone;
       
   679     }
       
   680 
       
   681 
       
   682 // Praveen
       
   683 // EXTERNAL DATA STRUCTURES
       
   684 //extern  ?external_data;
       
   685 
       
   686 // EXTERNAL FUNCTION PROTOTYPES  
       
   687 //extern ?external_function( ?arg_type,?arg_type );
       
   688 
       
   689 // CONSTANTS
       
   690 //const ?type ?constant_var = ?constant;
       
   691 
       
   692 // MACROS
       
   693 //#define ?macro ?macro_def
       
   694 
       
   695 // LOCAL CONSTANTS AND MACROS
       
   696 //const ?type ?constant_var = ?constant;
       
   697 //#define ?macro_name ?macro_def
       
   698 
       
   699 // MODULE DATA STRUCTURES
       
   700 //enum ?declaration
       
   701 //typedef ?declaration
       
   702 
       
   703 // LOCAL FUNCTION PROTOTYPES
       
   704 //?type ?function_name( ?arg_type, ?arg_type );
       
   705 
       
   706 // FORWARD DECLARATIONS
       
   707 //class ?FORWARD_CLASSNAME;
       
   708 
       
   709 // ============================= LOCAL FUNCTIONS ===============================
       
   710 
       
   711 // -----------------------------------------------------------------------------
       
   712 // ?function_name ?description.
       
   713 // ?description
       
   714 // Returns: ?value_1: ?description
       
   715 //          ?value_n: ?description_line1
       
   716 //                    ?description_line2
       
   717 // -----------------------------------------------------------------------------
       
   718 //
       
   719 /*
       
   720 ?type ?function_name(
       
   721     ?arg_type arg,  // ?description
       
   722     ?arg_type arg)  // ?description
       
   723     {
       
   724 
       
   725     ?code  // ?comment
       
   726 
       
   727     // ?comment
       
   728     ?code
       
   729     }
       
   730 */
       
   731 
       
   732 // ============================ MEMBER FUNCTIONS ===============================
       
   733 
       
   734 // -----------------------------------------------------------------------------
       
   735 // CTsanimihl::Delete
       
   736 // Delete here all resources allocated and opened from test methods. 
       
   737 // Called from destructor. 
       
   738 // -----------------------------------------------------------------------------
       
   739 //
       
   740 void CTsanimihl::Delete() 
       
   741     {
       
   742 
       
   743     }
       
   744 
       
   745 
       
   746 
       
   747 
       
   748 // -----------------------------------------------------------------------------
       
   749 // CTsanimihl::ExampleL
       
   750 // Example test method function.
       
   751 // (other items were commented in a header).
       
   752 // -----------------------------------------------------------------------------
       
   753 //
       
   754 TInt CTsanimihl::ExampleL( CStifItemParser& aItem )
       
   755     {
       
   756 
       
   757     // Print to UI
       
   758     _LIT( KTsanimihl, "Tsanimihl" );
       
   759     _LIT( KExample, "In Example" );
       
   760     TestModuleIf().Printf( 0, KTsanimihl, KExample );
       
   761     // Print to log file
       
   762     iLog->Log( KExample );
       
   763 
       
   764     TInt i = 0;
       
   765     TPtrC string;
       
   766     _LIT( KParam, "Param[%i]: %S" );
       
   767     while ( aItem.GetNextString ( string ) == KErrNone )
       
   768         {
       
   769         TestModuleIf().Printf( i, KTsanimihl, 
       
   770                                 KParam, i, &string );
       
   771         i++;
       
   772         }
       
   773 
       
   774     return KErrNone;
       
   775 
       
   776     }
       
   777 
       
   778 
       
   779 
       
   780 // -----------------------------------------------------------------------------
       
   781 // CTsanimihl::?member_function
       
   782 // ?implementation_description
       
   783 // (other items were commented in a header).
       
   784 // -----------------------------------------------------------------------------
       
   785 //
       
   786 /*
       
   787 TInt CTsanimihl::?member_function(
       
   788    CItemParser& aItem )
       
   789    {
       
   790 
       
   791    ?code
       
   792 
       
   793    }
       
   794 */
       
   795 
       
   796 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   797 // None
       
   798 
       
   799 //  [End of File] - Do not remove
       
   800 
       
   801 // End of File