radioengine/settings/tsrc/inc/SettingsTestModule.h
author hgs
Mon, 20 Sep 2010 18:04:48 +0300
changeset 51 bbebb0235466
parent 34 bc10a61bd7d3
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
hgs
parents:
diff changeset
     1
/*
51
hgs
parents: 34
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents: 34
diff changeset
     3
 * All rights reserved.
hgs
parents: 34
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents: 34
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents: 34
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents: 34
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents: 34
diff changeset
     8
 *
hgs
parents: 34
diff changeset
     9
 * Initial Contributors:
hgs
parents: 34
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents: 34
diff changeset
    11
 *
hgs
parents: 34
diff changeset
    12
 * Contributors:
hgs
parents: 34
diff changeset
    13
 * 
hgs
parents: 34
diff changeset
    14
 * Description: STIF testclass declaration
hgs
parents: 34
diff changeset
    15
 *
hgs
parents: 34
diff changeset
    16
 */
34
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef SettingsTestMODULE_H
hgs
parents:
diff changeset
    19
#define SettingsTestMODULE_H
hgs
parents:
diff changeset
    20
51
hgs
parents: 34
diff changeset
    21
// System includes
34
hgs
parents:
diff changeset
    22
#include <StifLogger.h>
hgs
parents:
diff changeset
    23
#include <TestScripterInternal.h>
hgs
parents:
diff changeset
    24
#include <StifTestModule.h>
hgs
parents:
diff changeset
    25
#include <TestclassAssert.h>
51
hgs
parents: 34
diff changeset
    26
// User includes
34
hgs
parents:
diff changeset
    27
#include "cradiosettings.h"
hgs
parents:
diff changeset
    28
#include "mradiosettingsobserver.h"
hgs
parents:
diff changeset
    29
#include "trace.h"
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
// CONSTANTS
51
hgs
parents: 34
diff changeset
    32
const TInt KErrBadTestParameter = -1000; // Error on configuration file
hgs
parents: 34
diff changeset
    33
const TInt KErrEventPending = -2000; // Timeout and not callback 
hgs
parents: 34
diff changeset
    34
const TInt KErrCallbackErrorCode = -2001; // Callback return error code
hgs
parents: 34
diff changeset
    35
const TInt KErrUnexpectedValue = -2002; // Unexpected value at setting    
hgs
parents: 34
diff changeset
    36
const TInt KExpectedFrequencyChange = -2003; // Is not finding more than one station
hgs
parents: 34
diff changeset
    37
const TInt KErrTimeoutController = -2007; // Unexpected notification
34
hgs
parents:
diff changeset
    38
hgs
parents:
diff changeset
    39
// MACROS
hgs
parents:
diff changeset
    40
#define TEST_CLASS_VERSION_MAJOR 1
hgs
parents:
diff changeset
    41
#define TEST_CLASS_VERSION_MINOR 1
hgs
parents:
diff changeset
    42
#define TEST_CLASS_VERSION_BUILD 1
hgs
parents:
diff changeset
    43
// Logging path
51
hgs
parents: 34
diff changeset
    44
_LIT( KSettingsTestModuleLogPath, "\\logs\\testframework\\SettingsTestModule\\" );
34
hgs
parents:
diff changeset
    45
// Log file
51
hgs
parents: 34
diff changeset
    46
_LIT( KSettingsTestModuleLogFile, "SettingsTestModule.txt" );
34
hgs
parents:
diff changeset
    47
_LIT( KSettingsTestModuleLogFileWithTitle, "SettingsTestModule_[%S].txt" );
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
// CLASS DECLARATION
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
/**
51
hgs
parents: 34
diff changeset
    52
 *  CSettingsTestModule test class for STIF Test Framework TestScripter.
hgs
parents: 34
diff changeset
    53
 *  ?other_description_lines
hgs
parents: 34
diff changeset
    54
 *
hgs
parents: 34
diff changeset
    55
 *  @lib SettingsTestModule.dll
hgs
parents: 34
diff changeset
    56
 *  @since S60 10.1
hgs
parents: 34
diff changeset
    57
 */
hgs
parents: 34
diff changeset
    58
NONSHARABLE_CLASS(CSettingsTestModule) : public CScriptBase,
hgs
parents: 34
diff changeset
    59
        public MRadioSettingsObserver
