datasourcemodules/defaultpositioningmodule/test/te_defproxy/src/availabilityfallbackstep.cpp
changeset 36 b47902b73a93
parent 0 9cfd9a3ee49c
equal deleted inserted replaced
35:a2efdd544abf 36:b47902b73a93
       
     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 AvailabilityFallbackStep.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "availabilityfallbackstep.h"
       
    23 #include "te_defproxysuitedefs.h"
       
    24 
       
    25 CAvailabilityFallbackStep::~CAvailabilityFallbackStep()
       
    26 /**
       
    27  * Destructor
       
    28  */
       
    29 	{
       
    30 	}
       
    31 
       
    32 CAvailabilityFallbackStep::CAvailabilityFallbackStep()
       
    33 /**
       
    34  * Constructor
       
    35  */
       
    36 	{
       
    37 	SetTestStepName(KAvailabilityFallbackStep);
       
    38 	}
       
    39 
       
    40 TVerdict CAvailabilityFallbackStep::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 CAvailabilityFallbackStep::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     //PSY order: Dummy1, Psy6, Dummy3
       
    61     StandardPrepareL();
       
    62 
       
    63     TRequestStatus status;
       
    64     TPositionInfo posInfo;
       
    65 
       
    66     // dummy1 must be disabled
       
    67     ToggleModuleL(KUidLcfPsy1, EFalse);
       
    68 
       
    69     // psy6 must have delay
       
    70     HPositionGenericInfo* genInfo = HPositionGenericInfo::NewLC();
       
    71     SetPsy6Delay(*genInfo, KDelay);
       
    72 
       
    73     // 1st
       
    74     PositionRequestWithCheck(*genInfo, KErrNone, KUidLcfPsy6);
       
    75 
       
    76     // 2nd
       
    77     SetPsy6Delay(*genInfo, KDelay);
       
    78     iPositioner.NotifyPositionUpdate(*genInfo, status);
       
    79 
       
    80     User::After(KTinyDelay);
       
    81     ToggleModuleL(KUidLcfPsy6, EFalse);
       
    82 
       
    83     User::WaitForRequest(status);
       
    84     CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest);
       
    85     CheckExpectedResult(genInfo->ModuleId(), KUidLcfPsy3, KWrongModuleIdReturned);
       
    86 
       
    87     // 3rd
       
    88     SetPsy6Delay(*genInfo, KDelay);
       
    89     iPositioner.NotifyPositionUpdate(*genInfo, status);
       
    90 
       
    91     ToggleModuleL(KUidLcfPsy6, ETrue);
       
    92 
       
    93     User::WaitForRequest(status);
       
    94     CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest);
       
    95     CheckExpectedResult(genInfo->ModuleId(), KUidLcfPsy3, KWrongModuleIdReturned);
       
    96 
       
    97     User::After(KDelay);
       
    98 
       
    99     // 4th
       
   100     SetPsy6Delay(*genInfo, KDelay);
       
   101     PositionRequestWithCheck(*genInfo, KErrNone, KUidLcfPsy6);
       
   102 
       
   103     // 5th
       
   104     SetPsy6Delay(*genInfo, KDelay);
       
   105     iPositioner.NotifyPositionUpdate(*genInfo, status);
       
   106 
       
   107     ToggleModuleL(KUidLcfPsy6, EFalse);
       
   108 
       
   109     User::WaitForRequest(status);
       
   110     CheckExpectedResult(status.Int(), KErrNone, KFailedPositionRequest);
       
   111     CheckExpectedResult(genInfo->ModuleId(), KUidLcfPsy3, KWrongModuleIdReturned);
       
   112 
       
   113     // 6th
       
   114     DisableAllModulesL();
       
   115 
       
   116     iPositioner.NotifyPositionUpdate(*genInfo, status);
       
   117     User::WaitForRequest(status);
       
   118     CheckExpectedResult(status.Int(), KErrNotFound, KWrongRequestResult);
       
   119 
       
   120     // 7th
       
   121     ToggleModuleL(KUidLcfPsy6, ETrue);
       
   122     PositionRequestWithCheck(posInfo, KErrNone, KUidLcfPsy6);
       
   123 
       
   124     // cleanup
       
   125     CleanupStack::PopAndDestroy(genInfo);
       
   126     StandardCleanup();
       
   127 	return TestStepResult();
       
   128 	}
       
   129 
       
   130 
       
   131 
       
   132 TVerdict CAvailabilityFallbackStep::doTestStepPostambleL()
       
   133 /**
       
   134  * @return - TVerdict code
       
   135  * Override of base class virtual
       
   136  */
       
   137 	{
       
   138 	CTe_defproxySuiteStepBase::doTestStepPostambleL();
       
   139 	return TestStepResult();
       
   140 	}