datasourcemodules/defaultpositioningmodule/test/te_defproxy/src/classfallbackstep.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2008-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Example CTestStep derived implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file ClassFallbackStep.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "classfallbackstep.h"
       
    23 #include "te_defproxysuitedefs.h"
       
    24 
       
    25 CClassFallbackStep::~CClassFallbackStep()
       
    26 /**
       
    27  * Destructor
       
    28  */
       
    29 	{
       
    30 	}
       
    31 
       
    32 CClassFallbackStep::CClassFallbackStep()
       
    33 /**
       
    34  * Constructor
       
    35  */
       
    36 	{
       
    37 	SetTestStepName(KClassFallbackStep);
       
    38 	}
       
    39 
       
    40 TVerdict CClassFallbackStep::doTestStepPreambleL()
       
    41 /**
       
    42  * @return - TVerdict code
       
    43  * Override of base class virtual
       
    44  */
       
    45 	{
       
    46 	CTe_defproxySuiteStepBase::doTestStepPreambleL();
       
    47 	SetTestStepResult(EPass);
       
    48 	return TestStepResult();
       
    49 	}
       
    50 
       
    51 
       
    52 TVerdict CClassFallbackStep::doTestStepL()
       
    53 /**
       
    54  * @return - TVerdict code
       
    55  * Override of base class pure virtual
       
    56  * Our implementation only gets called if the base class doTestStepPreambleL() did
       
    57  * not leave. That being the case, the current test result value will be EPass.
       
    58  */
       
    59 	{
       
    60     StandardPrepareL();
       
    61 
       
    62     TRequestStatus status;
       
    63     TPositionSatelliteInfo posSatInfo;
       
    64 
       
    65     // all enabled
       
    66 
       
    67     iPositioner.NotifyPositionUpdate(posSatInfo, status);
       
    68     User::WaitForRequest(status);
       
    69     CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest);
       
    70     CheckExpectedResult(posSatInfo.ModuleId(), KUidLcfPsy3, KWrongModuleIdReturned);
       
    71 
       
    72     // disable the only capable - Dummy3
       
    73 
       
    74     ToggleModuleL(KUidLcfPsy3, EFalse);
       
    75     User::After(KDelay);
       
    76 
       
    77     iPositioner.NotifyPositionUpdate(posSatInfo, status);
       
    78     User::WaitForRequest(status);
       
    79     CheckExpectedResult(status.Int(), KErrArgument, KWrongRequestResult);
       
    80 
       
    81     // disable all
       
    82     DisableAllModulesL();
       
    83     User::After(KDelay);
       
    84 
       
    85     iPositioner.NotifyPositionUpdate(posSatInfo, status);
       
    86     User::WaitForRequest(status);
       
    87     CheckExpectedResult(status.Int(), KErrNotFound, KWrongRequestResult);
       
    88 
       
    89     StandardCleanup();
       
    90 	return TestStepResult();
       
    91 	}
       
    92 
       
    93 
       
    94 
       
    95 TVerdict CClassFallbackStep::doTestStepPostambleL()
       
    96 /**
       
    97  * @return - TVerdict code
       
    98  * Override of base class virtual
       
    99  */
       
   100 	{
       
   101 	CTe_defproxySuiteStepBase::doTestStepPostambleL();
       
   102 	return TestStepResult();
       
   103 	}