networkprotocolmodules/suplprotocolmodule/SuplProtocol/test/src/molr8Step.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 molr8Step.cpp
       
    20  @internalTechnology
       
    21 */
       
    22 #include "molr8Step.h"
       
    23 #include "te_suplprotocolsuitedefs.h"
       
    24 
       
    25 
       
    26 /**
       
    27  * Destructor
       
    28  */
       
    29  Cmolr8Step::~Cmolr8Step()
       
    30 	{
       
    31 	}
       
    32 
       
    33 /**
       
    34  * Constructor
       
    35  */
       
    36 Cmolr8Step::Cmolr8Step()
       
    37 	{
       
    38 	SetTestStepName(Kmolr8Step);
       
    39 	}
       
    40 
       
    41 /**
       
    42  * @return - TVerdict code
       
    43  * Override of base class virtual
       
    44  */
       
    45 TVerdict Cmolr8Step::doTestStepPreambleL()
       
    46 	{
       
    47 	// Call base class method for pre test actions	
       
    48 	CTe_suplprotocolSuiteStepBase::doTestStepPreambleL();
       
    49 	 
       
    50 	TLbsNetProtocolModuleParams param(*iGatewayObserver);
       
    51 	iModule = CSuplGatewayInterface::NewL(reinterpret_cast<TAny*>(&param));
       
    52 	 
       
    53 	return TestStepResult();
       
    54 	}
       
    55 
       
    56 /** Perform CMoLrStep8 test step.
       
    57 This test verifies that the SUPL Protocol Module completes a 
       
    58 self-locate session when the positioning method is Autonomous.
       
    59 
       
    60 @return TVerdict test result code
       
    61 */
       
    62 TVerdict Cmolr8Step::doTestStepL()
       
    63 
       
    64 	{
       
    65 	INFO_PRINTF1(_L("\t********************************************************************"));
       
    66 	INFO_PRINTF1(_L("\tAutonomous self-locate request session is completed"));
       
    67 	INFO_PRINTF1(_L("\t********************************************************************"));
       
    68 	INFO_PRINTF1(_L("- START -"));
       
    69 	// Initiate MO-LR
       
    70 	TLbsNetSessionId sessionId1(TUid::Uid(0x87654321), 0x1111);
       
    71 	TLbsNetPosRequestOptionsAssistance options1;
       
    72 	options1.SetNewClientConnected(ETrue);
       
    73 	// Make the request an autonomous one
       
    74 	options1.SetPosMode(TPositionModuleInfo::ETechnologyTerminal);
       
    75 	TLbsNetPosRequestQuality quality1;
       
    76 	options1.SetRequestQuality(quality1);
       
    77 	TLbsAsistanceDataGroup dataRequestMask1 = EAssistanceDataBadSatList;
       
    78 	options1.SetDataRequestMask(dataRequestMask1);
       
    79 	INFO_PRINTF1(_L("\tLBS -> RequestSelfLocation"));
       
    80 	iModule->RequestSelfLocation(sessionId1, options1);
       
    81 
       
    82 	
       
    83 	// Check gateway session completed
       
    84 	if (EFail == CheckGatewayCallbackL(
       
    85 				CSuplGatewayObserver::EProcessSessionComplete))
       
    86 		{
       
    87 		SetTestStepResult(EFail);
       
    88 		return TestStepResult();
       
    89 		}
       
    90 	INFO_PRINTF1(_L("\tLBS <- ProcessSessionComplete"));
       
    91 
       
    92 	// Check if more observer activity takes place
       
    93 	if (iGatewayObserver->IsMoreObserverActivity() ||
       
    94 	iNetworkObserver->IsMoreObserverActivity())
       
    95 	{
       
    96 	SetTestStepResult(EFail);
       
    97 	return TestStepResult();
       
    98 	}
       
    99 	INFO_PRINTF1(_L("- END -"));
       
   100 	
       
   101 	SetTestStepResult(EPass);
       
   102 	return TestStepResult();
       
   103 	}
       
   104 
       
   105 
       
   106 /**
       
   107  * @return - TVerdict code
       
   108  * Override of base class virtual
       
   109  */
       
   110 TVerdict Cmolr8Step::doTestStepPostambleL()
       
   111 
       
   112 	{
       
   113 	delete iModule;
       
   114 
       
   115 	// Call base class method for post test actions	
       
   116 	CTe_suplprotocolSuiteStepBase::doTestStepPostambleL();
       
   117 	return TestStepResult();
       
   118 	}