localisation/apparchitecture/tef/T_ControlPanelTest.cpp
branchSymbian3
changeset 57 b8d18c84f71c
parent 6 c108117318cb
equal deleted inserted replaced
56:aa99f2208aad 57:b8d18c84f71c
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // Tests control panel Application Apparc base classes and utility functions to get application's data.\n
    14 // Tests control panel Application Apparc base classes and utility functions to get application's data.\n
    15 // 
    15 // 
       
    16 // t_controlpaneltest.cpp
    16 //
    17 //
    17 
    18 
    18 
    19 /**
    19 
    20  @file t_controlpaneltest.cpp
    20 /**
       
    21  @file
       
    22  @internalComponent - Internal Symbian test code 
    21  @internalComponent - Internal Symbian test code 
    23 */
    22 */
    24 
    23 
    25 #include <f32file.h>
    24 #include <f32file.h>
    26 #include <fbs.h>
    25 #include <fbs.h>
    27 #include <s32std.h> 
    26 #include <s32std.h> 
    28 #include <s32stor.h> 
    27 #include <s32stor.h> 
    29 #include <s32file.h> 
    28 #include <s32file.h> 
    30 
    29 
    31 #include <apaid.h>
    30 #include <apaid.h>
    32 #include "..\apparc\apadll.h"
    31 #include "../apparc/apadll.h"
    33 #include <apgaplst.h>
    32 #include <apgaplst.h>
    34 #include <apgicnfl.h>
    33 #include <apgicnfl.h>
    35 #include <apgdoor.h>
    34 #include <apgdoor.h>
    36 #include <apfrec.h>
    35 #include <apfrec.h>
    37 #include <apfctlf.h>
    36 #include <apfctlf.h>
    38 #include <apgctl.h>
    37 #include <apgctl.h>
    39 #include <apgaplst.h>
    38 #include <apgaplst.h>
    40 #include <apaflrec.h>
    39 #include <apaflrec.h>
    41 #include <apgcli.h>
    40 #include <apgcli.h>
    42 #include <apacmdln.h>
    41 #include <apacmdln.h>
    43 #include <apsserv.h>
    42 #include "appfwk_test_appui.h"
    44 #include <appfwk_test_AppUi.h>
       
    45 
    43 
    46 #include "T_ControlPanelTest.h"
    44 #include "T_ControlPanelTest.h"
    47 #include "tstapp.h"
    45 #include "tstapp.h"
    48 #include <w32std.h>
    46 #include <w32std.h>
    49 
    47 
    58 _LIT(KRSCREGDIR,"C:\\private\\10003a3f\\import\\apps\\");
    56 _LIT(KRSCREGDIR,"C:\\private\\10003a3f\\import\\apps\\");
    59 _LIT(KNEWCTLPATH,"C:\\sys\\bin\\app_CTRL2.exe");
    57 _LIT(KNEWCTLPATH,"C:\\sys\\bin\\app_CTRL2.exe");
    60 _LIT(KSRCRESOURCEPATH,"Z:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
    58 _LIT(KSRCRESOURCEPATH,"Z:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
    61 _LIT(KDESTRESOURCEPATH,"C:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
    59 _LIT(KDESTRESOURCEPATH,"C:\\private\\10003a3f\\import\\apps\\App_CTRL2_reg.Rsc");
    62 
    60 
    63 LOCAL_D TInt SimulateKey(TAny*)
    61 LOCAL_D TInt SimulateKeyL(TAny*)
    64 	{
    62 	{
    65 	User::After(3000000);
    63 	User::After(3000000);
    66 	RWsSession session;
    64 	RWsSession session;
    67 	User::LeaveIfError(session.Connect());	
    65 	User::LeaveIfError(session.Connect());	
    68 	//control down
    66 	//control down
    84 	session.SimulateRawEvent(rawEvent);
    82 	session.SimulateRawEvent(rawEvent);
    85 
    83 
    86 	session.Flush();
    84 	session.Flush();
    87 	
    85 	
    88 	session.Close();
    86 	session.Close();
    89 	
       
    90 	return KErrNone;
    87 	return KErrNone;
    91 	}
    88 	}
    92 
    89 
    93 void CT_ControlPanelTestStep::RemoveFilesFromCDrive()
    90 void CT_ControlPanelTestStep::RemoveFilesFromCDrive()
    94 	{
    91 	{
   311 	TEST(caption.CompareF(ctlCaption)==0);
   308 	TEST(caption.CompareF(ctlCaption)==0);
   312 	TEST(iControl->Icon()!=NULL);
   309 	TEST(iControl->Icon()!=NULL);
   313 	
   310 	
   314 	RThread thread;
   311 	RThread thread;
   315 	TFullName name=_L("Control Panel Test");
   312 	TFullName name=_L("Control Panel Test");
   316 	TInt r=thread.Create(name,SimulateKey,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL);
   313 	TInt r=thread.Create(name,SimulateKeyL,KDefaultStackSize,KDefaultStackSize,KDefaultStackSize,NULL);
   317 	TEST(r==KErrNone);
   314 	TEST(r==KErrNone);
   318 	thread.Resume();
   315 	thread.Resume();
   319 		
   316 		
   320 	// run the control
   317 	// run the control
   321 	TRAP(ret, iControl->CreateL()); // this call is synchronous
   318 	TRAP(ret, iControl->CreateL()); // this call is synchronous
   323 	
   320 	
   324 	thread.Close();
   321 	thread.Close();
   325 	INFO_PRINTF1(_L("Out testControls3L......"));
   322 	INFO_PRINTF1(_L("Out testControls3L......"));
   326 	}
   323 	}
   327 
   324 
   328 
       
   329 
       
   330 /**
   325 /**
   331    Auxiliary Fn for T-ControlPanelStep-testControls1L, T-ControlPanelStep-testControls2L, T-ControlPanelStep-testControls3L
   326    Auxiliary Fn for T-ControlPanelStep-testControls1L, T-ControlPanelStep-testControls2L, T-ControlPanelStep-testControls3L
   332    
   327    
   333    This method creates a control list by calling CApaSystemControlList::NewL() and 
   328    This method creates a control list by calling CApaSystemControlList::NewL() and 
   334    initiates subsequent tests on CApaSystemControlList and CApaSystemControl APIs.
   329    initiates subsequent tests on CApaSystemControlList and CApaSystemControl APIs.
   383 	CActiveScheduler::Start();
   378 	CActiveScheduler::Start();
   384 
   379 
   385 	// all outstanding requests complete - kill the scheduler
   380 	// all outstanding requests complete - kill the scheduler
   386 	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
   381 	CleanupStack::PopAndDestroy(3); //scheduler, callBack, idle
   387 	}
   382 	}
   388 
       
   389 
       
   390 
   383 
   391 
   384 
   392 /**
   385 /**
   393   Auxiliary Fn for all Test Cases.
   386   Auxiliary Fn for all Test Cases.
   394  
   387  
   498    Destructor
   491    Destructor
   499  */
   492  */
   500 	{
   493 	{
   501 
   494 
   502 	}
   495 	}
       
   496