common/tools/ats/smoketest/profiles/src/ProfileSmokeTestModuleBlocks.cpp
author brendand
Thu, 05 Nov 2009 12:29:50 +0000
changeset 739 552776214487
parent 722 d34d2cabd32d
child 872 17498133d9ad
permissions -rw-r--r--
Test: Tweaked Profile tests and added AppInstall
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     1
/*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     3
* All rights reserved.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     5
* under the terms of the License "Symbian Foundation License v1.0"
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     7
* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     8
*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
     9
* Initial Contributors:
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    11
*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    12
* Contributors:
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    13
* 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    14
* Description: This file contains testclass implementation.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    15
*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    16
*/
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    17
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    18
// [INCLUDE FILES] - do not remove
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    19
#include <e32svr.h>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    20
#include <StifParser.h>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    21
#include <Stiftestinterface.h>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    22
#include <MProEngEngine.h>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    23
#include <MProEngProfile.h>
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    24
#include <MProEngProfileName.h>
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    25
#include <MProEngToneSettings.h>
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    26
#include <ProEngFactory.h>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    27
#include <Profile.hrh>
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    28
#include "ProfileSmokeTestModule.h"
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    29
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    30
// EXTERNAL DATA STRUCTURES
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    31
//extern  ?external_data;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    32
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    33
// EXTERNAL FUNCTION PROTOTYPES  
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    34
//extern ?external_function( ?arg_type,?arg_type );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    35
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    36
// CONSTANTS
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    37
//const ?type ?constant_var = ?constant;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    38
_LIT( KProfileSmokeTestModule, "ProfileSmokeTestModule" );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    39
_LIT( KProfile, "Profile: %S" );
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    40
_LIT( KRingingVolume, "Ringing Volume: %d");
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    41
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    42
_LIT(KGeneral, 	"General");
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    43
_LIT(KSilent,  	"Silent");
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    44
_LIT(KMeeting, 	"Meeting");
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
    45
