lbs/common/src/ctlbsstepresetdefaultadmin.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     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 ctlbsstepresetdefaultadmin.cpp
       
    15 // This is the class implementation for the Reset Default Admin Test Step
       
    16 // 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology
       
    24  @test
       
    25 */
       
    26 
       
    27 #include <centralrepository.h>		  
       
    28 #include "ctlbsstepresetdefaultadmin.h"
       
    29 #include <lbsadmin.h>
       
    30 
       
    31 CT_LbsStep_ResetDefaultAdmin::CT_LbsStep_ResetDefaultAdmin(CT_LbsServer& aParent) : CT_LbsStep(aParent)
       
    32 	{
       
    33 	SetTestStepName(KLbsStep_ResetDefaultAdmin);
       
    34 	}
       
    35 
       
    36 /**
       
    37 Static Constructor
       
    38 */
       
    39 CT_LbsStep_ResetDefaultAdmin* CT_LbsStep_ResetDefaultAdmin::New(CT_LbsServer& aParent)
       
    40 	{
       
    41 	return new CT_LbsStep_ResetDefaultAdmin(aParent);
       
    42 	// Note the lack of ELeave.
       
    43 	// This means that having insufficient memory will return NULL;
       
    44 	}
       
    45 
       
    46 
       
    47 /**
       
    48 @pre 	
       
    49 @return Test verdict
       
    50 @post	All admin settings reset to default
       
    51 */
       
    52 TVerdict CT_LbsStep_ResetDefaultAdmin::doTestStepL()
       
    53 	{
       
    54 	INFO_PRINTF1(_L("&gt;&gt;CT_LbsStep_ResetDefaultAdmin::doTestStepL()"));
       
    55 
       
    56 	CLbsAdmin* adminApi = CLbsAdmin::NewL();
       
    57 	CleanupStack::PushL(adminApi);
       
    58 	
       
    59 	TInt err = adminApi->ResetToDefault();	
       
    60 
       
    61 	if(!KErrNone == err)
       
    62 		{
       
    63 		SetTestStepResult(EFail);
       
    64 		}
       
    65 		
       
    66 	// Reset the LbsRoot cenrep also.
       
    67 	const TUid KLbsRootRepositoryUid = { 0x10282266 };
       
    68 	CRepository* rootRep = CRepository::NewLC(KLbsRootRepositoryUid);
       
    69 	err = rootRep->Reset();
       
    70 
       
    71 	if(!KErrNone == err)
       
    72 		{
       
    73 		SetTestStepResult(EFail);
       
    74 		}
       
    75 	
       
    76 	INFO_PRINTF1(_L("&lt;&lt;CT_LbsStep_ResetDefaultAdmin::doTestStepL()"));
       
    77 
       
    78 	CleanupStack::PopAndDestroy(2, adminApi); 	
       
    79 
       
    80 	// Alow the change to be propagated
       
    81 	User::After(4000000);
       
    82 
       
    83 	return TestStepResult();
       
    84 	}