mpx/tsrc/public/basic/playbackplugintest/src/playbackplugintest.cpp
changeset 64 92dbd2a406d9
equal deleted inserted replaced
61:3b098142db83 64:92dbd2a406d9
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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:  Scripted Tests for MPX Playback Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <Stiftestinterface.h>
       
    20 #include <mpxplaybackutility.h>
       
    21 #include "playbackplugintest.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CPlaybackPluginTest::Cplaybackplugintest
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CPlaybackPluginTest::CPlaybackPluginTest( CTestModuleIf& aTestModuleIf ):
       
    33         CBaseTest( aTestModuleIf )
       
    34     {   
       
    35     }   
       
    36 
       
    37 // Destructor
       
    38 CPlaybackPluginTest::~CPlaybackPluginTest()
       
    39     {        
       
    40     // Delete resources allocated from test methods
       
    41     Delete();
       
    42     
       
    43     iPlaybackUtility->Close();
       
    44     iPlaybackUtility = NULL;
       
    45     }
       
    46     
       
    47 // -----------------------------------------------------------------------------
       
    48 // CPlaybackPluginTest::NewL
       
    49 // Two-phased constructor.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CPlaybackPluginTest* CPlaybackPluginTest::NewL( CTestModuleIf& aTestModuleIf )
       
    53     {
       
    54     CPlaybackPluginTest* self = 
       
    55         new (ELeave) CPlaybackPluginTest( aTestModuleIf );
       
    56 
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL();
       
    59     CleanupStack::Pop();
       
    60 
       
    61     return self;
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CPlaybackPluginTest::ConstructL
       
    66 // Symbian 2nd phase constructor can leave.
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CPlaybackPluginTest::ConstructL()
       
    70     {
       
    71     CBaseTest::ConstructL();
       
    72     
       
    73     iLog = CStifLogger::NewL( KPlaybackPluginTestLogPath, 
       
    74                       KPlaybackPluginTestLogFile,
       
    75                       CStifLogger::ETxt,
       
    76                       CStifLogger::EFile,
       
    77                       EFalse );
       
    78     }
       
    79 
       
    80 //-----------------------------------------------------------------------------
       
    81 // CPlaybackPluginTest::SendTestClassVersion
       
    82 // Method used to send version of test class
       
    83 //-----------------------------------------------------------------------------
       
    84 //
       
    85 void CPlaybackPluginTest::SendTestClassVersion()
       
    86     {
       
    87     TVersion moduleVersion;
       
    88     moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
       
    89     moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
       
    90     moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
       
    91     
       
    92     TFileName moduleName;
       
    93     moduleName = _L("playbackplugintest.dll");
       
    94 
       
    95     TBool newVersionOfMethod = ETrue;
       
    96     TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, 
       
    97                                         newVersionOfMethod);
       
    98     }
       
    99 
       
   100 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // LibEntryL is a polymorphic Dll entry point.
       
   104 // Returns: CScriptBase: New CScriptBase derived object
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 EXPORT_C CScriptBase* LibEntryL( 
       
   108     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   109     {
       
   110 
       
   111     return ( CScriptBase* ) CPlaybackPluginTest::NewL( aTestModuleIf );
       
   112 
       
   113     }
       
   114 
       
   115 
       
   116 //  End of File