_LIT(KOutdoor,	"Outdoor");
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    46
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    47
// MACROS
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    48
//#define ?macro ?macro_def
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    49
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    50
// LOCAL CONSTANTS AND MACROS
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    51
//const ?type ?constant_var = ?constant;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    52
//#define ?macro_name ?macro_def
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    53
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    54
// MODULE DATA STRUCTURES
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    55
//enum ?declaration
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    56
//typedef ?declaration
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    57
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    58
// LOCAL FUNCTION PROTOTYPES
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    59
//?type ?function_name( ?arg_type, ?arg_type );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    60
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    61
// FORWARD DECLARATIONS
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    62
//class ?FORWARD_CLASSNAME;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    63
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    64
// ============================= LOCAL FUNCTIONS ===============================
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    65
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    66
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    67
// ?function_name ?description.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    68
// ?description
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    69
// Returns: ?value_1: ?description
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    70
//          ?value_n: ?description_line1
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    71
//                    ?description_line2
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    72
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    73
//
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    74
/*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    75
?type ?function_name(
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    76
    ?arg_type arg,  // ?description
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    77
    ?arg_type arg)  // ?description
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    78
    {
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    79
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    80
    ?code  // ?comment
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    81
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    82
    // ?comment
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    83
    ?code
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    84
    }
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    85
*/
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    86
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    87
// ============================ MEMBER FUNCTIONS ===============================
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    88
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    89
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    90
// CProfileSmokeTestModule::Delete
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    91
// Delete here all resources allocated and opened from test methods. 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    92
// Called from destructor. 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    93
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    94
//
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    95
void CProfileSmokeTestModule::Delete() 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    96
    {
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    97
    }
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    98
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
    99
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   100
// CProfileSmokeTestModule::RunMethodL
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   101
// Run specified method. Contains also table of test mothods and their names.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   102
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   103
//
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   104
TInt CProfileSmokeTestModule::RunMethodL( 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   105
    CStifItemParser& aItem ) 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   106
    {
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   107
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   108
    static TStifFunctionInfo const KFunctions[] =
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   109
        {  
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   110
        // Copy this line for every implemented function.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   111
        // First string is the function name used in TestScripter script file.
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   112
        // Second is the actual implementation member function. 
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   113
        ENTRY( "CheckActiveProfile", CProfileSmokeTestModule::CheckActiveProfileL),
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   114
        ENTRY( "SetActiveProfile", CProfileSmokeTestModule::SetActiveProfileL ),
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   115
        //ADD NEW ENTRY HERE
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   116
        // [test cases entries] - Do not remove
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   117
        };
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   118
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   119
    const TInt count = sizeof( KFunctions ) / 
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   120
                        sizeof( TStifFunctionInfo );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   121
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   122
    return RunInternalL( KFunctions, count, aItem );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   123
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   124
    }
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   125
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   126
// -----------------------------------------------------------------------------
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   127
// CProfileSmokeTestModule::CheckActiveProfileL
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   128
// Changes the current active profile according to the parameter
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   129
// -----------------------------------------------------------------------------
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   130
//
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   131
TInt CProfileSmokeTestModule::CheckActiveProfileL( CStifItemParser& aItem )
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   132
    {
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   133
    // Print to UI
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   134
    _LIT( KSetProfile, "In CheckActiveProfile" );
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   135
    TestModuleIf().Printf( 0, KProfileSmokeTestModule, KSetProfile );
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   136
    // Print to log file
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   137
    iLog->Log( KSetProfile );
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   138
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   139
	MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   140
	MProEngProfile* active = engine->ActiveProfileLC();
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   141
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   142
    TPtrC expectedName;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   143
    if ( aItem.GetNextString( expectedName ) == KErrNone )
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   144
    	{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   145
    	TL( active->ProfileName().Name() == expectedName)
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   146
    	}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   147
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   148
    TInt expectedRingVol;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   149
    if ( aItem.GetNextInt( expectedRingVol ) == KErrNone )
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   150
    	{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   151
    	TL(active->ToneSettings().RingingVolume() == expectedRingVol);
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   152
    	}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   153
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   154
    TInt expectedRingType;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   155
    if ( aItem.GetNextInt( expectedRingType ) == KErrNone )
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   156
    	{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   157
    	TL(active->ToneSettings().RingingType() == expectedRingType);
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   158
    	}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   159
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   160
    TPtrC vibrate;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   161
    if ( aItem.GetNextString(vibrate) == KErrNone )
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   162
    	{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   163
    	TBool expectedVibrate;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   164
    	if ( vibrate == _L("true"))
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   165
    		{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   166
    		expectedVibrate = ETrue;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   167
    		}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   168
    	else if ( vibrate == _L("false"))
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   169
    		{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   170
    		expectedVibrate = EFalse;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   171
    		}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   172
    	else
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   173
    		{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   174
    		User::Leave(KErrArgument);
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   175
    		}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   176
    	
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   177
    	TL(expectedVibrate == active->ToneSettings().VibratingAlert());
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   178
    	}
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   179
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   180
    CleanupStack::PopAndDestroy(2);
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   181
    
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   182
    return KErrNone;
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   183
    }
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   184
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   185
// -----------------------------------------------------------------------------
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   186
// CProfileSmokeTestModule::SetProfileL
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   187
// Changes the current active profile according to the parameter
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   188
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   189
//
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   190
TInt CProfileSmokeTestModule::SetActiveProfileL( CStifItemParser& aItem )
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   191
    {
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   192
    // Print to UI
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   193
    _LIT( KSetProfile, "In SetActiveProfile" );
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   194
    TestModuleIf().Printf( 0, KProfileSmokeTestModule, KSetProfile );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   195
    // Print to log file
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   196
    iLog->Log( KSetProfile );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   197
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   198
    TPtrC profile;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   199
    if ( aItem.GetNextString( profile ) == KErrNone )
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   200
    	{
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   201
    	MProEngEngine* engine = ProEngFactory::NewEngineLC( iFs );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   202
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   203
    	// create the profile engine and set to the correct profile
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   204
    	if ( profile == KSilent)
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   205
    		{
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   206
    		//set to silent
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   207
    		engine->SetActiveProfileL( EProfileSilentId );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   208
    		}
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   209
    	else if ( profile == KMeeting )
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   210
    		{
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   211
    		// set to meeting
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   212
    		engine->SetActiveProfileL( EProfileMeetingId );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   213
    		}
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   214
    	else if ( profile == KGeneral )
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   215
    		{
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   216
    		// set to general
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   217
    		engine->SetActiveProfileL( EProfileGeneralId );
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   218
    		}
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   219
    	else if (profile == KOutdoor)
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   220
    		{
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   221
    		// set to outdoors
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   222
    		engine->SetActiveProfileL( EProfileOutdoorId );
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   223
    		}
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   224
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   225
    	CleanupStack::PopAndDestroy();
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   226
    	}
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   227
    
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   228
    return KErrNone;
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   229
    }
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   230
739
552776214487 Test: Tweaked Profile tests and added AppInstall
brendand
parents: 722
diff changeset
   231
722
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   232
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   233
// CProfileSmokeTestModule::?member_function
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   234
// ?implementation_description
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   235
// (other items were commented in a header).
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   236
// -----------------------------------------------------------------------------
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   237
//
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   238
/*
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   239
TInt CProfileSmokeTestModule::?member_function(
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   240
   CItemParser& aItem )
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   241
   {
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   242
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   243
   ?code
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   244
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   245
   }
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   246
*/
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   247
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   248
// ========================== OTHER EXPORTED FUNCTIONS =========================
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   249
// None
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   250
d34d2cabd32d Adding profiles smoke tests
brendand
parents:
diff changeset
   251
//  [End of File] - Do not remove