34
hgs
parents:
diff changeset
    60
    {
51
hgs
parents: 34
diff changeset
    61
public:
hgs
parents: 34
diff changeset
    62
    // Constructors and destructor
34
hgs
parents:
diff changeset
    63
51
hgs
parents: 34
diff changeset
    64
    /**
hgs
parents: 34
diff changeset
    65
     * Two-phased constructor.
hgs
parents: 34
diff changeset
    66
     */
hgs
parents: 34
diff changeset
    67
    static CSettingsTestModule* NewL(CTestModuleIf& aTestModuleIf);
34
hgs
parents:
diff changeset
    68
51
hgs
parents: 34
diff changeset
    69
    /**
hgs
parents: 34
diff changeset
    70
     * Destructor.
hgs
parents: 34
diff changeset
    71
     */
hgs
parents: 34
diff changeset
    72
    virtual ~CSettingsTestModule();
34
hgs
parents:
diff changeset
    73
51
hgs
parents: 34
diff changeset
    74
public:
hgs
parents: 34
diff changeset
    75
    // Functions from base classes
34
hgs
parents:
diff changeset
    76
51
hgs
parents: 34
diff changeset
    77
    /**
hgs
parents: 34
diff changeset
    78
     * From CScriptBase Runs a script line.
hgs
parents: 34
diff changeset
    79
     * @since ?Series60_version
hgs
parents: 34
diff changeset
    80
     * @param aItem Script line containing method name and parameters
hgs
parents: 34
diff changeset
    81
     * @return Symbian OS error code
hgs
parents: 34
diff changeset
    82
     */
hgs
parents: 34
diff changeset
    83
    virtual TInt RunMethodL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
    84
hgs
parents: 34
diff changeset
    85
    // MRadioSettingsObserver
34
hgs
parents:
diff changeset
    86
51
hgs
parents: 34
diff changeset
    87
    /**
hgs
parents: 34
diff changeset
    88
     * From MRadioSettingsObserver.
hgs
parents: 34
diff changeset
    89
     * Notifies of the change in RDS alternate frequency setting
hgs
parents: 34
diff changeset
    90
     *
hgs
parents: 34
diff changeset
    91
     * @param aEnabled ETrue if AF search is enabled, otherwise EFalse
hgs
parents: 34
diff changeset
    92
     */
hgs
parents: 34
diff changeset
    93
    virtual void RdsAfSearchSettingChangedL(TBool aEnabled);
34
hgs
parents:
diff changeset
    94
51
hgs
parents: 34
diff changeset
    95
    /**
hgs
parents: 34
diff changeset
    96
     * From MRadioSettingsObserver.
hgs
parents: 34
diff changeset
    97
     * Notifies of the change in region setting when it is changed
hgs
parents: 34
diff changeset
    98
     * outside of the particular radio settings instance
hgs
parents: 34
diff changeset
    99
     *
hgs
parents: 34
diff changeset
   100
     * @param aRegion The new region ID
hgs
parents: 34
diff changeset
   101
     */
hgs
parents: 34
diff changeset
   102
    virtual void RegionSettingChangedL(TInt aRegion);
34
hgs
parents:
diff changeset
   103
51
hgs
parents: 34
diff changeset
   104
protected:
hgs
parents: 34
diff changeset
   105
    // New functions
hgs
parents: 34
diff changeset
   106
hgs
parents: 34
diff changeset
   107
    // Test case functions
hgs
parents: 34
diff changeset
   108
    TInt CreateSettingsL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   109
    TInt DestroySettingsL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   110
hgs
parents: 34
diff changeset
   111
    TInt IsRegionAllowed(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   112
hgs
parents: 34
diff changeset
   113
    TInt ResolveDriveL(CStifItemParser& aItem);
34
hgs
parents:
diff changeset
   114
51
hgs
parents: 34
diff changeset
   115
    // Application Settings functions
hgs
parents: 34
diff changeset
   116
hgs
parents: 34
diff changeset
   117
    TInt SetFirstTimeStartPerformed(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   118
    TInt IsFirstTimeStart(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   119
hgs
parents: 34
diff changeset
   120
    TInt SetUiFlags(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   121
hgs
parents: 34
diff changeset
   122
    TInt UiFlags(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   123
hgs
parents: 34
diff changeset
   124
    // Settings functions
34
hgs
parents:
diff changeset
   125
51
hgs
parents: 34
diff changeset
   126
    TInt HeadsetVolume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   127
    TInt SpeakerVolume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   128
    TInt Volume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   129
    TInt OutputMode(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   130
    TInt AudioRoute(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   131
    TInt IsHeadsetVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   132
    TInt IsSpeakerVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   133
    TInt IsVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   134
    TInt IsPowerOn(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   135
    TInt TunedFrequency(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   136
    TInt DefaultMinVolumeLevel(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   137
    TInt CountRegions(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   138
    TInt Region(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   139
    TInt RegionId(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   140
    TInt FrequencyStepSize(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   141
    TInt MaxFrequency(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   142
    TInt MinFrequency(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   143
    TInt DecimalCount(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   144
    TInt DefaultRegion(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   145
    TInt NetworkId(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   146
    TInt CountryCode(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   147
    TInt OperatorMusicStoreURL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   148
    TInt OperatorMusicStoreName(CStifItemParser& aItem);
34
hgs
parents:
diff changeset
   149
51
hgs
parents: 34
diff changeset
   150
    // Setter functions
hgs
parents: 34
diff changeset
   151
hgs
parents: 34
diff changeset
   152
    TInt SetHeadsetVolume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   153
    TInt SetSpeakerVolume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   154
    TInt SetVolume(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   155
    TInt SetOutputMode(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   156
    TInt SetAudioRoute(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   157
    TInt SetHeadsetVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   158
    TInt SetSpeakerVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   159
    TInt SetVolMuted(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   160
    TInt SetPowerOn(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   161
    TInt SetTunedFrequency(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   162
    TInt SetRegionId(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   163
    TInt SetNetworkId(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   164
    TInt SetCountryCode(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   165
    TInt SetOperatorMusicStoreURL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   166
    TInt SetOperatorMusicStoreName(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   167
hgs
parents: 34
diff changeset
   168
    // Tst functions
hgs
parents: 34
diff changeset
   169
    TInt ReadConfigurableKeysL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   170
    TInt tstSetRegionIdL(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   171
    TInt tstIsRegionSettingChangeNotified(CStifItemParser& aItem);
hgs
parents: 34
diff changeset
   172
    TInt tstResetStartCount(CStifItemParser& aItem);
34
hgs
parents:
diff changeset
   173
51
hgs
parents: 34
diff changeset
   174
private:
34
hgs
parents:
diff changeset
   175
51
hgs
parents: 34
diff changeset
   176
    /**
hgs
parents: 34
diff changeset
   177
     * C++ default constructor.
hgs
parents: 34
diff changeset
   178
     */
hgs
parents: 34
diff changeset
   179
    CSettingsTestModule(CTestModuleIf& aTestModuleIf);
34
hgs
parents:
diff changeset
   180
51
hgs
parents: 34
diff changeset
   181
    /**
hgs
parents: 34
diff changeset
   182
     * By default Symbian 2nd phase constructor is private.
hgs
parents: 34
diff changeset
   183
     */
hgs
parents: 34
diff changeset
   184
    void ConstructL();
34
hgs
parents:
diff changeset
   185
51
hgs
parents: 34
diff changeset
   186
    // Prohibit copy constructor if not deriving from CBase.
hgs
parents: 34
diff changeset
   187
    // ?classname( const ?classname& );
hgs
parents: 34
diff changeset
   188
    // Prohibit assigment operator if not deriving from CBase.
hgs
parents: 34
diff changeset
   189
    // ?classname& operator=( const ?classname& );
34
hgs
parents:
diff changeset
   190
51
hgs
parents: 34
diff changeset
   191
    /**
hgs
parents: 34
diff changeset
   192
     * Frees all resources allocated from test methods.
hgs
parents: 34
diff changeset
   193
     * @since ?Series60_version
hgs
parents: 34
diff changeset
   194
     */
hgs
parents: 34
diff changeset
   195
    void Delete();
34
hgs
parents:
diff changeset
   196
51
hgs
parents: 34
diff changeset
   197
    /**
hgs
parents: 34
diff changeset
   198
     * Test methods are listed below. 
hgs
parents: 34
diff changeset
   199
     */
34
hgs
parents:
diff changeset
   200
51
hgs
parents: 34
diff changeset
   201
    /**
hgs
parents: 34
diff changeset
   202
     * Example test method.
hgs
parents: 34
diff changeset
   203
     * @since ?Series60_version
hgs
parents: 34
diff changeset
   204
     * @param aItem Script line containing parameters.
hgs
parents: 34
diff changeset
   205
     * @return Symbian OS error code.
hgs
parents: 34
diff changeset
   206
     */
hgs
parents: 34
diff changeset
   207
    virtual TInt ExampleL(CStifItemParser& aItem);
34
hgs
parents:
diff changeset
   208
51
hgs
parents: 34
diff changeset
   209
    /**
hgs
parents: 34
diff changeset
   210
     * Method used to log version of test class
hgs
parents: 34
diff changeset
   211
     */
hgs
parents: 34
diff changeset
   212
    void SendTestClassVersion();
34
hgs
parents:
diff changeset
   213
51
hgs
parents: 34
diff changeset
   214
private:
hgs
parents: 34
diff changeset
   215
    // Data
34
hgs
parents:
diff changeset
   216
51
hgs
parents: 34
diff changeset
   217
    /** Radio Settings */
hgs
parents: 34
diff changeset
   218
    CRadioSettings* iSettings;
34
hgs
parents:
diff changeset
   219
51
hgs
parents: 34
diff changeset
   220
    TBool iRegionSettingChangeNotified;
34
hgs
parents:
diff changeset
   221
    };
hgs
parents:
diff changeset
   222
hgs
parents:
diff changeset
   223
#endif      // SettingsTestMODULE_H
hgs
parents:
diff changeset
   224
// End of File