uiaccelerator_plat/alf_extension_api/tsrc/src/testalfextblocksftokenclient.cpp
branchRCL_3
changeset 22 7c5dd702d6d3
equal deleted inserted replaced
17:3ac8bf5c5014 22:7c5dd702d6d3
       
     1 /*
       
     2 * Copyright (c) 2002 - 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 ftokenclient.h
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // [INCLUDE FILES]
       
    20 #include "testalfext.h"
       
    21 
       
    22 // CONSTANTS
       
    23 const TInt KBufSize = 64;
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS =========================
       
    26 
       
    27 // --------------------------------------------------------------------------
       
    28 // CTestAlfExt::TestRFTokenClientFuncL
       
    29 // --------------------------------------------------------------------------
       
    30 //
       
    31 TInt CTestAlfExt::TestRFTokenClientFuncL( CStifItemParser& /*aItem*/ )
       
    32     {
       
    33     _LIT(Kctestalfext, "CTestAlfExt");
       
    34     _LIT(Ktestrftokenclientconnect, "In TestRFTokenClientConnect");
       
    35     TestModuleIf().Printf(0, Kctestalfext, Ktestrftokenclientconnect);
       
    36     iLog->Log(Ktestrftokenclientconnect);
       
    37 
       
    38     RFTokenClient rtoken;
       
    39     CleanupClosePushL( rtoken );
       
    40     User::LeaveIfError( rtoken.Connect() );
       
    41     _LIT( KFileName, "c:\\testframework\\ui_testalfextalfbrushhandlers.cfg" );
       
    42     TBuf<KBufSize> fileName( KFileName );
       
    43     TInt64 token = 0;
       
    44     TPckg<TInt64> tokenbuf(token); 
       
    45     token = 1;
       
    46     TPckg<TInt64> tokenbufexist(token);
       
    47     TSecureId consumerSecId(0x10282845);
       
    48     TSecurityPolicy policy( consumerSecId );
       
    49     TUid id = { 0x00000001 };
       
    50     
       
    51     rtoken.GenerateToken( fileName, policy, tokenbuf );
       
    52     rtoken.GenerateToken( tokenbufexist, policy, tokenbuf );
       
    53     rtoken.GenerateToken( fileName, id, tokenbuf );
       
    54     rtoken.GenerateToken( tokenbufexist, id, tokenbuf );
       
    55     RFile rfile;
       
    56     TInt err = rfile.Open( CEikonEnv::Static()->FsSession(), fileName, EFileRead );
       
    57     if ( err != KErrNone )
       
    58         {
       
    59         return KErrNone;
       
    60         }
       
    61     rtoken.GenerateToken( rfile, id, tokenbuf );
       
    62     rtoken.GenerateToken( rfile, policy, tokenbuf );
       
    63     rtoken.OpenFileForToken( rfile, tokenbuf );
       
    64     rfile.Close();
       
    65     CleanupStack::PopAndDestroy( &rtoken );
       
    66 
       
    67     return KErrNone;
       
    68     }
       
    69 
       
    70 
       
    71 // End of file
       
    72 
       
    73 
       
    74