cellular/SSSettings/tsrc/public/basic/EunitTest/MT_SSSettings/MT_SSSettings.cpp
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  MT_SSSettings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  CLASS HEADER
       
    20 #include "MT_SSSettings.h"
       
    21 
       
    22 //  EXTERNAL INCLUDES
       
    23 #include <EUnitMacros.h>
       
    24 #include <CSSSettingsRefreshContainer.h>
       
    25 #include <RCustomerServiceProfileCache.h>
       
    26 #include <RSSSettings.h>
       
    27 #include <mmtsy_names.h>
       
    28 
       
    29 //  INTERNAL INCLUDES
       
    30 #define KSSSettingsTSYName KMmTsyModuleName
       
    31 // CONSTANTS
       
    32 const TInt KCPETestWaitTime = 2000000; // Two second 
       
    33 const TInt KSSSettingsMaxETelRetryCount(7);
       
    34 const TInt KSSSettingsETelRetryCountTimeout(100000); 
       
    35     
       
    36 //////////////////////////////////////////////////////////////////////////////////
       
    37 ////	MT_SSSettings CLASS
       
    38 ///////////////////////////////////////////////////////////////////////////////////
       
    39 //  METHODS
       
    40 // CONSTRUCTION
       
    41 MT_SSSettings* MT_SSSettings::NewL()
       
    42     {
       
    43     MT_SSSettings* self = MT_SSSettings::NewLC();
       
    44     CleanupStack::Pop();
       
    45 
       
    46     return self;
       
    47     }
       
    48 
       
    49 MT_SSSettings* MT_SSSettings::NewLC()
       
    50     {
       
    51     MT_SSSettings* self = new( ELeave ) MT_SSSettings();
       
    52     CleanupStack::PushL( self );
       
    53 
       
    54     self->ConstructL();
       
    55 
       
    56     return self;
       
    57     }
       
    58 
       
    59 // Destructor (virtual by CBase)
       
    60 MT_SSSettings::~MT_SSSettings()
       
    61     {
       
    62     }
       
    63 
       
    64 // Default constructor
       
    65 MT_SSSettings::MT_SSSettings()
       
    66     {
       
    67     }
       
    68 
       
    69 // Second phase construct
       
    70 void MT_SSSettings::ConstructL()
       
    71     {
       
    72     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
       
    73     // It generates the test case table.
       
    74     CEUnitTestSuiteClass::ConstructL();
       
    75     
       
    76     iSettings = new(ELeave) RSSSettings;
       
    77     }
       
    78 ///////////////////////////////////////////////////////////////////////////////////
       
    79 ////	MSSSettingsObserver - PhoneSettingChanged
       
    80 ///////////////////////////////////////////////////////////////////////////////////
       
    81 void MT_SSSettings::PhoneSettingChanged( TSSSettingsSetting /*aSetting*/, 
       
    82             TInt /*aNewValue*/ )
       
    83     {
       
    84     // Do nothing.
       
    85     }
       
    86 
       
    87 ///////////////////////////////////////////////////////////////////////////////////
       
    88 ////	EmptySetupL
       
    89 ///////////////////////////////////////////////////////////////////////////////////
       
    90 void MT_SSSettings::EmptySetupL(  )
       
    91     {
       
    92     iCugValue = NULL;
       
    93     iClirValue = NULL;
       
    94     iAlsValue = NULL;
       
    95     iAlsBlockValue = NULL;
       
    96     iCugDefValue = NULL;
       
    97     iSettings = new(ELeave) RSSSettings;
       
    98     }
       
    99     
       
   100 ///////////////////////////////////////////////////////////////////////////////////
       
   101 ////	EmptyTeardown
       
   102 ///////////////////////////////////////////////////////////////////////////////////    
       
   103 void MT_SSSettings::EmptyTeardown(  )
       
   104     {
       
   105     delete iSettings;
       
   106     iSettings = NULL;
       
   107     }
       
   108     
       
   109 ///////////////////////////////////////////////////////////////////////////////////
       
   110 ////	SetupL
       
   111 ///////////////////////////////////////////////////////////////////////////////////
       
   112 void MT_SSSettings::SetupL(  )
       
   113     {
       
   114     iCugValue = NULL;
       
   115     iClirValue = NULL;
       
   116     if ( iAlsValue < NULL )
       
   117         {
       
   118         iAlsValue = NULL;
       
   119         }
       
   120     iAlsValue = NULL;
       
   121     iAlsBlockValue = NULL;
       
   122     iCugDefValue = NULL;
       
   123     iSettings = new(ELeave) RSSSettings;
       
   124     User::LeaveIfError(iSettings->Open());
       
   125     }
       
   126     
       
   127 ///////////////////////////////////////////////////////////////////////////////////
       
   128 ////	Teardown
       
   129 ///////////////////////////////////////////////////////////////////////////////////
       
   130 void MT_SSSettings::Teardown(  )
       
   131     {
       
   132     iSettings->Close();
       
   133     delete iSettings;
       
   134     iSettings = NULL;
       
   135     }
       
   136 
       
   137 ///////////////////////////////////////////////////////////////////////////////////
       
   138 ////	CSP SetupL
       
   139 ///////////////////////////////////////////////////////////////////////////////////
       
   140 void MT_SSSettings::CSPSetupL(  )
       
   141     {
       
   142     iCugValue = NULL;
       
   143     iClirValue = NULL;
       
   144     iAlsValue = NULL;
       
   145     iAlsBlockValue = NULL;
       
   146     iCugDefValue = NULL;   
       
   147     
       
   148     iCSP = new (ELeave) RCustomerServiceProfileCache;
       
   149     User::LeaveIfError(iCSP->Open());
       
   150     }
       
   151     
       
   152 ///////////////////////////////////////////////////////////////////////////////////
       
   153 ////	CSP Teardown
       
   154 ///////////////////////////////////////////////////////////////////////////////////
       
   155 void MT_SSSettings::CSPTeardown(  )
       
   156     {
       
   157     delete iCSP;
       
   158     iCSP = NULL;
       
   159     }
       
   160     
       
   161 ///////////////////////////////////////////////////////////////////////////////////
       
   162 ////	MT_RSSSettings_OpenCloseL
       
   163 ///////////////////////////////////////////////////////////////////////////////////
       
   164 void MT_SSSettings::MT_RSSSettings_OpenCloseL(  )
       
   165     {
       
   166     // Open RSSSettings connection.
       
   167     iSettings->Open();
       
   168     // Close RSSSettings connection.
       
   169     iSettings->Close();
       
   170     }
       
   171     
       
   172 ///////////////////////////////////////////////////////////////////////////////////
       
   173 ////	MT_RSSSettings_Open_1L
       
   174 ///////////////////////////////////////////////////////////////////////////////////
       
   175 void MT_SSSettings::MT_RSSSettings_Open_1L(  )
       
   176     {
       
   177     RTelServer*  telServer = new ( ELeave ) RTelServer();
       
   178     // Retry ETel connection:
       
   179     TInt err(KErrNone);
       
   180     for ( TInt i = 0 ; i < KSSSettingsMaxETelRetryCount ; i++ )
       
   181         {
       
   182         err = telServer->Connect();
       
   183         if ( err == KErrNone )
       
   184             {
       
   185             break;
       
   186             }
       
   187         User::After( KSSSettingsETelRetryCountTimeout );
       
   188         }
       
   189    User::LeaveIfError( err );
       
   190 
       
   191     // Open phones
       
   192     TInt error = telServer->LoadPhoneModule( KSSSettingsTSYName );
       
   193     if (( error != KErrNone ) && ( error != KErrAlreadyExists ))
       
   194         {
       
   195         User::Leave( error );
       
   196         }
       
   197     // Open RSSSettings connection.
       
   198     User::LeaveIfError(iSettings->Open(telServer));
       
   199     // Close RSSSettings connection.
       
   200     iSettings->Close();
       
   201     
       
   202     // close ETel session
       
   203     if ( telServer )
       
   204         {
       
   205         if ( telServer->Handle() )
       
   206             {
       
   207             telServer->Close();
       
   208             }
       
   209         delete telServer;
       
   210         telServer = NULL;
       
   211         }
       
   212     }
       
   213     
       
   214 ///////////////////////////////////////////////////////////////////////////////////
       
   215 ////	MT_RSSSettings_RegisterL
       
   216 ///////////////////////////////////////////////////////////////////////////////////    
       
   217 void MT_SSSettings::MT_RSSSettings_RegisterL(  )
       
   218     {
       
   219     User::LeaveIfError(iSettings->Register( ESSSettingsCug, *this ));
       
   220     iSettings->Cancel( ESSSettingsCug, *this );
       
   221     
       
   222     User::LeaveIfError(iSettings->Register( ESSSettingsClir, *this ));
       
   223     iSettings->Cancel( ESSSettingsClir, *this );
       
   224     
       
   225     User::LeaveIfError(iSettings->Register( ESSSettingsAls, *this ));
       
   226     iSettings->Cancel( ESSSettingsAls, *this );
       
   227     
       
   228     User::LeaveIfError(iSettings->Register( ESSSettingsAlsBlocking, *this ));
       
   229     iSettings->Cancel( ESSSettingsAlsBlocking, *this );
       
   230     
       
   231     User::LeaveIfError(iSettings->Register( ESSSettingsDefaultCug, *this ));
       
   232     iSettings->Cancel( ESSSettingsDefaultCug, *this );
       
   233     }
       
   234 
       
   235 ///////////////////////////////////////////////////////////////////////////////////
       
   236 ////	MT_RSSSettings_RegisterAllL
       
   237 /////////////////////////////////////////////////////////////////////////////////// 
       
   238 void MT_SSSettings::MT_RSSSettings_RegisterAllL(  )
       
   239     {
       
   240     User::LeaveIfError(iSettings->RegisterAll( *this ));
       
   241     iSettings->CancelAll( *this );
       
   242     }
       
   243 
       
   244 ///////////////////////////////////////////////////////////////////////////////////
       
   245 ////	MT_RSSSettings_CancelAllL
       
   246 /////////////////////////////////////////////////////////////////////////////////// 
       
   247 void MT_SSSettings::MT_RSSSettings_CancelAllL(  )
       
   248     {
       
   249     iSettings->CancelAll( *this );
       
   250     }
       
   251 
       
   252 ///////////////////////////////////////////////////////////////////////////////////
       
   253 ////	MT_RSSSettings_CancelL
       
   254 /////////////////////////////////////////////////////////////////////////////////// 
       
   255 void MT_SSSettings::MT_RSSSettings_CancelL( )
       
   256     {
       
   257     User::LeaveIfError(iSettings->Register( ESSSettingsCug, *this ));
       
   258     iSettings->Cancel( ESSSettingsCug, *this );
       
   259     }
       
   260 
       
   261 ///////////////////////////////////////////////////////////////////////////////////
       
   262 ////	MT_RSSSettings_GetL
       
   263 /////////////////////////////////////////////////////////////////////////////////// 
       
   264 void MT_SSSettings::MT_RSSSettings_GetL(  )
       
   265     {
       
   266     User::LeaveIfError(iSettings->Get( ESSSettingsCug, iCugValue ));
       
   267     User::LeaveIfError(iSettings->Get( ESSSettingsClir, iClirValue ));
       
   268     User::LeaveIfError(iSettings->Get( ESSSettingsAls, iAlsValue ));
       
   269     User::LeaveIfError(iSettings->Get( ESSSettingsAlsBlocking, iAlsBlockValue ));
       
   270     User::LeaveIfError(iSettings->Get( ESSSettingsDefaultCug, iCugDefValue ));
       
   271     }
       
   272 
       
   273 ///////////////////////////////////////////////////////////////////////////////////
       
   274 ////	MT_RSSSettings_SetL
       
   275 /////////////////////////////////////////////////////////////////////////////////// 
       
   276 void MT_SSSettings::MT_RSSSettings_SetL(  )
       
   277     {
       
   278     TInt cug(32767);
       
   279     TInt defCug(0);
       
   280     
       
   281     // Set cug value.
       
   282     User::LeaveIfError(iSettings->Set( ESSSettingsCug, cug ));
       
   283     
       
   284     // Set clir value.
       
   285     if ( iClirValue == ESSSettingsClirExplicitInvoke )
       
   286         {
       
   287         User::LeaveIfError(iSettings->Set( ESSSettingsClir, ESSSettingsClirExplicitSuppress ));
       
   288         }
       
   289     else
       
   290         {
       
   291         User::LeaveIfError(iSettings->Set( ESSSettingsClir, ESSSettingsClirExplicitInvoke ));
       
   292         }
       
   293     // Set als value.
       
   294     // If timer is not used set als param will cause request count warning or fail 
       
   295     // because SSSettings does several ASync request during als set operation.
       
   296     if ( iAlsValue == ESSSettingsAlsPrimary )
       
   297         {
       
   298         User::LeaveIfError(iSettings->Set( ESSSettingsAls, ESSSettingsAlsAlternate ));
       
   299         WaitTimer( KCPETestWaitTime );
       
   300         }
       
   301     else
       
   302         {
       
   303         iSettings->Set( ESSSettingsAls, ESSSettingsAlsPrimary );
       
   304         WaitTimer( KCPETestWaitTime );
       
   305         }
       
   306     // Set als blcking value.
       
   307     if ( iAlsBlockValue == ESSSettingsAlsBlockingOff )
       
   308         {
       
   309         User::LeaveIfError(iSettings->Set( ESSSettingsAlsBlocking, ESSSettingsAlsBlockingOn ));    
       
   310         }
       
   311     else
       
   312         {
       
   313         User::LeaveIfError(iSettings->Set( ESSSettingsAlsBlocking, ESSSettingsAlsBlockingOff )); 
       
   314         }
       
   315     
       
   316     // Set default cug value.
       
   317     iSettings->Set( ESSSettingsDefaultCug, defCug ); // returns kerrnotsupported
       
   318     }
       
   319     
       
   320 ///////////////////////////////////////////////////////////////////////////////////
       
   321 ////	MT_RSSSettings_WaitTimer
       
   322 ////    Start CActiveSchedulerWait, this wait last until Stop is called. This allows 
       
   323 ////    other parts of software to run. Expires after given delay.
       
   324 /////////////////////////////////////////////////////////////////////////////////// 
       
   325 void MT_SSSettings::WaitTimer( TInt aWaitTime )
       
   326     {
       
   327     CPeriodic* iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
       
   328     iTimer->Start( aWaitTime, aWaitTime, TCallBack( DoCallBackL, this ) );
       
   329     iWaitTimer.Start();
       
   330 
       
   331     delete iTimer;
       
   332     }
       
   333 
       
   334 ///////////////////////////////////////////////////////////////////////////////////
       
   335 ////	MT_RSSSettings_DoCallBackL
       
   336 /////////////////////////////////////////////////////////////////////////////////// 
       
   337 TInt MT_SSSettings::DoCallBackL( TAny* aAny )
       
   338     {
       
   339     // can't call iWaitAny.AsyncStop() in static function
       
   340     REINTERPRET_CAST( MT_SSSettings*, aAny )->Stop();
       
   341     return KErrNone;
       
   342     }
       
   343     
       
   344 ///////////////////////////////////////////////////////////////////////////////////
       
   345 ////	MT_RSSSettings_Stop
       
   346 /////////////////////////////////////////////////////////////////////////////////// 
       
   347 void MT_SSSettings::Stop()
       
   348     {
       
   349     iWaitTimer.AsyncStop();  
       
   350     }
       
   351 
       
   352 ///////////////////////////////////////////////////////////////////////////////////
       
   353 ////	MT_RSSSettings_HandleSIMChangedL
       
   354 /////////////////////////////////////////////////////////////////////////////////// 
       
   355 void MT_SSSettings::MT_RSSSettings_HandleSIMChangedL(  )
       
   356     {
       
   357     User::LeaveIfError(iSettings->HandleSIMChanged());
       
   358     }
       
   359     
       
   360 ///////////////////////////////////////////////////////////////////////////////////
       
   361 ////	MT_RSSSettings_PreviousCugValueL
       
   362 /////////////////////////////////////////////////////////////////////////////////// 
       
   363 void MT_SSSettings::MT_RSSSettings_PreviousCugValueL(  )
       
   364     {
       
   365     TInt previousValue(0);
       
   366     User::LeaveIfError(iSettings->PreviousCugValue(previousValue));
       
   367     }
       
   368 
       
   369 ///////////////////////////////////////////////////////////////////////////////////
       
   370 ////	MT_RSSSettings_ResetPreviousCugValueL
       
   371 /////////////////////////////////////////////////////////////////////////////////// 
       
   372 void MT_SSSettings::MT_RSSSettings_ResetPreviousCugValueL(  )
       
   373     {
       
   374     User::LeaveIfError(iSettings->ResetPreviousCugValue());    
       
   375     }
       
   376 
       
   377 ///////////////////////////////////////////////////////////////////////////////////
       
   378 ////	MT_RSSSettings_HandleRefreshL
       
   379 /////////////////////////////////////////////////////////////////////////////////// 
       
   380 void MT_SSSettings::MT_RSSSettings_HandleRefreshL(  )
       
   381     {
       
   382     // Emulator returns -6/KErrArgument.
       
   383     TInt error = iSettings->HandleRefresh();
       
   384     if ( error != KErrNone && error != KErrArgument )
       
   385         {
       
   386         User::Leave(KErrGeneral);
       
   387         }
       
   388     }
       
   389 
       
   390 ///////////////////////////////////////////////////////////////////////////////////
       
   391 ////	MT_RSSSettings_IsValueValidCugIndexL
       
   392 /////////////////////////////////////////////////////////////////////////////////// 
       
   393 void MT_SSSettings::MT_RSSSettings_IsValueValidCugIndexL(  )
       
   394     {
       
   395     TBool cugValue(0);
       
   396     TInt notCugValue(32768);
       
   397     TInt corCugValue(32767);
       
   398     cugValue = iSettings->IsValueValidCugIndex( notCugValue );
       
   399     if ( cugValue )
       
   400         {
       
   401         User::Leave(KErrGeneral);
       
   402         }
       
   403         
       
   404     cugValue = iSettings->IsValueValidCugIndex( corCugValue );
       
   405     if ( !cugValue )
       
   406         {
       
   407         User::Leave(KErrGeneral);
       
   408         }
       
   409     }
       
   410 
       
   411 // From MSSSettingsRefreshHandler.
       
   412 void MT_SSSettings::NotifyFileChangeL( 
       
   413             MSSSettingsRefreshObserver& /*aObserver*/,
       
   414             TSatElementaryFiles /*aObservedFile*/,
       
   415             TSatRefreshType /*aObservedRefreshType*/)
       
   416     {
       
   417     }
       
   418             
       
   419 // From MSSSettingsRefreshHandler.
       
   420 void  MT_SSSettings::CancelNotify()
       
   421     {
       
   422     // Do nothing
       
   423     }
       
   424     
       
   425 // From MSSSettingsRefreshHandler.
       
   426 TInt  MT_SSSettings::ChangedCspTable( TDes8& /*aChangedCsps*/,
       
   427             TDes8& /*aNewValues*/ )
       
   428     {
       
   429     return KErrNone;
       
   430     // Do nothing
       
   431     }
       
   432     
       
   433 // From   MSSSettingsRefreshObserver.
       
   434 TBool MT_SSSettings::AllowRefresh( const TSatRefreshType /*aType*/,
       
   435             const TSatElementaryFiles /*aFiles*/ )
       
   436     {
       
   437     return KErrNone;
       
   438     // Do nothing
       
   439     }
       
   440             
       
   441 // From   MSSSettingsRefreshObserver.
       
   442 void  MT_SSSettings::Refresh( const TSatRefreshType /*aType*/,
       
   443             const TSatElementaryFiles /*aFiles*/ )
       
   444     {
       
   445     // Do nothing
       
   446     }
       
   447 ///////////////////////////////////////////////////////////////////////////////////
       
   448 ////	MT_CSSSettingsRefreshContainer_NewLL
       
   449 /////////////////////////////////////////////////////////////////////////////////// 
       
   450 void MT_SSSettings::MT_CSSSettingsRefreshContainer_NewLL()
       
   451     {
       
   452     CSSSettingsRefreshContainer* refreshContainer = CSSSettingsRefreshContainer::NewL();
       
   453     MSSSettingsRefreshHandler* refreshHandler = &refreshContainer->RefreshHandler();
       
   454     
       
   455     //NotifyFileChangeL( *this, KCspEf, EFileChangeNotification );
       
   456     refreshHandler->NotifyFileChangeL( *this, KCspEf, EFileChangeNotification );
       
   457     
       
   458     refreshHandler = NULL;
       
   459     delete refreshContainer;
       
   460     refreshContainer = NULL;
       
   461     }
       
   462 
       
   463 ///////////////////////////////////////////////////////////////////////////////////
       
   464 ////	MT_RCustomerServiceProfileCache_CspCallCompletionL
       
   465 /////////////////////////////////////////////////////////////////////////////////// 
       
   466 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspCallCompletionL()
       
   467     {
       
   468     RMobilePhone::TCspCallCompletion params;    
       
   469     TInt retVal = iCSP->CspCallCompletion(params);
       
   470     }
       
   471 
       
   472 ///////////////////////////////////////////////////////////////////////////////////
       
   473 ////	MT_RCustomerServiceProfileCache_CspCallOfferingL
       
   474 /////////////////////////////////////////////////////////////////////////////////// 
       
   475 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspCallOfferingL()
       
   476     {
       
   477     RMobilePhone::TCspCallOffering params;    
       
   478     TInt retVal = iCSP->CspCallOffering(params);
       
   479     }
       
   480 
       
   481 ///////////////////////////////////////////////////////////////////////////////////
       
   482 ////	MT_RCustomerServiceProfileCache_CspCallRestrictionL
       
   483 /////////////////////////////////////////////////////////////////////////////////// 
       
   484 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspCallRestrictionL()
       
   485     {
       
   486     RMobilePhone::TCspCallRestriction params;    
       
   487     TInt retVal = iCSP->CspCallRestriction(params);
       
   488     }
       
   489 
       
   490 ///////////////////////////////////////////////////////////////////////////////////
       
   491 ////	MT_RCustomerServiceProfileCache_CspCPHSTeleservicesL
       
   492 /////////////////////////////////////////////////////////////////////////////////// 
       
   493 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspCPHSTeleservicesL()
       
   494     {
       
   495     RMobilePhone::TCspCPHSTeleservices params;    
       
   496     TInt retVal = iCSP->CspCPHSTeleservices(params);
       
   497     }
       
   498     
       
   499 ///////////////////////////////////////////////////////////////////////////////////
       
   500 ////	MT_RCustomerServiceProfileCache_CspCPHSValueAddedServicesL
       
   501 /////////////////////////////////////////////////////////////////////////////////// 
       
   502 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspCPHSValueAddedServicesL()
       
   503     {
       
   504     RMobilePhone::TCspValueAdded params;    
       
   505     TInt retVal = iCSP->CspCPHSValueAddedServices(params);
       
   506     }   
       
   507      
       
   508 ///////////////////////////////////////////////////////////////////////////////////
       
   509 ////	MT_RCustomerServiceProfileCache_CspTeleServicesL
       
   510 /////////////////////////////////////////////////////////////////////////////////// 
       
   511 void MT_SSSettings::MT_RCustomerServiceProfileCache_CspTeleServicesL()
       
   512     {
       
   513     RMobilePhone::TCspTeleservices params;    
       
   514     TInt retVal = iCSP->CspTeleServices(params);
       
   515     }
       
   516     
       
   517 ///////////////////////////////////////////////////////////////////////////////////
       
   518 ////	MT_RCustomerServiceProfileCache_HandleRefreshL
       
   519 ///////////////////////////////////////////////////////////////////////////////////     
       
   520 void MT_SSSettings::MT_RCustomerServiceProfileCache_HandleRefreshL()
       
   521     {       
       
   522     TInt retVal = iCSP->HandleRefresh();
       
   523     }
       
   524 
       
   525 ///////////////////////////////////////////////////////////////////////////////////
       
   526 ////	MT_RCustomerServiceProfileCache_ChangedCspTableL
       
   527 /////////////////////////////////////////////////////////////////////////////////// 
       
   528 void MT_SSSettings::MT_RCustomerServiceProfileCache_ChangedCspTableL()
       
   529     {
       
   530     RMobilePhone::TMobilePhoneCspFileV1 cspSettings;
       
   531     RMobilePhone::TMobilePhoneCspFileV1Pckg cspSettingsPckg ( cspSettings );
       
   532     RMobilePhone::TMobilePhoneCspFileV1 cspValues;
       
   533     RMobilePhone::TMobilePhoneCspFileV1Pckg cspValuePckg ( cspValues );
       
   534 
       
   535     iCSP->ChangedCspTable( cspSettingsPckg, cspValuePckg );
       
   536     }
       
   537 
       
   538 ///////////////////////////////////////////////////////////////////////////////////
       
   539 ////  TEST TABLE
       
   540 ///////////////////////////////////////////////////////////////////////////////////
       
   541 EUNIT_BEGIN_TEST_TABLE(
       
   542     MT_SSSettings,
       
   543     "Add test suite description here.",
       
   544     "MODULE" )
       
   545 
       
   546 // RCustomerServiceProfileCache Class test.
       
   547     
       
   548 EUNIT_TEST(
       
   549     "RCSP:CallCompletion",
       
   550     "RCustomerServiceProfileCache",
       
   551     "CspCallCompletion",
       
   552     "FUNCTIONALITY",
       
   553     CSPSetupL, MT_RCustomerServiceProfileCache_CspCallCompletionL, CSPTeardown)
       
   554     
       
   555 EUNIT_TEST(
       
   556     "RCSP:CspCallOffering",
       
   557     "RCustomerServiceProfileCache",
       
   558     "CspCallOffering",
       
   559     "FUNCTIONALITY",
       
   560     CSPSetupL, MT_RCustomerServiceProfileCache_CspCallOfferingL, CSPTeardown)
       
   561     
       
   562 
       
   563 EUNIT_TEST(
       
   564     "RCSP:CspCallRestriction",
       
   565     "RCustomerServiceProfileCache",
       
   566     "CspCallRestriction",
       
   567     "FUNCTIONALITY",
       
   568     CSPSetupL, MT_RCustomerServiceProfileCache_CspCallRestrictionL, CSPTeardown)
       
   569     
       
   570 EUNIT_TEST(
       
   571     "RCSP:CspCPHSTeleservices",
       
   572     "RCustomerServiceProfileCache",
       
   573     "CspCPHSTeleservices",
       
   574     "FUNCTIONALITY",
       
   575     CSPSetupL, MT_RCustomerServiceProfileCache_CspCPHSTeleservicesL, CSPTeardown)
       
   576 
       
   577 EUNIT_TEST(
       
   578     "RCSP:CspCPHSValueAddedServices",
       
   579     "RCustomerServiceProfileCache",
       
   580     "CspCPHSValueAddedServices",
       
   581     "FUNCTIONALITY",
       
   582     CSPSetupL, MT_RCustomerServiceProfileCache_CspCPHSValueAddedServicesL, CSPTeardown)
       
   583 
       
   584 EUNIT_TEST(
       
   585     "RCSP:CspTeleServices",
       
   586     "RCustomerServiceProfileCache",
       
   587     "CspTeleServices",
       
   588     "FUNCTIONALITY",
       
   589     CSPSetupL, MT_RCustomerServiceProfileCache_CspTeleServicesL, CSPTeardown)
       
   590 
       
   591 EUNIT_TEST(
       
   592     "RCSP:HandleRefresh",
       
   593     "RCustomerServiceProfileCache",
       
   594     "HandleRefresh",
       
   595     "FUNCTIONALITY",
       
   596     CSPSetupL, MT_RCustomerServiceProfileCache_HandleRefreshL, CSPTeardown)
       
   597     
       
   598 EUNIT_TEST(
       
   599     "RCSP:ChangedCspTable",
       
   600     "RCustomerServiceProfileCache",
       
   601     "ChangedCspTable",
       
   602     "FUNCTIONALITY",
       
   603     CSPSetupL, MT_RCustomerServiceProfileCache_ChangedCspTableL, CSPTeardown)
       
   604         
       
   605 // CSSSettingsRefreshContainer Class test.
       
   606 
       
   607 EUNIT_TEST(
       
   608     "Ref:NewL",
       
   609     "CSSSettingsRefreshContainer",
       
   610     "NewL",
       
   611     "FUNCTIONALITY",
       
   612     EmptySetupL, MT_CSSSettingsRefreshContainer_NewLL, EmptyTeardown)
       
   613 
       
   614 // RSSSettings Class test.
       
   615 
       
   616 EUNIT_TEST(
       
   617     "RSS:Open Close",
       
   618     "RSSSettings",
       
   619     "Close",
       
   620     "FUNCTIONALITY",
       
   621     EmptySetupL, MT_RSSSettings_OpenCloseL, EmptyTeardown)
       
   622 
       
   623 EUNIT_TEST(
       
   624     "RSS:Open with EtelParam",
       
   625     "RSSSettings",
       
   626     "Open",
       
   627     "FUNCTIONALITY",
       
   628     EmptySetupL, MT_RSSSettings_Open_1L, EmptyTeardown)
       
   629 
       
   630 EUNIT_TEST(
       
   631     "RSS:RegisterAll",
       
   632     "RSSSettings",
       
   633     "RegisterAll",
       
   634     "FUNCTIONALITY",
       
   635     SetupL, MT_RSSSettings_RegisterAllL, Teardown)
       
   636 
       
   637 EUNIT_TEST(
       
   638     "RSS:Register",
       
   639     "RSSSettings",
       
   640     "Register",
       
   641     "FUNCTIONALITY",
       
   642     SetupL, MT_RSSSettings_RegisterL, Teardown)
       
   643 
       
   644 EUNIT_TEST(
       
   645     "RSS:CancelAll",
       
   646     "RSSSettings",
       
   647     "CancelAll",
       
   648     "FUNCTIONALITY",
       
   649     SetupL, MT_RSSSettings_CancelAllL, Teardown)
       
   650 
       
   651 EUNIT_TEST(
       
   652     "RSS:Cancel",
       
   653     "RSSSettings",
       
   654     "Cancel",
       
   655     "FUNCTIONALITY",
       
   656     SetupL, MT_RSSSettings_CancelL, Teardown)
       
   657 
       
   658 EUNIT_TEST(
       
   659     "RSS:Get",
       
   660     "RSSSettings",
       
   661     "Get",
       
   662     "FUNCTIONALITY",
       
   663     SetupL, MT_RSSSettings_GetL, Teardown)
       
   664 
       
   665 EUNIT_TEST(
       
   666     "RSS:Set",
       
   667     "RSSSettings",
       
   668     "Set",
       
   669     "FUNCTIONALITY",
       
   670     SetupL, MT_RSSSettings_SetL, Teardown)
       
   671 
       
   672 EUNIT_TEST(
       
   673     "RSS:HandleSIMChanged",
       
   674     "RSSSettings",
       
   675     "HandleSIMChanged",
       
   676     "FUNCTIONALITY",
       
   677     SetupL, MT_RSSSettings_HandleSIMChangedL, Teardown)
       
   678 
       
   679 EUNIT_TEST(
       
   680     "RSS:PreviousCugValue",
       
   681     "RSSSettings",
       
   682     "PreviousCugValue",
       
   683     "FUNCTIONALITY",
       
   684     SetupL, MT_RSSSettings_PreviousCugValueL, Teardown)
       
   685 
       
   686 EUNIT_TEST(
       
   687     "RSS:ResetPreviousCugValue",
       
   688     "RSSSettings",
       
   689     "ResetPreviousCugValue",
       
   690     "FUNCTIONALITY",
       
   691     SetupL, MT_RSSSettings_ResetPreviousCugValueL, Teardown)
       
   692 
       
   693 EUNIT_TEST(
       
   694     "RSS:HandleRefresh",
       
   695     "RSSSettings",
       
   696     "HandleRefresh",
       
   697     "FUNCTIONALITY",
       
   698     SetupL, MT_RSSSettings_HandleRefreshL, Teardown)
       
   699 
       
   700 EUNIT_TEST(
       
   701     "RSS:IsValueValidCugIndex",
       
   702     "RSSSettings",
       
   703     "IsValueValidCugIndex",
       
   704     "FUNCTIONALITY",
       
   705     SetupL, MT_RSSSettings_IsValueValidCugIndexL, Teardown)
       
   706 
       
   707 
       
   708 EUNIT_END_TEST_TABLE
       
   709 
       
   710 //  END OF FILE