web_pub/download_mgr_client_api/tsrc/src/CDownloadMgrUiLibRegistryTestCases.cpp
changeset 1 7c90e6132015
equal deleted inserted replaced
0:dd21522fd290 1:7c90e6132015
       
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <e32math.h>
       
    23 #include "DownloadMgrBCTest.h"
       
    24 
       
    25 // EXTERNAL DATA STRUCTURES
       
    26 // None
       
    27 
       
    28 // EXTERNAL FUNCTION PROTOTYPES  
       
    29 // None
       
    30 
       
    31 // CONSTANTS
       
    32 // None
       
    33 
       
    34 // MACROS
       
    35 // None
       
    36 
       
    37 // LOCAL CONSTANTS AND MACROS
       
    38 // None
       
    39 
       
    40 // MODULE DATA STRUCTURES
       
    41 // None
       
    42 
       
    43 // LOCAL FUNCTION PROTOTYPES
       
    44 // None
       
    45 
       
    46 // FORWARD DECLARATIONS
       
    47 // None
       
    48 
       
    49 // ==================== LOCAL FUNCTIONS =======================================
       
    50 
       
    51 // ============================ MEMBER FUNCTIONS ===============================
       
    52 
       
    53 /*
       
    54 -------------------------------------------------------------------------------
       
    55 
       
    56     Class: CDownloadMgrClientApiTest
       
    57 
       
    58     Method: RegistryNewLTest
       
    59 
       
    60     Description: Test the CDownloadMgrUiLibRegistry NewL method.
       
    61   
       
    62     Parameters:  TTestResult& aErrorDescription: out:   
       
    63                     Test result and on error case a short description of error
       
    64 
       
    65     Return Values: TInt: Always KErrNone to indicate that test was valid
       
    66 
       
    67     Errors/Exceptions: None
       
    68 
       
    69     Status: Proposal
       
    70 
       
    71 -------------------------------------------------------------------------------
       
    72 */
       
    73 TInt CDownloadMgrClientApiTest::RegistryNewLTest( TTestResult& aResult )
       
    74     {
       
    75     /* Simple server connect */
       
    76     _LIT( KDefinition ,"State");
       
    77     _LIT( KData ,"Test the CDownloadMgrUiRegistry NewL method");
       
    78     TestModuleIf().Printf( 0, KDefinition, KData );
       
    79     
       
    80     CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
       
    81     CleanupStack::PushL( scheduler );
       
    82     CActiveScheduler::Install( scheduler );
       
    83 
       
    84     CDownloadMgrUiLibRegistry* registry = CDownloadMgrUiLibRegistry::NewL( iDownloadManager );
       
    85     
       
    86     _LIT( KData2 ,"Finished");
       
    87     TestModuleIf().Printf( 0, KDefinition, KData2 );
       
    88     
       
    89     if( registry )
       
    90 	    {
       
    91 	    _LIT( KDescription , "Test case passed" );
       
    92 	    aResult.SetResult( KErrNone, KDescription );
       
    93 	    
       
    94 	    delete registry;
       
    95 	    }
       
    96     else
       
    97 	    {
       
    98 	    _LIT( KDescription , "Test case failed" );
       
    99 	    aResult.SetResult( KErrGeneral, KDescription );
       
   100 	    }
       
   101 
       
   102     CleanupStack::PopAndDestroy(); // scheduler
       
   103 
       
   104     // Case was executed
       
   105     return KErrNone;
       
   106     }
       
   107 
       
   108 /*
       
   109 -------------------------------------------------------------------------------
       
   110 
       
   111     Class: CDownloadMgrClientApiTest
       
   112 
       
   113     Method: RegistryRegisterUserInteractionsLTest
       
   114 
       
   115     Description: Test the CDownloadMgrUiLibRegistry RegisterUserInteractionsL method.
       
   116   
       
   117     Parameters:  TTestResult& aErrorDescription: out:   
       
   118                     Test result and on error case a short description of error
       
   119 
       
   120     Return Values: TInt: Always KErrNone to indicate that test was valid
       
   121 
       
   122     Errors/Exceptions: None
       
   123 
       
   124     Status: Proposal
       
   125 
       
   126 -------------------------------------------------------------------------------
       
   127 */
       
   128 TInt CDownloadMgrClientApiTest::RegistryRegisterUserInteractionsLTest( TTestResult& aResult )
       
   129     {
       
   130     /* Simple server connect */
       
   131     _LIT( KDefinition ,"State");
       
   132     _LIT( KData ,"Test the CDownloadMgrUiRegistry RegisterUserInteractionsL method");
       
   133     TestModuleIf().Printf( 0, KDefinition, KData );
       
   134     
       
   135     _LIT( KData2 ,"Finished");
       
   136     TestModuleIf().Printf( 0, KDefinition, KData2 );
       
   137     
       
   138     _LIT( KDescription , "Test case failed" );
       
   139     aResult.SetResult( KErrGeneral, KDescription );
       
   140 
       
   141     // Case was executed
       
   142     return KErrNone;
       
   143     }
       
   144 
       
   145 /*
       
   146 -------------------------------------------------------------------------------
       
   147 
       
   148     Class: CDownloadMgrClientApiTest
       
   149 
       
   150     Method: RegistryRegisterDownloadsListLTest
       
   151 
       
   152     Description: Test the CDownloadMgrUiLibRegistry RegisterDownloadsListL method.
       
   153   
       
   154     Parameters:  TTestResult& aErrorDescription: out:   
       
   155                     Test result and on error case a short description of error
       
   156 
       
   157     Return Values: TInt: Always KErrNone to indicate that test was valid
       
   158 
       
   159     Errors/Exceptions: None
       
   160 
       
   161     Status: Proposal
       
   162 
       
   163 -------------------------------------------------------------------------------
       
   164 */
       
   165 TInt CDownloadMgrClientApiTest::RegistryRegisterDownloadsListLTest( TTestResult& aResult )
       
   166     {
       
   167     /* Simple server connect */
       
   168     _LIT( KDefinition ,"State");
       
   169     _LIT( KData ,"Test the CDownloadMgrUiRegistry RegisterDownloadsListL method");
       
   170     TestModuleIf().Printf( 0, KDefinition, KData );
       
   171     
       
   172     _LIT( KData2 ,"Finished");
       
   173     TestModuleIf().Printf( 0, KDefinition, KData2 );
       
   174     
       
   175     _LIT( KDescription , "Test case failed" );
       
   176     aResult.SetResult( KErrGeneral, KDescription );
       
   177 
       
   178     // Case was executed
       
   179     return KErrNone;
       
   180     }
       
   181 
       
   182 // ================= OTHER EXPORTED FUNCTIONS =================================
       
   183 
       
   184 // End of File