testexecfw/stf/stffw/testsrv/src/TestServerClient.cpp
author Johnson Ma <johnson.ma@nokia.com>
Fri, 09 Apr 2010 10:46:28 +0800
changeset 2 8bb370ba6d1d
permissions -rw-r--r--
contribute STF 1.0.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     1
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     8
*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    11
*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    12
* Contributors:
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    13
* 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    14
* Description: This module contains implementation of RTestServer, 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    15
* RTestModule and RTestExecution class member functions.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    16
*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    17
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    18
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    19
// INCLUDE FILES
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    20
#include <e32svr.h>
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    21
#include <stifinternal/TestServerClient.h>
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    22
#include "TestServerCommon.h"
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    23
//--PYTHON-- begin
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    24
#include "StifPython.h"
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    25
//--PYTHON-- end
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    26
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    27
// EXTERNAL DATA STRUCTURES
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    28
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    29
// EXTERNAL FUNCTION PROTOTYPES
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    30
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    31
// CONSTANTS
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    32
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    33
// MACROS
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    34
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    35
// LOCAL CONSTANTS AND MACROS
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    36
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    37
// MODULE DATA STRUCTURES
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    38
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    39
// LOCAL FUNCTION PROTOTYPES
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    40
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    41
// FORWARD DECLARATIONS
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    42
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    43
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    44
// ==================== LOCAL FUNCTIONS =======================================
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    45
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    46
// None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    47
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    48
// ================= MEMBER FUNCTIONS =========================================
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    49
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    50
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    51
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    52
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    53
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    54
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    55
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    56
    Method: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    57
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    58
    Description: Default constructor
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    59
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    60
    C++ default constructor can NOT contain any code, that
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    61
    might leave.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    62
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    63
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    64
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    65
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    66
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    67
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    68
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    69
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    70
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    71
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    72
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    73
EXPORT_C RTestServer::RTestServer()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    74
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    75
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    76
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    77
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    78
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    79
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    80
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    81
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    82
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    83
    Method: Connect
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    84
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    85
    Description: Connect method creates new RTestServer session.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    86
    RTestServer session is used to manage the test case execution.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    87
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    88
    Parameters: const TFileName& aModuleName: in: Module to be loaded
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    89
                const TDesC& aConfigFile: in: Test case(config) file
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    90
                name(Used in TestScripter case for parsing STIF settings).
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    91
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    92
    Return Values: TInt Error code
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    93
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    94
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    95
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    96
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    97
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    98
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
    99
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   100
EXPORT_C TInt RTestServer::Connect( const TFileName& aModuleName,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   101
                                    const TDesC& aConfigFile
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   102
                                    )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   103
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   104
    TFileName serverName;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   105
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   106
    TInt ret = KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   107
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   108
    // Create global semaphore start-up. It will be indexed (if given name already exsists, index will be increased)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   109
    RSemaphore startSemaphore;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   110
    TName semaphoreName = _L("startupSemaphore");
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   111
    semaphoreName.Append( aModuleName );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   112
    TInt x = 0;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   113
    RBuf semName;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   114
    ret = semName.Create(KMaxName);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   115
    if(ret != KErrNone)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   116
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   117
        RDebug::Print(_L("RTestServer::Connect() Could not create buffer for semaphore name [%d]"), ret);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   118
        return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   119
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   120
    do
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   121
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   122
        semName.Format(_L("%S%d"), &semaphoreName, x);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   123
        ret = startSemaphore.CreateGlobal(semName, 0);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   124
        RDebug::Print(_L("RTestServer::Connect() Creating global semaphore [%S] with result [%d]"), &semName, ret);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   125
        if(ret != KErrAlreadyExists)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   126
            {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   127
            semaphoreName.Copy(semName);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   128
            break;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   129
            }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   130
        x++;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   131
        } while (ETrue);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   132
    semName.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   133
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   134
    if ( ret != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   135
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   136
        startSemaphore.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   137
        return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   138
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   139
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   140
    // By default start 'testserverstarter.exe'
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   141
    TFileName pathAndExeModule;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   142
    if ( aModuleName.Find( _L( "testscripter_ui_" ) ) == 0 ) 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   143
    	{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   144
        pathAndExeModule.Copy( KDefaultUiExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   145
    	}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   146
    else
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   147
    	{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   148
        pathAndExeModule.Copy( KDefaultExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   149
    	}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   150
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   151
    RProcess pr;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   152
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   153
    // Data to be passed to new process. It will contain module name and synchronization semaphore name separated with space.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   154
    // I.e. it will be: "mymodule startupSemaphore0"
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   155
    RBuf data; 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   156
    ret = data.Create(KMaxName);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   157
    if(ret != KErrNone)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   158
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   159
        RDebug::Print(_L("RTestServer::Connect() Could not create buffer for data to be passed to process [%d]"), ret);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   160
        return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   161
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   162
    data.Format(_L("%S %S"), &aModuleName, &semaphoreName);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   163
    RDebug::Print(_L("RTestServer::Connect() Data for new process prepared [%S]"), &data);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   164
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   165
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   166
    // Indication is Create() operation needed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   167
    TBool doCreate( ETrue );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   168
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   169
    #ifdef __WINS__ // CodeWarrior(emulator)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   170
        // Create without path(Uses Symbian default path).
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   171
        // Note: If TestScriter used then module name is format:
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   172
        // testscripter_testcasefilename
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   173
        
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   174
        ret = pr.Create( aModuleName, data );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   175
        if( ret == KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   176
            {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   177
            RDebug::Print(_L("RTestServer::Connect() Combination (1): Caps modifier [%S], Data [%S]"), &aModuleName, &data);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   178
            doCreate = EFalse;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   179
            }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   180
    #endif // __WINS__
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   181
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   182
    if ( doCreate )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   183
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   184
        TInt find_ret( KErrNone );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   185
        TInt trapd_ret( KErrNone );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   186
        // Check is TestScripter and is caps modifíer name given
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   187
        if( aModuleName.Find( KTestScripterName ) != KErrNotFound && aConfigFile != KNullDesC )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   188
            {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   189
            TInt ret_caps;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   190
            TFileName capsModifierName;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   191
            // In TestClass's test case (config) file can give name to caps
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   192
            // modifier module.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   193
            ret_caps = GetCapsModifier( aConfigFile, capsModifierName );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   194
            if( ret_caps != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   195
                {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   196
                RDebug::Print( _L( "RTestServer::Connect() Caps modifier was not defined. Default modifier will be used" ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   197
                }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   198
            else
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   199
                {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   200
                #ifdef __WINS__ // CodeWarrior(emulator)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   201
                    // Create without path(Uses Symbian default path)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   202
                    ret = pr.Create( capsModifierName, data );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   203
                    if( ret == KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   204
                        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   205
                        RDebug::Print( _L( "RTestServer::Connect() Combination (2): Caps modifier [%S], Data [%S]"), &capsModifierName, &data);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   206
                        doCreate = EFalse;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   207
                        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   208
                #endif // __WINS__
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   209
                if ( doCreate )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   210
                    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   211
                    TRAP( trapd_ret, find_ret = FindExeL(
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   212
                                    capsModifierName, pathAndExeModule ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   213
                    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   214
                }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   215
            }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   216
        //--PYTHON-- begin
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   217
        // If this is python module, use caps modifier
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   218
        else if(aModuleName.Length() >= KPythonScripterLength && aModuleName.Mid(0, KPythonScripterLength).Compare(KPythonScripter) == 0)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   219
           {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   220
           pathAndExeModule.Copy(KPythonScripter);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   221
           }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   222
        //--PYTHON-- end
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   223
        // Find exe from file system
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   224
        else if( aModuleName != _L( "testcombiner" ) )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   225
           {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   226
           // Check if e.g. TestModule.exe is available
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   227
           TRAP( trapd_ret, find_ret = FindExeL( aModuleName, pathAndExeModule  ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   228
           }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   229
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   230
        // Check FindExeL error codes
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   231
        if( find_ret != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   232
			{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   233
			// Module was not found, using default exe: testserverstarter.exe
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   234
			RDebug::Print( _L( "RTestServer::Connect() Correct caps modifier module not found, capabilities cannot set" ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   235
			if ( aModuleName.Find( _L( "testscripter_ui_" ) ) == 0 ) 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   236
				{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   237
				pathAndExeModule.Copy( KDefaultUiExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   238
				}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   239
			else
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   240
				{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   241
				pathAndExeModule.Copy( KDefaultExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   242
				}           
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   243
			}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   244
        if( trapd_ret != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   245
           {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   246
           // FindExeL fails
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   247
           RDebug::Print( _L( "RTestServer::Connect() Caps modifier module searching fails with error: %d" ), trapd_ret );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   248
           startSemaphore.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   249
           data.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   250
           return trapd_ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   251
           }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   252
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   253
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   254
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   255
    if ( doCreate )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   256
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   257
        ret = pr.Create( pathAndExeModule, data );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   258
        RDebug::Print(
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   259
            _L( "RTestServer::Connect() Combination (3): Caps modifier [%S], Data [%S], Result [%d]" ),
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   260
            &pathAndExeModule, &data, ret );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   261
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   262
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   263
    data.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   264
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   265
    if ( ret != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   266
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   267
        startSemaphore.Close();  
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   268
        return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   269
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   270
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   271
    // Process created, continue start-up
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   272
    pr.Resume();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   273
    pr.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   274
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   275
    // Wait until server is started
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   276
    startSemaphore.Wait();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   277
    startSemaphore.Close();     // Close semaphore
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   278
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   279
    serverName = aModuleName;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   280
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   281
    // Server is up and running, connect to it    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   282
    ret = CreateSession( serverName, Version() );    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   283
    return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   284
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   285
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   286
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   287
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   288
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   289
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   290
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   291
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   292
    Method: Version
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   293
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   294
    Description: Return client side version.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   295
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   296
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   297
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   298
    Return Values: TVersion: Version number
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   299
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   300
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   301
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   302
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   303
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   304
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   305
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   306
EXPORT_C TVersion RTestServer::Version() const
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   307
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   308
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   309
    return( TVersion( KTestServerMajorVersionNumber,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   310
                       KTestServerMinorVersionNumber, 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   311
                       KTestServerBuildVersionNumber 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   312
                     ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   313
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   314
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   315
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   316
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   317
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   318
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   319
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   320
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   321
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   322
    Method: Close
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   323
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   324
    Description: Closes the RTestServer session.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   325
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   326
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   327
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   328
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   329
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   330
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   331
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   332
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   333
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   334
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   335
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   336
EXPORT_C void RTestServer::Close()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   337
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   338
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   339
    // Check that server is connected
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   340
    if( Handle() != 0 )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   341
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   342
        TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   343
        SendReceive( ETestServerCloseSession, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   344
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   345
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   346
    RSessionBase::Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   347
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   348
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   349
 /*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   350
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   351
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   352
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   353
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   354
    Method: GetServerThreadId
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   355
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   356
    Description: Get server thread id
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   357
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   358
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   359
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   360
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   361
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   362
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   363
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   364
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   365
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   366
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   367
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   368
EXPORT_C TInt RTestServer::GetServerThreadId(TThreadId& aThreadId)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   369
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   370
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   371
    TInt ret(0);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   372
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   373
    // Check that server is connected
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   374
    if( Handle() != 0 )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   375
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   376
        TThreadId id;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   377
        TPckg<TThreadId> threadIdPckg( id );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   378
        TIpcArgs args( &threadIdPckg, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   379
        ret = SendReceive( ETestServerGetServerThreadId, args );  
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   380
        
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   381
        aThreadId = threadIdPckg();        
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   382
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   383
        
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   384
    return ret;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   385
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   386
    }            
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   387
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   388
EXPORT_C TInt RTestServer::PassEngineSessionSettings( const TEngineSettings& aEngineSessionSettings )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   389
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   390
    TPckgC<TEngineSettings> engineSessionSettingsBuf( aEngineSessionSettings );    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   391
    return SendReceive( ETestServerPassEngineSessionSettings, 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   392
            TIpcArgs( &engineSessionSettingsBuf ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   393
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   394
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   395
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   396
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   397
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   398
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   399
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   400
    Method: FindExeL
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   401
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   402
    Description: Find exe(CapsModifier) from file system(Used in EKA2)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   403
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   404
    Parameters: TFileName aModuleName: in: Module name.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   405
                TFileName& aPathAndExeModule: inout: Module's exe(CapsModifier)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   406
                path information.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   407
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   408
    Return Values: TBool: Symbian error code: If exe(CapsModifier) is found
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   409
                          return KErrNone else other error code will return.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   410
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   411
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   412
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   413
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   414
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   415
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   416
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   417
TBool RTestServer::FindExeL( TFileName aModuleName,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   418
                                TFileName& aPathAndExeModule )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   419
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   420
    RFs fsSession;  // For the file session handling
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   421
    RFile file;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   422
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   423
    // Connect to file server
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   424
	User::LeaveIfError( fsSession.Connect() ); // Start session
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   425
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   426
    TDriveList drivelist; 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   427
	User::LeaveIfError( fsSession.DriveList(drivelist) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   428
	// A TDriveList (the list of available drives), is an array of 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   429
	// 26 bytes. Each byte with a non zero value signifies that the 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   430
	// corresponding drive is available.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   431
    TInt driveNumber; 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   432
	TChar driveLetter;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   433
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   434
	for( driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++ )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   435
		{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   436
		if( !drivelist[driveNumber] ) 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   437
			{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   438
			// If drive-list entry is zero, drive is not available
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   439
			continue;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   440
			}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   441
        User::LeaveIfError(fsSession.DriveToChar(driveNumber,driveLetter));
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   442
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   443
        aPathAndExeModule.Zero();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   444
        aPathAndExeModule.Append( driveLetter );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   445
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   446
        aPathAndExeModule.Append( _L(":\\sys\\bin\\") );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   447
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   448
        aPathAndExeModule.Append( aModuleName );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   449
        aPathAndExeModule.Append( _L( ".exe" ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   450
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   451
        TInt found( KErrNone );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   452
        found = file.Open( fsSession, aPathAndExeModule, EFileRead );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   453
        if( found == KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   454
            {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   455
            // exe(capsmodifier module) is founded.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   456
            file.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   457
            fsSession.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   458
            return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   459
            }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   460
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   461
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   462
    // If exe not found use testserverstarter.exe but capabilities cannot
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   463
    // set.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   464
    if ( aModuleName.Find( _L( "testscripter_ui_" ) ) == 0 ) 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   465
    	{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   466
        aPathAndExeModule.Copy( KDefaultUiExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   467
    	}
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   468
    else
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   469
    	{
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   470
        aPathAndExeModule.Copy( KDefaultExeName );    	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   471
    	}	
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   472
    file.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   473
    fsSession.Close();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   474
 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   475
    return KErrNotFound;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   476
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   477
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   478
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   479
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   480
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   481
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   482
    Class: RTestServer
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   483
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   484
    Method: GetCapsModifierName
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   485
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   486
    Description: Get caps modifier module name from TestScripter's test
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   487
                 case(config) file.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   488
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   489
    Parameters: const TDesC& aConfigFile: in: TestScripter's test case(config)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   490
                file path and name.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   491
                TFileName& aCapsModifierName: inout: Parsed caps modifier name.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   492
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   493
    Return Values: TInt: Symbian error code: Return KErrNone if caps modifier
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   494
                                             module name is successfully parsed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   495
                                             or given else other error code
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   496
                                             will return.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   497
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   498
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   499
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   500
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   501
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   502
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   503
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   504
TInt RTestServer::GetCapsModifier( const TDesC& aConfigFile,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   505
                                        TFileName& aCapsModifierName )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   506
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   507
    // Create parser
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   508
    CStifParser* parser = NULL;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   509
    TRAPD( err, parser = CStifParser::NewL( _L(""), aConfigFile ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   510
    if( err != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   511
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   512
        return err;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   513
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   514
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   515
    CleanupStack::PushL( parser );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   516
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   517
    // Create section
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   518
    CStifSectionParser* section = NULL;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   519
    TRAP( err, section = parser->SectionL( KStifSettingsStartTag,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   520
                                            KStifSettingsEndTag ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   521
    if( err != KErrNone || section == NULL)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   522
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   523
        CleanupStack::PopAndDestroy( parser );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   524
        return KErrNotFound;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   525
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   526
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   527
    CleanupStack::PushL( section );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   528
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   529
    // Create item
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   530
    CStifItemParser* item = NULL;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   531
    TRAP( err, item = section->GetItemLineL( KCapsModifier ) );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   532
    if( err != KErrNone || item == NULL )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   533
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   534
        CleanupStack::PopAndDestroy( section );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   535
        CleanupStack::PopAndDestroy( parser );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   536
        return KErrNotFound;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   537
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   538
    CleanupStack::PushL( item );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   539
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   540
    // Get caps modifier module name
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   541
    TPtrC capsModifierName;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   542
    err = item->GetString( KCapsModifier, capsModifierName );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   543
    if( err != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   544
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   545
        CleanupStack::PopAndDestroy( item );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   546
        CleanupStack::PopAndDestroy( section );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   547
        CleanupStack::PopAndDestroy( parser );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   548
        return err;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   549
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   550
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   551
    aCapsModifierName.Copy( capsModifierName );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   552
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   553
    // Remove optional '.EXE' from the name
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   554
    aCapsModifierName.LowerCase();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   555
    TParse parse;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   556
    parse.Set( aCapsModifierName, NULL, NULL );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   557
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   558
    if ( parse.Ext() == _L(".exe") )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   559
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   560
        const TInt len = parse.Ext().Length();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   561
        aCapsModifierName.Delete ( aCapsModifierName.Length()-len, len );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   562
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   563
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   564
    CleanupStack::PopAndDestroy( item );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   565
    CleanupStack::PopAndDestroy( section );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   566
    CleanupStack::PopAndDestroy( parser );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   567
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   568
    return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   569
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   570
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   571
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   572
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   573
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   574
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   575
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   576
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   577
    Method: Open
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   578
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   579
    Description: Create new subsession with the RTestServer server
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   580
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   581
    Parameters: RTestServer& aServer          :inout: Server
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   582
                TFileName& aIniFile           :in:    Initialization file
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   583
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   584
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   585
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   586
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   587
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   588
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   589
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   590
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   591
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   592
EXPORT_C TInt RTestModule::Open( RTestServer& aServer,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   593
                                 TFileName& aIniFile
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   594
                               )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   595
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   596
    TIpcArgs args( &aIniFile, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   597
    return CreateSubSession( aServer, ETestModuleCreateSubSession, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   598
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   599
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   600
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   601
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   602
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   603
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   604
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   605
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   606
    Method: Close
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   607
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   608
    Description: Close a subsession
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   609
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   610
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   611
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   612
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   613
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   614
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   615
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   616
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   617
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   618
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   619
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   620
EXPORT_C void RTestModule::Close()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   621
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   622
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   623
    RSubSessionBase::CloseSubSession( ETestModuleCloseSubSession );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   624
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   625
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   626
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   627
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   628
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   629
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   630
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   631
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   632
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   633
    Method: EnumerateTestCases
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   634
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   635
    Description: Enumerates test cases
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   636
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   637
    Parameters: TFileName aConfigFile         :in:  Configuration file name
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   638
                TCaseSize& aCount             :out: Package for storing count
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   639
                TRequestStatus& aStatus       :out: Status
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   640
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   641
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   642
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   643
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   644
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   645
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   646
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   647
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   648
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   649
EXPORT_C void RTestModule::EnumerateTestCases( TDesC& aConfigFile,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   650
                                               TCaseSize& aCount,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   651
                                               TRequestStatus& aStatus
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   652
                                             )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   653
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   654
    TIpcArgs args( &aConfigFile, &aCount, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   655
    SendReceive( ETestModuleEnumerateTestCases, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   656
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   657
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   658
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   659
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   660
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   661
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   662
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   663
    Method: GetTestCases
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   664
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   665
    Description: Get test cases
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   666
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   667
    Parameters: CFixedFlatArray<TTestCaseInfo>& aTestCaseBuffer :Out:    Cases
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   668
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   669
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   670
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   671
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   672
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   673
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   674
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   675
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   676
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   677
EXPORT_C TInt RTestModule::GetTestCases( CFixedFlatArray<TTestCaseInfo>& aTestCaseBuffer )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   678
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   679
    TIpcArgs args( &aTestCaseBuffer.Des(), TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   680
    return SendReceive( ETestModuleGetTestCases, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   681
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   682
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   683
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   684
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   685
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   686
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   687
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   688
    Method: ErrorNotification
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   689
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   690
    Description: Request error notification
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   691
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   692
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   693
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   694
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   695
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   696
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   697
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   698
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   699
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   700
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   701
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   702
EXPORT_C void RTestModule::ErrorNotification( TErrorNotificationPckg& aError,                                           
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   703
                                              TRequestStatus& aStatus )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   704
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   705
    TIpcArgs args( &aError, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   706
    SendReceive( ETestModuleErrorNotification, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   707
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   708
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   709
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   710
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   711
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   712
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   713
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   714
    Method: CancelAsyncRequest
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   715
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   716
    Description: Cancel ongoing request
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   717
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   718
    Parameters: TInt aReqToCancel             :in:  Request to be cancelled
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   719
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   720
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   721
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   722
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   723
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   724
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   725
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   726
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   727
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   728
EXPORT_C TInt RTestModule::CancelAsyncRequest( TInt aReqToCancel )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   729
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   730
    TIpcArgs args( aReqToCancel, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   731
    return SendReceive( ETestModuleCancelAsyncRequest, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   732
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   733
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   734
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   735
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   736
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   737
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   738
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   739
    Method: Open
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   740
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   741
    Description: create new subsession with the RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   742
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   743
    Parameters: RTestServer& aServer          :in:  Handle to server
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   744
                const TInt aCaseNumber        :in:  Case number
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   745
                const TFileName& aConfig      :in:  Configuration file
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   746
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   747
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   748
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   749
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   750
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   751
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   752
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   753
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   754
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   755
EXPORT_C TInt RTestExecution::Open( RTestServer& aServer,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   756
                                    const TInt aCaseNumber,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   757
                                    const TFileName& aConfig
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   758
                                  )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   759
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   760
    TIpcArgs args( aCaseNumber, &aConfig, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   761
    return CreateSubSession( aServer, ETestExecutionCreateSubSession, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   762
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   763
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   764
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   765
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   766
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   767
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   768
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   769
    Method: Close
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   770
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   771
    Description: close a subsession
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   772
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   773
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   774
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   775
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   776
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   777
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   778
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   779
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   780
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   781
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   782
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   783
EXPORT_C void RTestExecution::Close()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   784
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   785
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   786
    // Close subsession
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   787
    RSubSessionBase::CloseSubSession( ETestExecutionCloseSubSession );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   788
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   789
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   790
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   791
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   792
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   793
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   794
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   795
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   796
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   797
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   798
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   799
    Method: RunTestCase
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   800
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   801
    Description: Runs a test case
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   802
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   803
    Parameters: TFullTestResultPckg& aResult  :out: Case result
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   804
                TRequestStatus& aStatus       :out: Request to be completed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   805
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   806
    Return Values: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   807
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   808
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   809
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   810
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   811
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   812
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   813
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   814
EXPORT_C void RTestExecution::RunTestCase( TFullTestResultPckg& aResult,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   815
                                           TRequestStatus& aStatus 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   816
                                         )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   817
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   818
    TIpcArgs args( &aResult, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   819
    SendReceive( ETestExecutionRunTestCase, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   820
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   821
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   822
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   823
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   824
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   825
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   826
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   827
    Method: NotifyProgress
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   828
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   829
    Description: Notify about test case progress, i.e test case prints.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   830
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   831
    Parameters: TTestProgressPckg& aProgress  :out: Print info
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   832
                TRequestStatus& aStatus       :out: Request to be completed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   833
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   834
    Return Values: TInt                             Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   835
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   836
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   837
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   838
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   839
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   840
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   841
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   842
EXPORT_C TInt RTestExecution::NotifyProgress( TTestProgressPckg& aProgress,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   843
                                              TRequestStatus& aStatus 
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   844
                                            )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   845
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   846
    TIpcArgs args( &aProgress, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   847
    SendReceive( ETestExecutionNotifyProgress, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   848
    return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   849
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   850
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   851
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   852
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   853
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   854
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   855
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   856
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   857
    Method: Pause
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   858
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   859
    Description: Pauses a test case
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   860
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   861
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   862
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   863
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   864
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   865
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   866
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   867
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   868
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   869
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   870
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   871
EXPORT_C TInt RTestExecution::Pause()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   872
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   873
    TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   874
    return SendReceive( ETestExecutionPause, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   875
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   876
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   877
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   878
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   879
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   880
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   881
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   882
    Method: Resume
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   883
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   884
    Description: Resumes a test case
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   885
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   886
    Parameters: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   887
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   888
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   889
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   890
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   891
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   892
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   893
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   894
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   895
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   896
EXPORT_C TInt RTestExecution::Resume()
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   897
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   898
    TIpcArgs args( TIpcArgs::ENothing, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   899
    return SendReceive( ETestExecutionResume, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   900
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   901
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   902
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   903
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   904
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   905
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   906
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   907
    Method: CancelAsyncRequest
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   908
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   909
    Description: Cancels an asynchronous request.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   910
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   911
    Parameters: TInt aReqToCancel             :in:  Request to be cancelled.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   912
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   913
    Return Values: TInt                             Return value from operation
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   914
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   915
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   916
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   917
    Status: Approved
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   918
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   919
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   920
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   921
EXPORT_C TInt RTestExecution::CancelAsyncRequest( TInt aReqToCancel )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   922
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   923
    TIpcArgs args( aReqToCancel, TIpcArgs::ENothing, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   924
    return SendReceive( ETestExecutionCancelAsyncRequest, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   925
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   926
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   927
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   928
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   929
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   930
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   931
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   932
    Method: NotifyEvent
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   933
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   934
    Description: NotifyEvent is used to receive event requests
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   935
                 from the Test module.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   936
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   937
    Parameters: TEventIfPckg& aEvent          :inout:  Event package.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   938
                TRequestStatus& aStatus       :out:    Request to be completed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   939
                TInt aError                   :in:     Error from event system
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   940
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   941
    Return Values: TInt                                Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   942
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   943
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   944
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   945
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   946
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   947
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   948
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   949
EXPORT_C TInt RTestExecution::NotifyEvent( TEventIfPckg& aEvent,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   950
                                           TRequestStatus& aStatus,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   951
                                           TInt aError )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   952
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   953
    TIpcArgs args( &aEvent, aError, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   954
    SendReceive( ETestExecutionNotifyEvent, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   955
    return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   956
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   957
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   958
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   959
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   960
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   961
    Class: RTestModule
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   962
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   963
    Method: NotifyRemoteCmd
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   964
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   965
    Description: NotifyRemoteCmd is used to receive RemoteCmd requests
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   966
                 from the Test module.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   967
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   968
    Parameters: TRemoteCmdPckg& aRemoteCommand: nout: Remote command's packege.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   969
                TRemoteCmdType aType: in: Remote type.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   970
                TRequestStatus& aStatus: inout: Request to be completed
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   971
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   972
    Return Values: TInt: Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   973
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   974
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   975
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   976
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   977
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   978
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   979
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   980
EXPORT_C TInt RTestExecution::NotifyRemoteCmd( TStifCommandPckg& aRemoteCommand,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   981
                                               TPckg<TInt>& aMsgSizePckg,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   982
                                               TRequestStatus& aStatus )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   983
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   984
// Construct message
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   985
    TIpcArgs args( &aRemoteCommand, &aMsgSizePckg, TIpcArgs::ENothing );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   986
    SendReceive( ETestExecutionNotifyRemoteCmd, args, aStatus );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   987
    return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   988
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   989
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   990
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   991
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   992
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   993
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   994
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   995
    Method: ReadRemoteCmdInfo
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   996
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   997
    Description: ReadRemoteCmdInfo is used to receive RemoteCmd requests
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   998
                 from the Test module.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
   999
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1000
    Parameters: TDesC& aMsg :inout: message.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1001
                TRemoteCommand aType :in: Remote command's type
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1002
                TInt aError: in: Symbian error code
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1003
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1004
    Return Values: TInt: Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1005
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1006
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1007
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1008
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1009
    
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1010
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1011
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1012
EXPORT_C TInt RTestExecution::ReadRemoteCmdInfo( TDes8& aMsg,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1013
                                                 TStifCommand aType,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1014
                                                 TInt aError )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1015
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1016
    TInt value = 0;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1017
    if( aError != KErrNone )
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1018
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1019
        value = aError;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1020
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1021
    else
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1022
        {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1023
        value = aMsg.Length();
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1024
        }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1025
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1026
// Construct message
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1027
    TIpcArgs args( &aMsg, aType, value );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1028
     // Synchronous method so return a value
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1029
    return SendReceive( ETestExecutionReadRemoteCmdInfo, args );
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1030
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1031
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1032
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1033
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1034
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1035
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1036
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1037
    Method: NotifyCommand
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1038
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1039
    Description: NotifyCommand is used to receive command requests
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1040
                 from the Test module. DEPRECATED !!
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1041
                 Use NotifyCommand2 instead.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1042
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1043
    Parameters: aStifCommandPckg:     command
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1044
                aParam1Pckg:          parameter of command
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1045
                aTestCaseHandlePckg:  handle to test case
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1046
                aStatus:              request status
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1047
                aError:               error
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1048
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1049
    Return Values: TInt               Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1050
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1051
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1052
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1053
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1054
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1055
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1056
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1057
EXPORT_C TInt RTestExecution::NotifyCommand(TCommandPckg& /*aCommandPckg*/,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1058
                                            TBuf8<KMaxCommandParamsLength>& /*aParamsPckg*/,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1059
                                            TRequestStatus& /*aStatus*/,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1060
                                            TInt /*aError*/)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1061
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1062
    /*TIpcArgs args(&aCommandPckg, &aParamsPckg, TIpcArgs::ENothing);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1063
    SendReceive(ETestExecutionNotifyCommand, args, aStatus);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1064
    return KErrNone;*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1065
    return KErrNotSupported;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1066
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1067
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1068
/*
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1069
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1070
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1071
    Class: RTestExecution
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1072
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1073
    Method: NotifyCommand2
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1074
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1075
    Description: NotifyCommand is used to receive command requests
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1076
                 from the Test module.
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1077
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1078
    Parameters: aStifCommandPckg:     command
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1079
                aParam1Pckg:          parameter of command
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1080
                aTestCaseHandlePckg:  handle to test case
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1081
                aStatus:              request status
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1082
                aError:               error
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1083
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1084
    Return Values: TInt               Always KErrNone
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1085
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1086
    Errors/Exceptions: None
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1087
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1088
    Status: Proposal
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1089
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1090
-------------------------------------------------------------------------------
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1091
*/
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1092
EXPORT_C TInt RTestExecution::NotifyCommand2(TCommandPckg& aCommandPckg,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1093
                                            TDes8& aParamsPckg,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1094
                                            TRequestStatus& aStatus,
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1095
                                            TInt /*aError*/)
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1096
    {
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1097
    TIpcArgs args(&aCommandPckg, &aParamsPckg, TIpcArgs::ENothing);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1098
    SendReceive(ETestExecutionNotifyCommand, args, aStatus);
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1099
    return KErrNone;
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1100
    }
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1101
8bb370ba6d1d contribute STF 1.0.0
Johnson Ma <johnson.ma@nokia.com>
parents:
diff changeset
  1102
// End of File