lbs/lbsclient/src/ctlbsclientpostp4705.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 2001-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 //
       
    15 
       
    16 
       
    17 
       
    18 //  INCLUDES
       
    19 #include "ctlbsclientpostp4705.h"
       
    20 #include <EPos_CPosModules.h>
       
    21 #include <EPos_CPosModuleUpdate.h>
       
    22 #include <EPos_CPosModuleIdList.h>
       
    23 
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 
       
    27 // ---------------------------------------------------------
       
    28 // Constructor.
       
    29 // ---------------------------------------------------------
       
    30 CT_LbsClientPosTp4705::CT_LbsClientPosTp4705(CT_LbsServer& aParent): CT_LbsPortedStepBase(aParent)
       
    31     {  
       
    32     _LIT(KTestName, "TP4705 - Default Proxy fallback-partial update1");
       
    33     SetTestStepName(KTestName); 
       
    34     }
       
    35 
       
    36 // ---------------------------------------------------------
       
    37 // Destructor.
       
    38 // ---------------------------------------------------------
       
    39 CT_LbsClientPosTp4705::~CT_LbsClientPosTp4705()
       
    40     {
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // CPosTp4705::CloseTest
       
    45 //
       
    46 // (other items were commented in a header).
       
    47 // ---------------------------------------------------------
       
    48 //
       
    49 void CT_LbsClientPosTp4705::CloseTest()
       
    50     {
       
    51     ClosePositioner();
       
    52     Disconnect();
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------
       
    56 // CPosTp4705::StartL
       
    57 //
       
    58 // (other items were commented in a header).
       
    59 // ---------------------------------------------------------
       
    60 //
       
    61 void CT_LbsClientPosTp4705::StartL()
       
    62     {
       
    63     ConnectL();
       
    64 
       
    65     SetupProxyPSYsL();
       
    66 
       
    67     TInt err = OpenPositioner();
       
    68     _LIT(KOpenErr, "Error when opening positioner, %d");
       
    69     AssertTrueL(err == KErrNone, KOpenErr, err);
       
    70     
       
    71     _LIT(KServiceName, "TP4705");
       
    72     iPositioner.SetRequestor(CRequestor::ERequestorService, CRequestor::EFormatApplication, KServiceName);
       
    73 
       
    74     /////////////////////////////////////////////
       
    75 	// Request 1
       
    76 	/////////////////////////////////////////////
       
    77     // Check that partial update is not supported
       
    78     TPositionUpdateOptions updateOptions;
       
    79     updateOptions.SetAcceptPartialUpdates(ETrue);
       
    80     iPositioner.SetUpdateOptions(updateOptions);
       
    81         
       
    82     TInt request = 4705;
       
    83     TPositionInfo posInfo;
       
    84     RequestL(posInfo, request, KEspectedErrorCodePSY2);    
       
    85       
       
    86     VerifyPositionFromL(posInfo, iUidTestPsyPartialUpdate);
       
    87     VerifyRequestTimeLessThanL(8001000);
       
    88           
       
    89     /*Default proxy fallbacks to TestPsyPartialUpdate because of time-shift,partial 
       
    90       update will be given by TestPsyPartialUpdate.Request to TestProxyPsy1
       
    91       gets cancelled after cleanup time.*/
       
    92     VerifyPsyLoadedL(iUidTestProxyPsy1);
       
    93     VerifyPsyLoadedL(iUidTestPsyPartialUpdate);
       
    94     
       
    95     VerifyPositionL(posInfo, 30, 40, 50);
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CPosTp4705::SetupProxyPSYsL
       
   100 //
       
   101 // (other items were commented in a header).
       
   102 // ---------------------------------------------------------
       
   103 //
       
   104 void CT_LbsClientPosTp4705::SetupProxyPSYsL()
       
   105     {
       
   106     CPosModules* db = CPosModules::OpenL();
       
   107     CleanupStack::PushL(db);
       
   108 
       
   109     CPosModuleUpdate* moduleUpdate = CPosModuleUpdate::NewLC();
       
   110 
       
   111     moduleUpdate->SetUpdateAvailability(EFalse);
       
   112     
       
   113     CPosModuleIdList* prioList = db->ModuleIdListLC();
       
   114 	
       
   115     // Disable all PSY:s except PSYs used by this test case
       
   116     
       
   117     for (TInt i = 0 ; i < prioList->Count(); i++)
       
   118         {
       
   119         if ((*prioList)[i] != iUidTestProxyPsy1 &&
       
   120             (*prioList)[i] != iUidTestPsyPartialUpdate)
       
   121             {
       
   122             db->UpdateModuleL((*prioList)[i], *moduleUpdate);
       
   123             }
       
   124         }
       
   125     moduleUpdate->SetUpdateAvailability(ETrue);
       
   126     db->UpdateModuleL(iUidTestProxyPsy1, *moduleUpdate);
       
   127     db->UpdateModuleL(iUidTestPsyPartialUpdate, *moduleUpdate);
       
   128     
       
   129     db->SetModulePriorityL(iUidTestProxyPsy1, 0);
       
   130     db->SetModulePriorityL(iUidTestPsyPartialUpdate, 1);
       
   131     
       
   132     CleanupStack::PopAndDestroy(prioList);
       
   133     CleanupStack::PopAndDestroy(moduleUpdate);
       
   134     CleanupStack::PopAndDestroy(db);
       
   135     } 
       
   136 
       
   137 //  End of File
       
   138 
       
   139