telephonyserverplugins/simtsy/test/Te_Sim/Te_SimPhBkLockInfoTest.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 #include "Te_SimPhBkLockInfoTest.h"
       
    17 
       
    18 CSimPhBkLockInfoTest::CSimPhBkLockInfoTest() 
       
    19 	{ 
       
    20 	SetTestStepName(_L("LockInfoTest"));
       
    21 	}
       
    22 
       
    23 TVerdict CSimPhBkLockInfoTest::doTestStepL()
       
    24 	{
       
    25 	INFO_PRINTF1(_L("BeginPhBkLockInfoTest"));
       
    26 
       
    27  	CreateConfigFileL(_L("c:\\config3.txt"));
       
    28  	SetTestNumberL(0);
       
    29 
       
    30 	TInt ret = iPhone.Open(iTelServer,KPhoneName); 
       
    31 	INFO_PRINTF2(_L("Result: %d"),ret);
       
    32 	TESTL(ret == KErrNone); 
       
    33 	INFO_PRINTF1(_L("Opened phone object"));
       
    34 	TRequestStatus aReqStatus;
       
    35 	RMobilePhone::TMobilePhoneLockInfoV1 asyncLockInfo;
       
    36 	RMobilePhone::TMobilePhoneLockInfoV1Pckg asyncLockInfoPckg(asyncLockInfo);
       
    37 
       
    38 	INFO_PRINTF1(_L("ELockICC"));
       
    39 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockICC,asyncLockInfoPckg);
       
    40 	User::WaitForRequest(aReqStatus);
       
    41 	TESTL(aReqStatus == KErrNone);
       
    42 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusUnlocked);
       
    43 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetDisabled);
       
    44 
       
    45 	INFO_PRINTF1(_L("ELockPin2"));
       
    46 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockPin2,asyncLockInfoPckg);
       
    47 	User::WaitForRequest(aReqStatus);
       
    48 	TESTL(aReqStatus == KErrNone);
       
    49 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusLockUnknown);
       
    50 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetUnknown);
       
    51 
       
    52 	INFO_PRINTF1(_L("ELockHiddenKey"));
       
    53 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockHiddenKey,asyncLockInfoPckg);
       
    54 	User::WaitForRequest(aReqStatus);
       
    55 	TESTL(aReqStatus == KErrNone);
       
    56 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusLocked);
       
    57 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetEnabled);
       
    58 
       
    59 	INFO_PRINTF1(_L("ELockUSimApp"));
       
    60 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockUSimApp,asyncLockInfoPckg);
       
    61 	User::WaitForRequest(aReqStatus);
       
    62 	TESTL(aReqStatus == KErrNone);
       
    63 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusLockUnknown);
       
    64 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetUnknown);
       
    65 
       
    66 	INFO_PRINTF1(_L("ELockSecondUSimApp"));
       
    67 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockSecondUSimApp,asyncLockInfoPckg);
       
    68 	User::WaitForRequest(aReqStatus);
       
    69 	TESTL(aReqStatus == KErrNone);
       
    70 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusLockUnknown);
       
    71 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetUnknown);
       
    72 
       
    73 	INFO_PRINTF1(_L("ELockUniversalPin"));
       
    74 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockUniversalPin,asyncLockInfoPckg);
       
    75 	User::WaitForRequest(aReqStatus);
       
    76 	TESTL(aReqStatus == KErrNone);
       
    77 	TESTL(asyncLockInfo.iStatus == RMobilePhone::EStatusLockUnknown);
       
    78 	TESTL(asyncLockInfo.iSetting == RMobilePhone::ELockSetUnknown);
       
    79 
       
    80 	INFO_PRINTF1(_L("ELockPhoneDevice"));
       
    81 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockPhoneDevice,asyncLockInfoPckg);
       
    82 	User::WaitForRequest(aReqStatus);
       
    83 	TESTL(aReqStatus == KErrNotSupported);
       
    84 
       
    85 	INFO_PRINTF1(_L("ELockPhoneToICC"));
       
    86 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockPhoneToICC,asyncLockInfoPckg);
       
    87 	User::WaitForRequest(aReqStatus);
       
    88 	TESTL(aReqStatus == KErrNotSupported);
       
    89 
       
    90 	INFO_PRINTF1(_L("ELockPhoneToFirstICC"));
       
    91 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockPhoneToFirstICC,asyncLockInfoPckg);
       
    92 	User::WaitForRequest(aReqStatus);
       
    93 	TESTL(aReqStatus == KErrNotSupported);
       
    94 
       
    95 	INFO_PRINTF1(_L("ELockOTA"));
       
    96 	iPhone.GetLockInfo(aReqStatus,RMobilePhone::ELockOTA,asyncLockInfoPckg);
       
    97 	User::WaitForRequest(aReqStatus);
       
    98 	TESTL(aReqStatus == KErrNotSupported);
       
    99 
       
   100 	iPhone.Close();
       
   101 	ASSERT(RThread().RequestCount()==0);
       
   102 
       
   103 	return TestStepResult();
       
   104 	}
       
   105