contentstorage/casrv/caappscanner/tsrc/t_caappscanner/inc/casrvtestutils.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 //utility class for tests
       
    18 //all utility methods should be implemented here
       
    19 
       
    20 #include <usif/usifcommon.h>
       
    21 
       
    22 #include "casrvengutils.h"
       
    23 #include "casrvplugin.h"
       
    24 
       
    25 class CCaStorageProxy;
       
    26 class CCaInnerEntry;
       
    27 
       
    28 class CTestUtils: public CBase
       
    29 {
       
    30 public:
       
    31 
       
    32     /**/
       
    33     virtual ~CTestUtils();
       
    34 
       
    35     /**/
       
    36     static CTestUtils* NewL();
       
    37 
       
    38     /**/
       
    39     static CTestUtils* NewLC();
       
    40 
       
    41     /**/
       
    42     TUint FindAppUidL( const TDesC& aName, CCaStorageProxy* aStorage );
       
    43 
       
    44     /**/
       
    45     TInt LaunchApplicationL( const TUid aUid );
       
    46 
       
    47     /**/
       
    48     TInt SimpleCloseTaskL(TInt aUid);
       
    49 
       
    50     /**/
       
    51     void WaitL(TInt aMicroSec);
       
    52 
       
    53     /**/
       
    54     void InstallFinishedL();
       
    55 
       
    56     /**
       
    57      * Gets RProperty
       
    58      */
       
    59     TInt GetRProperty( TUid aCategory, TUint aKey, TDes& aValue );
       
    60 
       
    61     /**
       
    62      * Gets RProperty
       
    63      */
       
    64     TInt GetRProperty( TUid aCategory, TUint aKey, TInt& aValue );
       
    65 
       
    66     /**
       
    67      * Sets RProperty
       
    68      */
       
    69     TInt SetRProperty( TUid aCategory, TUint aKey, const TDesC& aValue );
       
    70 
       
    71     /**
       
    72      * Sets RProperty
       
    73      */
       
    74     TInt SetRProperty( TUid aCategory, TUint aKey, TInt aValue );
       
    75 
       
    76     /**
       
    77      * Copys test Db
       
    78      */
       
    79     TInt CopyDb();
       
    80 
       
    81     /**
       
    82      * Checks if app exists in Db
       
    83      */
       
    84     TBool AppExistsInStorageL( TInt aComponentId, CCaStorageProxy* aStorage);
       
    85     
       
    86     TBool ComponentExistsInStorageL( Usif::TComponentId aComponentId, 
       
    87         CCaStorageProxy* aStorage);
       
    88     
       
    89     CCaInnerEntry* GetAppEntryL( TInt aUid, CCaStorageProxy* aStorage);
       
    90 
       
    91     TInt AppsWithFlagsOffL( TInt aFlags, CCaStorageProxy* aStorage);
       
    92 
       
    93     TInt GetAppFlagsL( TInt aUid, CCaStorageProxy* aStorage);
       
    94 
       
    95     void RemoveAppL( TInt aUid, CCaStorageProxy* aStorage);
       
    96     void CopyMmcHistory();
       
    97     
       
    98     CCaSrvPlugin* LoadPluginL( TUid aImplUid, TPluginParams aPluginParams );
       
    99 
       
   100 private:
       
   101 
       
   102     /**
       
   103      * Copys files
       
   104      */
       
   105     TInt Copy( const TDesC& aSource, const TDesC& aDest );
       
   106 
       
   107     CTestUtils();
       
   108 
       
   109     void ConstructL();
       
   110 
       
   111     RFs iFs;
       
   112     CFileMan* iFileManager;
       
   113 
       
   114     /**
       
   115      * Local Active Sheduler.
       
   116      * Own.
       
   117      */
       
   118     CActiveSchedulerWait* iActiveWait;
       
   119 };