stif/TestEngine/src/TestEngineClient.cpp
branchRCL_3
changeset 40 07b41fa8d1dd
parent 39 3406c99bc375
child 43 ca8a1b6995f6
equal deleted inserted replaced
39:3406c99bc375 40:07b41fa8d1dd
     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 module contains implementation of 
       
    15 * RTestEngineServer class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32svr.h>
       
    21 #include "TestEngineClient.h"
       
    22 #include "TestEngineCommon.h"
       
    23 
       
    24 // EXTERNAL DATA STRUCTURES
       
    25 // None
       
    26 
       
    27 // EXTERNAL FUNCTION PROTOTYPES  
       
    28 // None
       
    29 
       
    30 // CONSTANTS
       
    31 // None
       
    32 
       
    33 // MACROS
       
    34 // None
       
    35 
       
    36 // LOCAL CONSTANTS AND MACROS
       
    37 // None
       
    38 
       
    39 // MODULE DATA STRUCTURES
       
    40 // None
       
    41 
       
    42 // LOCAL FUNCTION PROTOTYPES
       
    43 // None
       
    44 
       
    45 // FORWARD DECLARATIONS
       
    46 // None
       
    47 
       
    48 // ==================== LOCAL FUNCTIONS =======================================
       
    49 // None
       
    50 
       
    51 // ================= MEMBER FUNCTIONS =========================================
       
    52 
       
    53 /*
       
    54 -------------------------------------------------------------------------------
       
    55 
       
    56     Class: RTestEngineServer
       
    57 
       
    58     Method: Connect
       
    59 
       
    60     Description: Connect method creates new RTestEngineServer session.
       
    61 
       
    62     RTestEngineServer session is used to manage the test case execution.
       
    63 
       
    64     Parameters: None
       
    65 
       
    66     Return Values: TInt KErrNone : TestEngineServer created successfully
       
    67 
       
    68     Errors/Exceptions: None
       
    69 
       
    70     Status: Approved
       
    71 
       
    72 -------------------------------------------------------------------------------
       
    73 */
       
    74 EXPORT_C TInt RTestEngineServer::Connect()
       
    75     {
       
    76     TInt ret = StartEngine();
       
    77     if ( ret == KErrNone)
       
    78         {
       
    79         ret = CreateSession( KTestEngineName, Version() );
       
    80         }
       
    81     return ret;
       
    82 
       
    83     }
       
    84 
       
    85 /*
       
    86 -------------------------------------------------------------------------------
       
    87 
       
    88     Class: RTestEngineServer
       
    89 
       
    90     Method: Version
       
    91 
       
    92     Description: Return client side version number from RTestEngineServer.
       
    93 
       
    94     Parameters: None
       
    95 
       
    96     Return Values: TVersion : Version number from RTestEngineServer
       
    97 
       
    98     Errors/Exceptions: None
       
    99 
       
   100     Status: Approved
       
   101 
       
   102 -------------------------------------------------------------------------------
       
   103 */
       
   104 EXPORT_C TVersion RTestEngineServer::Version() const
       
   105     {
       
   106     return ( TVersion( KTestEngineMajorVersionNumber,
       
   107         KTestEngineMinorVersionNumber, KTestEngineBuildVersionNumber ) );
       
   108 
       
   109     }
       
   110 
       
   111 /*
       
   112 -------------------------------------------------------------------------------
       
   113 
       
   114     Class: RTestEngineServer
       
   115 
       
   116     Method: Close
       
   117 
       
   118     Description: Closes the RTestEngineServer session.
       
   119 
       
   120     Parameters: None
       
   121 
       
   122     Return Values: None
       
   123 
       
   124     Errors/Exceptions: None
       
   125 
       
   126     Status: Approved
       
   127 
       
   128 -------------------------------------------------------------------------------
       
   129 */
       
   130 EXPORT_C void RTestEngineServer::Close()
       
   131     {
       
   132     // Check that server is connected
       
   133     if ( Handle() != 0 )
       
   134         {
       
   135         TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   136         SendReceive( ETestEngineServerCloseSession, args );
       
   137         }
       
   138     RSessionBase::Close();
       
   139 
       
   140     }
       
   141 
       
   142 /*
       
   143 -------------------------------------------------------------------------------
       
   144 
       
   145     DESCRIPTION
       
   146 
       
   147     This module contains implementation of RTestEngine class member functions.
       
   148 
       
   149 -------------------------------------------------------------------------------
       
   150 */
       
   151 
       
   152 // ================= MEMBER FUNCTIONS =========================================
       
   153 
       
   154 /*
       
   155 -------------------------------------------------------------------------------
       
   156 
       
   157     Class: RTestEngine
       
   158 
       
   159     Method: Open
       
   160 
       
   161     Description: Open creates a subsession to TestEngine.
       
   162 
       
   163     Parameters: RTestEngineServer& aServer : Handle to Test Engine Server
       
   164                 const TFileName& aIniFile : Ini file to be used for 
       
   165                  initialization of the Test Engine
       
   166 
       
   167     Return Values: TInt: Symbian OS error code
       
   168 
       
   169     Errors/Exceptions: None
       
   170 
       
   171     Status: Approved
       
   172 
       
   173 -------------------------------------------------------------------------------
       
   174 */
       
   175 EXPORT_C TInt RTestEngine::Open( RTestEngineServer& aServer,
       
   176                                  const TFileName& aIniFile )
       
   177     {
       
   178     TIpcArgs args( &aIniFile, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   179     return CreateSubSession( aServer, ETestEngineCreateSubSession, args );
       
   180     }
       
   181 
       
   182 /*
       
   183 -------------------------------------------------------------------------------
       
   184 
       
   185     Class: RTestEngine
       
   186 
       
   187     Method: Close
       
   188 
       
   189     Description: Close the RTestEngine subsession.
       
   190 
       
   191     Parameters: None
       
   192 
       
   193     Return Values: None
       
   194 
       
   195     Errors/Exceptions: None
       
   196 
       
   197     Status: Approved
       
   198 
       
   199 -------------------------------------------------------------------------------
       
   200 */
       
   201 EXPORT_C void RTestEngine::Close()
       
   202     {
       
   203     RSubSessionBase::CloseSubSession( ETestEngineCloseSubSession );
       
   204 
       
   205     }
       
   206 
       
   207 /*
       
   208 -------------------------------------------------------------------------------
       
   209 
       
   210     Class: RTestEngine
       
   211 
       
   212     Method: SetAttribute
       
   213 
       
   214     Description: Sets attributes to Test Framework
       
   215 
       
   216     Parameters: TAttribute aAttribute: in: Attribute type
       
   217                 const TDesC& aValue: in: Attribute value
       
   218 
       
   219     Return Values: TInt: Symbian OS error code
       
   220 
       
   221     Errors/Exceptions: None
       
   222 
       
   223     Status: Proposal
       
   224 
       
   225 -------------------------------------------------------------------------------
       
   226 */
       
   227 EXPORT_C TInt RTestEngine::SetAttribute( TAttribute aAttribute,
       
   228                                           const TDesC& aValue )
       
   229     {
       
   230     TIpcArgs args( aAttribute, &aValue, TIpcArgs::ENothing );
       
   231     return SendReceive( ETestEngineSetAttribute, args );
       
   232     }
       
   233 
       
   234 /*
       
   235 -------------------------------------------------------------------------------
       
   236 
       
   237     Class: RTestEngine
       
   238 
       
   239     Method: AddTestModule
       
   240 
       
   241     Description: Load dynamically a new Test Module to the Test Framework.
       
   242 
       
   243     Parameters: const TName& aTestModule : Name of the Test Module to be added
       
   244                 const TFileName& aIniFile : Initialization file of Test Module
       
   245 
       
   246     Return Values: TInt: Symbian OS error code
       
   247 
       
   248     Errors/Exceptions: None
       
   249 
       
   250     Status: Approved
       
   251 
       
   252 -------------------------------------------------------------------------------
       
   253 */
       
   254 EXPORT_C TInt RTestEngine::AddTestModule( const TName& aTestModule,
       
   255                                           const TFileName& aIniFile )
       
   256     {
       
   257     TIpcArgs args( &aTestModule, &aIniFile, TIpcArgs::ENothing );
       
   258     return SendReceive( ETestEngineAddTestModule, args );
       
   259     }
       
   260 
       
   261 /*
       
   262 -------------------------------------------------------------------------------
       
   263 
       
   264     Class: RTestEngine
       
   265 
       
   266     Method: RemoveTestModule
       
   267 
       
   268     Description: Remove the existing Test Module from the Test Framework.
       
   269 
       
   270     Parameters: const TName& aTestModule : Name of the Test Module to be 
       
   271                                            removed
       
   272 
       
   273     Return Values: TInt: Symbian OS error code
       
   274 
       
   275     Errors/Exceptions: None
       
   276 
       
   277     Status: Approved
       
   278 
       
   279 -------------------------------------------------------------------------------
       
   280 */
       
   281 EXPORT_C TInt RTestEngine::RemoveTestModule( const TName& aTestModule )
       
   282     {
       
   283     TIpcArgs args( &aTestModule, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   284     return SendReceive( ETestEngineRemoveTestModule, args );
       
   285 
       
   286     }
       
   287 
       
   288 /*
       
   289 -------------------------------------------------------------------------------
       
   290 
       
   291     Class: RTestEngine
       
   292 
       
   293     Method: AddConfigFile
       
   294 
       
   295     Description: Add new config file to Test Module.
       
   296 
       
   297     Parameters: const TName& aTestModule : Name of Test Module where the config
       
   298                  file will be added
       
   299                 const TFileName& aConfigFile : Name of config file to be added
       
   300 
       
   301     Return Values: TInt: Symbian OS error code
       
   302 
       
   303     Errors/Exceptions: None
       
   304 
       
   305     Status: Approved
       
   306 
       
   307 -------------------------------------------------------------------------------
       
   308 */
       
   309 EXPORT_C TInt RTestEngine::AddConfigFile( const TName& aTestModule,
       
   310                                           const TFileName& aConfigFile )
       
   311     {
       
   312     TIpcArgs args( &aTestModule, &aConfigFile, TIpcArgs::ENothing );
       
   313     return SendReceive( ETestEngineAddConfigFile, args );
       
   314 
       
   315     }
       
   316 
       
   317 /*
       
   318 -------------------------------------------------------------------------------
       
   319 
       
   320     Class: RTestEngine
       
   321 
       
   322     Method: RemoveConfigFile
       
   323 
       
   324     Description: Remove config file from Test Module.
       
   325 
       
   326     Parameters: const TName& aTestModule : Test Module name
       
   327                 const TFileName& aConfigFile : Name of config file to be removed
       
   328 
       
   329     Return Values: TInt: Symbian OS error code
       
   330 
       
   331     Errors/Exceptions: None
       
   332 
       
   333     Status: Proposal
       
   334 
       
   335 -------------------------------------------------------------------------------
       
   336 */
       
   337 EXPORT_C TInt RTestEngine::RemoveConfigFile( const TName& aTestModule,
       
   338                                              const TFileName& aConfigFile )
       
   339     {
       
   340     TIpcArgs args( &aTestModule, &aConfigFile, TIpcArgs::ENothing );
       
   341     return SendReceive( ETestEngineRemoveConfigFile, args );
       
   342     }
       
   343 
       
   344 /*
       
   345 -------------------------------------------------------------------------------
       
   346 
       
   347     Class: RTestEngine
       
   348 
       
   349     Method: EnumerateTestCases
       
   350 
       
   351     Description: First phase of two-phased test case query operation.
       
   352 
       
   353     Test cases are inquired by two-phased operation calling first the 
       
   354     EnumerateTestCases method and then the GetTestCases. 
       
   355 
       
   356     Parameters: TInt& aCount : Test case count
       
   357                 TRequestStatus& aStatus : Request status
       
   358 
       
   359     Return Values: None
       
   360 
       
   361     Errors/Exceptions: None
       
   362 
       
   363     Status: Approved
       
   364 
       
   365 -------------------------------------------------------------------------------
       
   366 */
       
   367 EXPORT_C void RTestEngine::EnumerateTestCases( TCaseCount& aCount,
       
   368                                               TRequestStatus& aStatus )
       
   369     {
       
   370     TIpcArgs args( &aCount, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   371     SendReceive( ETestEngineEnumerateTestCases, args, aStatus );
       
   372     }
       
   373 
       
   374 /*
       
   375 -------------------------------------------------------------------------------
       
   376 
       
   377     Class: RTestEngine
       
   378 
       
   379     Method: GetTestCases
       
   380 
       
   381     Description: Second phase of two-phased test case query operation.
       
   382 
       
   383     GetTestCases retrieves test cases from Test Modules to aTestCases that is
       
   384     a list consisting of several TTestInfo objects.
       
   385 
       
   386     Parameters: CArrayFixFlat<TTestInfo>& aTestCaseBuffer : Test case array
       
   387 
       
   388     Return Values: TInt: Symbian OS error code
       
   389 
       
   390     Errors/Exceptions: None
       
   391 
       
   392     Status: Approved
       
   393 
       
   394 -------------------------------------------------------------------------------
       
   395 */
       
   396 EXPORT_C TInt RTestEngine::GetTestCases( 
       
   397                      CFixedFlatArray<TTestInfo>& aTestCaseBuffer )
       
   398     {
       
   399     // Construct and send message
       
   400     TIpcArgs args( &aTestCaseBuffer.Des(), TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   401     return SendReceive( ETestEngineGetTestCases, args );
       
   402 
       
   403     }
       
   404 
       
   405 /*
       
   406 -------------------------------------------------------------------------------
       
   407 
       
   408     Class: RTestEngine
       
   409 
       
   410     Method: ErrorNotification
       
   411 
       
   412     Description: Obtains error notifications from Test Engine and Test
       
   413     Servers via Test Engine.
       
   414 
       
   415     Parameters: TTestProgressPckg& aError : Error package
       
   416                 TRequestStatus& aStatus : Request status
       
   417 
       
   418     Return Values: None
       
   419 
       
   420     Errors/Exceptions: None
       
   421 
       
   422     Status: Approved
       
   423 
       
   424 -------------------------------------------------------------------------------
       
   425 */ 
       
   426 EXPORT_C void RTestEngine::ErrorNotification( TErrorNotificationPckg& aError,
       
   427                                               TRequestStatus& aStatus )
       
   428     {
       
   429     TIpcArgs args( &aError, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   430     SendReceive( ETestEngineErrorNotification, args, aStatus );
       
   431 
       
   432     }
       
   433 
       
   434 /*
       
   435 -------------------------------------------------------------------------------
       
   436 
       
   437     Class: RTestEngine
       
   438 
       
   439     Method: CancelAsyncRequest
       
   440 
       
   441     Description: Asynchronous requests can be canceled by this function.
       
   442 
       
   443     Parameters: TInt aReqToCancel : Request to be cancelled
       
   444 
       
   445     Return Values: TInt: Symbian OS error code
       
   446 
       
   447     Errors/Exceptions: None
       
   448 
       
   449     Status: Approved
       
   450 
       
   451 -------------------------------------------------------------------------------
       
   452 */
       
   453 EXPORT_C TInt RTestEngine::CancelAsyncRequest( TInt aReqToCancel )
       
   454     {
       
   455     TIpcArgs args( aReqToCancel, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   456     return SendReceive( ETestEngineCancelAsyncRequest, args );
       
   457 
       
   458     }
       
   459 
       
   460 /*
       
   461 -------------------------------------------------------------------------------
       
   462 
       
   463     Class: RTestEngine
       
   464 
       
   465     Method: Event
       
   466 
       
   467     Description: Used to control STIF Test Framework event system.
       
   468 
       
   469     Parameters: TEventIfPckg& aEvent : in : Event information
       
   470                  TRequestStatus& aStatus : in :  Request status
       
   471 
       
   472     Return Values: TInt KErrNone : No errors occurred
       
   473 
       
   474     Errors/Exceptions: None
       
   475 
       
   476     Status: Approved
       
   477 
       
   478 -------------------------------------------------------------------------------
       
   479 */
       
   480 EXPORT_C void RTestEngine::Event( TEventIfPckg& aEvent, 
       
   481                                   TRequestStatus& aStatus )
       
   482     {
       
   483     TIpcArgs args( &aEvent, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   484     SendReceive( ETestEngineEvent, args, aStatus );
       
   485 
       
   486     }
       
   487 
       
   488 /*
       
   489 -------------------------------------------------------------------------------
       
   490 
       
   491     Class: RTestEngine
       
   492 
       
   493     Method: OpenLoggerSession
       
   494 
       
   495     Description: Open created subsession to TestEngine.
       
   496 
       
   497     Parameters: RTestEngineServer& aServer : Handle to Test Engine Server
       
   498                 TLoggerSettings& aLoggerSettings: in: Logger's overwrite struct
       
   499 
       
   500     Return Values: TInt KErrNone: TestEngine opened and initialized
       
   501                                   succesfully
       
   502 
       
   503     Errors/Exceptions: None
       
   504 
       
   505     Status: Approved
       
   506 
       
   507 -------------------------------------------------------------------------------
       
   508 */
       
   509 EXPORT_C TInt RTestEngine::OpenLoggerSession( RTestEngineServer& aServer, 
       
   510                                             TLoggerSettings& aLoggerSettings )
       
   511     {
       
   512     // Package
       
   513     TPckg<TLoggerSettings> loggerSettingsPckg( aLoggerSettings );
       
   514 
       
   515     TIpcArgs args( &loggerSettingsPckg, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   516     // Goes to CTestEngine's DispatchMessageL() method
       
   517     CreateSubSession( aServer, ETestEngineLoggerSettings, args );
       
   518     RSubSessionBase::CloseSubSession( ETestEngineCloseLoggerSettings );
       
   519 
       
   520     return KErrNone;
       
   521 
       
   522     }
       
   523 
       
   524 /*
       
   525 -------------------------------------------------------------------------------
       
   526 
       
   527     Class: RTestEngine
       
   528 
       
   529     Method: AddTestCaseResultToTestReport
       
   530 
       
   531     Description: Sends info about executed test cases to test engine, which
       
   532                  will forward it to test report.
       
   533                  This is used when after reboot UIStore reads info about 
       
   534                  executed test cases before reboot.
       
   535 
       
   536     Parameters: TTestIngo& aTestInfo : test info structure
       
   537                 TFullTestResult& aTestResult: test result structure
       
   538                 TInt aError: error
       
   539 
       
   540     Return Values: TInt error code returned by test engine
       
   541 
       
   542     Errors/Exceptions: None
       
   543 
       
   544     Status: Approved
       
   545 
       
   546 -------------------------------------------------------------------------------
       
   547 */
       
   548 EXPORT_C TInt RTestEngine::AddTestCaseResultToTestReport(const TTestInfo& aTestInfo,
       
   549                                                          const TFullTestResult& aTestResult,
       
   550                                                          const TInt aError)
       
   551     {
       
   552     // Create packages
       
   553     TTestInfoPckg testInfoPckg(aTestInfo);
       
   554     TFullTestResultPckg fullTestResultPckg(aTestResult);
       
   555 
       
   556     // Create argument list
       
   557     TIpcArgs args(&testInfoPckg, &fullTestResultPckg, aError);
       
   558 
       
   559     // Send it to test engine
       
   560     TInt res = SendReceive(ETestEngineReportTestCase, args);
       
   561 
       
   562     return res;
       
   563     }
       
   564 
       
   565 /*
       
   566 -------------------------------------------------------------------------------
       
   567 
       
   568     DESCRIPTION
       
   569 
       
   570     This module contains implementation of RTestCase class member functions.
       
   571 
       
   572 -------------------------------------------------------------------------------
       
   573 */
       
   574 
       
   575 // ================= MEMBER FUNCTIONS =========================================
       
   576 
       
   577 /*
       
   578 -------------------------------------------------------------------------------
       
   579 
       
   580     Class: RTestCase
       
   581 
       
   582     Method: Open
       
   583 
       
   584     Description: Open creates a subsession to TestCase.
       
   585 
       
   586     Parameters: RTestEngineServer& aServer : Handle to Test Engine Server
       
   587                 const TTestInfoPckg& aTestCaseInfo : TTestInfoPckg : Test info
       
   588                                                                      package
       
   589 
       
   590     Return Values: TInt: Symbian OS error code
       
   591 
       
   592     Errors/Exceptions: None
       
   593 
       
   594     Status: Approved
       
   595 
       
   596 -------------------------------------------------------------------------------
       
   597 */
       
   598 EXPORT_C TInt RTestCase::Open( RTestEngineServer& aServer,
       
   599                               const TTestInfoPckg& aTestCaseInfo )
       
   600     {
       
   601     TIpcArgs args( &aTestCaseInfo, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   602     return CreateSubSession( aServer, ETestCaseCreateSubSession, args );
       
   603     }
       
   604 
       
   605 /*
       
   606 -------------------------------------------------------------------------------
       
   607 
       
   608     Class: RTestCase
       
   609 
       
   610     Method: Close
       
   611 
       
   612     Description: Close the RTestCase subsession.
       
   613 
       
   614     Parameters: None
       
   615 
       
   616     Return Values: None
       
   617 
       
   618     Errors/Exceptions: None
       
   619 
       
   620     Status: Approved
       
   621 
       
   622 -------------------------------------------------------------------------------
       
   623 */
       
   624 EXPORT_C void RTestCase::Close()
       
   625     {
       
   626     RSubSessionBase::CloseSubSession( ETestCaseCloseSubSession );
       
   627 
       
   628     }
       
   629 
       
   630 /*
       
   631 -------------------------------------------------------------------------------
       
   632 
       
   633     Class: RTestCase
       
   634 
       
   635     Method: RunTestCase
       
   636 
       
   637     Description: Run a test case asynchronously.
       
   638 
       
   639     Parameters: TFullTestResultPckg& aTestResult : TFullTestResult :
       
   640                  Test Result package
       
   641                 TRequestStatus& aStatus : Request status
       
   642 
       
   643     Return Values: TInt KErrNone : Test case could be run
       
   644                         Other error code : Reason the test case couldn't be run
       
   645 
       
   646     Errors/Exceptions: None
       
   647 
       
   648     Status: Approved
       
   649 
       
   650 -------------------------------------------------------------------------------
       
   651 */
       
   652 EXPORT_C void RTestCase::RunTestCase( TFullTestResultPckg& aTestResult,
       
   653                                      TRequestStatus& aStatus )
       
   654     {
       
   655     TIpcArgs args( &aTestResult, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   656     SendReceive( ETestCaseRunTestCase, args, aStatus );
       
   657     }
       
   658 
       
   659 /*
       
   660 -------------------------------------------------------------------------------
       
   661 
       
   662     Class: RTestCase
       
   663 
       
   664     Method: RunTestCase
       
   665 
       
   666     Description: Run a test case asynchronously.
       
   667 
       
   668     Parameters: TFullTestResultPckg& aTestResult : TFullTestResult :
       
   669                  Test Result package
       
   670                 const TDesC& aTestCaseArgs: Test case arguments
       
   671                 TRequestStatus& aStatus : Request status
       
   672 
       
   673     Return Values: TInt KErrNone : Test case could be run
       
   674                         Other error code : Reason the test case couldn't be run
       
   675 
       
   676     Errors/Exceptions: None
       
   677 
       
   678     Status: Approved
       
   679 
       
   680 -------------------------------------------------------------------------------
       
   681 */
       
   682 EXPORT_C void RTestCase::RunTestCase( TFullTestResultPckg& aTestResult,
       
   683                                       const TDesC& aTestCaseArgs,
       
   684                                       TRequestStatus& aStatus )
       
   685     {
       
   686     TIpcArgs args( &aTestResult, &aTestCaseArgs, TIpcArgs::ENothing );
       
   687     SendReceive( ETestCaseRunTestCase, args, aStatus );
       
   688     }
       
   689 
       
   690 /*
       
   691 -------------------------------------------------------------------------------
       
   692 
       
   693     Class: RTestCase
       
   694 
       
   695     Method: Pause
       
   696 
       
   697     Description: Pause suspends the execution of the test case.
       
   698 
       
   699     Parameters: None
       
   700 
       
   701     Return Values: TInt: Symbian OS error code
       
   702 
       
   703     Errors/Exceptions: None
       
   704 
       
   705     Status: Approved
       
   706 
       
   707 -------------------------------------------------------------------------------
       
   708 */
       
   709 EXPORT_C TInt RTestCase::Pause()
       
   710     {
       
   711     TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   712     return SendReceive( ETestCasePause, args );
       
   713     }
       
   714 
       
   715 /*
       
   716 -------------------------------------------------------------------------------
       
   717 
       
   718     Class: RTestCase
       
   719 
       
   720     Method: Resume
       
   721 
       
   722     Description: Resume the test case suspended previously.
       
   723 
       
   724     Parameters: None
       
   725 
       
   726     Return Values: TInt: Symbian OS error code
       
   727 
       
   728     Errors/Exceptions: None
       
   729 
       
   730     Status: Approved
       
   731 
       
   732 -------------------------------------------------------------------------------
       
   733 */
       
   734 EXPORT_C TInt RTestCase::Resume()
       
   735     {
       
   736     TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   737     return SendReceive( ETestCaseResume, args );
       
   738     }
       
   739 
       
   740 /*
       
   741 -------------------------------------------------------------------------------
       
   742 
       
   743     Class: RTestCase
       
   744 
       
   745     Method: NotifyProgress
       
   746 
       
   747     Description: Request different progress information from the test case.
       
   748 
       
   749     Parameters: TTestProgressPckg& aProgress : TTestProgress : Test Progress
       
   750                                                                package
       
   751                 TRequestStatus& aStatus : Request status
       
   752 
       
   753     Return Values: None
       
   754 
       
   755     Errors/Exceptions: None
       
   756 
       
   757     Status: Approved
       
   758 
       
   759 -------------------------------------------------------------------------------
       
   760 */
       
   761 EXPORT_C void RTestCase::NotifyProgress( TTestProgressPckg& aProgress,
       
   762                                          TRequestStatus& aStatus )
       
   763     {
       
   764     TIpcArgs args( &aProgress, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   765     SendReceive( ETestCaseNotifyProgress, args, aStatus );
       
   766     }
       
   767     
       
   768 /*
       
   769 -------------------------------------------------------------------------------
       
   770 
       
   771     Class: RTestCase
       
   772 
       
   773     Method: NotifyRemoteType
       
   774 
       
   775     Description: Request remote commands information from the test case.
       
   776 
       
   777     Parameters: TRemoteCommandPckg& aType: in: Request type
       
   778                 TRequestStatus& aStatus : Request status
       
   779 
       
   780     Return Values: None
       
   781 
       
   782     Errors/Exceptions: None
       
   783 
       
   784     Status: Proposal
       
   785 
       
   786 -------------------------------------------------------------------------------
       
   787 */
       
   788 EXPORT_C void RTestCase::NotifyRemoteType( TStifCommandPckg& aType,
       
   789                                            TPckg<TInt>& aMsgSize,
       
   790                                            TRequestStatus& aStatus )
       
   791     {
       
   792     TIpcArgs args( &aType, &aMsgSize, TIpcArgs::ENothing );
       
   793     SendReceive( ETestCaseNotifyRemoteType, args, aStatus );
       
   794     }
       
   795 
       
   796 /*
       
   797 -------------------------------------------------------------------------------
       
   798 
       
   799     Class: RTestCase
       
   800 
       
   801     Method: NotifyRemoteMsg
       
   802 
       
   803     Description: Request remote commands information from the test case.
       
   804 
       
   805     Parameters: TDesC& aMessage: in: Message buffer
       
   806                 TRemoteCmdType aType: in: Message direction
       
   807 
       
   808     Return Values: None
       
   809 
       
   810     Errors/Exceptions: None
       
   811 
       
   812     Status: Proposal
       
   813 
       
   814 -------------------------------------------------------------------------------
       
   815 */
       
   816 EXPORT_C TInt RTestCase::NotifyRemoteMsg( TDes8& aMessage,
       
   817                                           TStifCommand aType )
       
   818     {
       
   819     TIpcArgs args( &aMessage, aType, aMessage.Length() );
       
   820     return SendReceive( ETestCaseNotifyRemoteMsg, args );
       
   821     }
       
   822 
       
   823 /*
       
   824 -------------------------------------------------------------------------------
       
   825 
       
   826     Class: RTestCase
       
   827 
       
   828     Method: CancelAsyncRequest
       
   829 
       
   830     Description: Asynchronous requests can be canceled by this function.
       
   831 
       
   832     Parameters: TInt aReqToCancel : Request to be cancelled
       
   833 
       
   834     Return Values: TInt: Symbian OS error code
       
   835 
       
   836     Errors/Exceptions: None
       
   837 
       
   838     Status: Approved
       
   839 
       
   840 -------------------------------------------------------------------------------
       
   841 */
       
   842 EXPORT_C TInt RTestCase::CancelAsyncRequest( TInt aReqToCancel )
       
   843     {
       
   844     TIpcArgs args( aReqToCancel, TIpcArgs::ENothing, TIpcArgs::ENothing );
       
   845     return SendReceive( ETestCaseCancelAsyncRequest, args );
       
   846     }
       
   847 
       
   848 // ================= OTHER EXPORTED FUNCTIONS =================================
       
   849 
       
   850 // None
       
   851 
       
   852 // End of File