uifw/AvKon/tsrc/bc/bctestutil/src/bctestendcase.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Test utility, the interface of test framework.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <sysutil.h>
       
    20 #include "bctestendcase.h"
       
    21 
       
    22 #include <e32property.h>
       
    23 const TUid KPSUidAvkonDomainForBC = { 0x10207218 }; // Same as KPSUidAvkonDomain
       
    24 const TUint32 KAknMenuOptionNoTaskSwapper = 0x10000002;
       
    25 enum TAknMenuOptionNoTaskSwapper
       
    26     {
       
    27     ETaskSwapper,
       
    28     ENoTaskSwapper
       
    29     };
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // C++ default Constructor
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CBCTestEndCase::CBCTestEndCase()
       
    37     {    
       
    38     }
       
    39     
       
    40 // ---------------------------------------------------------------------------
       
    41 // Destructor
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 CBCTestEndCase::~CBCTestEndCase()
       
    45     {    
       
    46     }
       
    47     
       
    48 // ---------------------------------------------------------------------------
       
    49 // Symbian 2nd constructor
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 CBCTestEndCase* CBCTestEndCase::NewL()
       
    53     {
       
    54     CBCTestEndCase* self = new( ELeave ) CBCTestEndCase();
       
    55     CleanupStack::PushL( self );
       
    56     self->ConstructL();
       
    57     CleanupStack::Pop( self );
       
    58     return self;
       
    59     }
       
    60     
       
    61 // ---------------------------------------------------------------------------
       
    62 // Symbian 2nd constructor
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 void CBCTestEndCase::ConstructL()
       
    66     {
       
    67     BuildScriptL();
       
    68     }
       
    69 
       
    70 static TInt SDKVersion()
       
    71 	{	
       
    72 	TInt swver = 30;
       
    73     TInt taskSwapper( ENoTaskSwapper ) ;// taskSwapper
       
    74     TInt result = RProperty::Get( KPSUidAvkonDomainForBC, 
       
    75             KAknMenuOptionNoTaskSwapper, taskSwapper );
       
    76     TInt ret = RProperty::Define( KPSUidAvkonDomainForBC,
       
    77             KAknMenuOptionNoTaskSwapper, RProperty::EInt );
       
    78     
       
    79     if (ret == KErrAlreadyExists)
       
    80         {
       
    81         if ( result == KErrNotFound )
       
    82             {
       
    83             swver = 30;
       
    84             }
       
    85         else
       
    86             {
       
    87             if ( taskSwapper == 0 )
       
    88                 {
       
    89                 swver = 50;
       
    90                 }
       
    91             else
       
    92                 {
       
    93                 swver = 30;
       
    94                 }
       
    95             }
       
    96         }
       
    97     else
       
    98         {
       
    99         RProperty::Set( KPSUidAvkonDomainForBC,
       
   100                 KAknMenuOptionNoTaskSwapper, ENoTaskSwapper );
       
   101         }
       
   102     return swver;	//default version	
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------------------------
       
   106 // CBCTestEndCase::BuildScriptL
       
   107 // ---------------------------------------------------------------------------
       
   108 //
       
   109 void CBCTestEndCase::BuildScriptL()
       
   110     {
       
   111     TInt sdkver = SDKVersion();
       
   112     if ( sdkver == 32 || sdkver == 50 )
       
   113         {
       
   114         AddTestL( LeftCBA, Up, Up, LeftCBA, TEND );
       
   115         }
       
   116     else
       
   117         {
       
   118         AddTestL( LeftCBA, Up, LeftCBA, TEND );
       
   119         }
       
   120     }