common/tools/ats/smoketest/lbs/common/src/ctlbsstepstartlbs.cpp
changeset 748 e13acd883fbe
child 872 17498133d9ad
equal deleted inserted replaced
747:76f9aaeefbab 748:e13acd883fbe
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // @file ctlbslocdatasrc.cpp
       
    15 // This is the class implementation for the step to start the lbs system
       
    16 // EPOC includes.
       
    17 // LBS includes. 
       
    18 // 
       
    19 //
       
    20 
       
    21 // LBS test includes.
       
    22 #include "ctlbsstepstartlbs.h"
       
    23 #include "tlbsutils.h"
       
    24 #include "lbstestclient.h"
       
    25 
       
    26 /**
       
    27  * Destructor
       
    28  */
       
    29 CT_LbsStep_StartLbs::~CT_LbsStep_StartLbs()
       
    30 	{
       
    31 	}
       
    32 
       
    33 
       
    34 /**
       
    35  * Constructor
       
    36  */
       
    37 CT_LbsStep_StartLbs::CT_LbsStep_StartLbs(CT_LbsServer& aParent) : CT_LbsStep(aParent)
       
    38 	{
       
    39 	SetTestStepName(KLbsStep_StartLbs);
       
    40 	}
       
    41 
       
    42 
       
    43 /**
       
    44 Static Constructor
       
    45 */
       
    46 CT_LbsStep_StartLbs* CT_LbsStep_StartLbs::New(CT_LbsServer& aParent)
       
    47 	{
       
    48 	return new CT_LbsStep_StartLbs(aParent);
       
    49 	// Note the lack of ELeave.
       
    50 	// This means that having insufficient memory will return NULL;
       
    51 	}
       
    52 
       
    53 
       
    54 /**
       
    55  * @return - TVerdict code
       
    56  * Override of base class pure virtual
       
    57  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    58  * not leave. That being the case, the current test result value will be EPass.
       
    59  */
       
    60 TVerdict CT_LbsStep_StartLbs::doTestStepL()
       
    61 	{
       
    62 	// Test step used to start the location manager.
       
    63 	INFO_PRINTF1(_L(">>CT_LbsStep_StartLbs::doTestStepL()"));
       
    64 
       
    65 	//*******************************************************************/
       
    66 	// for diagnostics print out important Admin settings that will
       
    67 	// determine how lbs bahaves
       
    68 	
       
    69 	CLbsAdmin* adminApi = CLbsAdmin::NewL();
       
    70 	CleanupStack::PushL(adminApi);
       
    71 	
       
    72 	CLbsAdmin::TGpsMode mode;
       
    73 	TInt err = adminApi->Get(KLbsSettingHomeGpsMode, mode);	
       
    74 	if (err == KErrNone)
       
    75 		{
       
    76 		INFO_PRINTF2(_L("KLbsSettingHomeGpsMode = %d"),mode);
       
    77 		}
       
    78 	else
       
    79 		{
       
    80 		INFO_PRINTF1(_L("KLbsSettingHomeGpsMode not in Admin"));
       
    81 		}
       
    82 			
       
    83 	CLbsAdmin::TSpecialFeature	specialFeature;
       
    84 	
       
    85 	err = adminApi->Get(KLbsSpecialFeatureIgnoreAccuracy, specialFeature);
       
    86 	if (err == KErrNone)
       
    87 		{
       
    88 		INFO_PRINTF2(_L("KLbsSpecialFeatureIgnoreAccuracy = %d"),specialFeature);
       
    89 		}
       
    90 	else
       
    91 		{
       
    92 		INFO_PRINTF1(_L("KLbsSpecialFeatureIgnoreAccuracy not in Admin"));
       
    93 		}
       
    94 	
       
    95 	err = adminApi->Get(KLbsSpecialFeatureAllowTBFinalNetPos, specialFeature);
       
    96 	if (err == KErrNone)
       
    97 		{
       
    98 		INFO_PRINTF2(_L("KLbsSpecialFeatureAllowTBFinalNetPos = %d"),specialFeature);
       
    99 		}
       
   100 		else
       
   101 		{
       
   102 		INFO_PRINTF1(_L("KLbsSpecialFeatureAllowTBFinalNetPos not in Admin"));
       
   103 		}
       
   104 		
       
   105 	err = adminApi->Get(KLbsSpecialFeatureWithholdDeliveryOfReferencePositions, specialFeature);
       
   106 	if (err == KErrNone)
       
   107 		{
       
   108 		INFO_PRINTF2(_L("KLbsSpecialFeatureWithholdDeliveryOfReferencePositions = %d"),specialFeature);
       
   109 		}
       
   110 		else
       
   111 		{
       
   112 		INFO_PRINTF1(_L("KLbsSpecialFeatureWithholdDeliveryOfReferencePositions not in Admin"));
       
   113 		}
       
   114 		
       
   115 	err = adminApi->Get(KLbsSpecialFeatureIntermediateFutileUpdate, specialFeature);
       
   116 	if (err == KErrNone)
       
   117 		{
       
   118 		INFO_PRINTF2(_L("KLbsSpecialFeatureIntermediateFutileUpdate = %d"),specialFeature);
       
   119 		}
       
   120 		else
       
   121 		{
       
   122 		INFO_PRINTF1(_L("KLbsSpecialFeatureIntermediateFutileUpdate not in Admin"));
       
   123 		}
       
   124 
       
   125 
       
   126 	CleanupStack::PopAndDestroy(adminApi);
       
   127 
       
   128 	//*******************************************************************/
       
   129 	
       
   130 	if (TestStepResult() == EPass)
       
   131 		{	
       
   132 		// Create the test properties.
       
   133 		T_LbsUtils utils;
       
   134 		utils.CreateTestPropertiesL();
       
   135 		
       
   136 		// Now start the LBS system
       
   137 		CLbsTestServer* testServer = CLbsTestServer::NewL();
       
   138 		CleanupStack::PushL(testServer);
       
   139 		User::LeaveIfError(testServer->StartLbsSystem());
       
   140 		CleanupStack::PopAndDestroy(testServer);
       
   141 		}
       
   142 		
       
   143 	INFO_PRINTF1(_L("<<CT_LbsStep_StartLbs::doTestStepL()"));
       
   144 
       
   145 	return TestStepResult();
       
   146 	}