common/tools/ats/smoketest/lbs/common/src/ctlbsstepsetupprotocolstub.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 ctlbsstep_setupprotocolstub.cpp
       
    15 // This is the class implementation for the Set Autonomous Moder Test Step
       
    16 // 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology
       
    24  @test
       
    25 */
       
    26 		  
       
    27 #include "ctlbsstepsetupprotocolstub.h"
       
    28 #include <lbsadmin.h>
       
    29 
       
    30 CT_LbsStep_SetupProtocolStub::CT_LbsStep_SetupProtocolStub(CT_LbsServer& aParent) : CT_LbsStep(aParent)
       
    31 	{
       
    32 	SetTestStepName(KLbsStep_SetupProtocolStub);
       
    33 	}
       
    34 
       
    35 /**
       
    36 Static Constructor
       
    37 */
       
    38 CT_LbsStep_SetupProtocolStub* CT_LbsStep_SetupProtocolStub::New(CT_LbsServer& aParent)
       
    39 	{
       
    40 	return new CT_LbsStep_SetupProtocolStub(aParent);
       
    41 	// Note the lack of ELeave.
       
    42 	// This means that having insufficient memory will return NULL;
       
    43 	}
       
    44 
       
    45 
       
    46 /**
       
    47 @pre 	
       
    48 @return Test verdict
       
    49 @post	GPSMode set to autonomous
       
    50 */
       
    51 TVerdict CT_LbsStep_SetupProtocolStub::doTestStepL()
       
    52 	{
       
    53 	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_SetupProtocolStub::doTestStepL()"));
       
    54 
       
    55 	CLbsAdmin* adminApi = CLbsAdmin::NewL();
       
    56 	CleanupStack::PushL(adminApi);
       
    57 	TUid uid;
       
    58 
       
    59 	TInt err = adminApi->Set(KLbsSettingHomeProtocolModule, TUid::Uid(0x10282293));	
       
    60 	User::LeaveIfError(err);
       
    61 	err = adminApi->Get(KLbsSettingHomeProtocolModule, uid);	
       
    62 	User::LeaveIfError(err);
       
    63 	
       
    64 	if(uid.iUid != 0x10282293)
       
    65 		{
       
    66 		INFO_PRINTF1(_L("Admin setting didn't work"));
       
    67 		SetTestStepResult(EFail);
       
    68 		}					
       
    69 		
       
    70 	CleanupStack::PopAndDestroy(adminApi);
       
    71 
       
    72 	// Alow he setting to be propagated
       
    73 	User::After(2000000);
       
    74 
       
    75 	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_SetupProtocolStub::doTestStepL()"));
       
    76 
       
    77 	return TestStepResult();
       
    78 	}