profilesservices/ProfileEngine/tsrc/public/basic/WrapperMdlTest/inc/MT_MProEngAlertToneSeeker.h
changeset 0 8c5d936e5675
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     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: Module tests for Profiles alert tone seeker.
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 ////////////////////////////////////////////////////////////////////////
       
    18 // MT_MProEngAlertToneSeeker.h
       
    19 //
       
    20 
       
    21 #ifndef MT_MPROENGALERTTONESEEKER_H
       
    22 #define MT_MPROENGALERTTONESEEKER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32std.h>
       
    26 #include "bamdesca.h"
       
    27 #include "MT_CSchedulerUtility.h"
       
    28 #include <CEUnitTestSuiteClass.h>
       
    29 #include <MProEngAlertToneSeekerObserver.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MProEngAlertToneSeeker;
       
    33 class MT_CProEngAlertToneSeekerObserver;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * Module tests for Profiles alert tone seeker.
       
    39 *
       
    40 */
       
    41 class MT_MProEngAlertToneSeeker
       
    42      : public CEUnitTestSuiteClass
       
    43     {
       
    44     public:
       
    45 
       
    46         /**
       
    47          * Two phase construction
       
    48          */
       
    49         static MT_MProEngAlertToneSeeker* NewL();
       
    50         static MT_MProEngAlertToneSeeker* NewLC();
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         virtual ~MT_MProEngAlertToneSeeker();
       
    56 
       
    57     private:    // Constructors and destructors
       
    58 
       
    59         MT_MProEngAlertToneSeeker();
       
    60         void ConstructL();
       
    61 
       
    62     private: // Setup functions
       
    63 
       
    64         void SetupL();
       
    65         void SetupCancelFetchTestL();
       
    66 
       
    67     private: // Teardown functions
       
    68 
       
    69         void Teardown();
       
    70 
       
    71     private: // Test functions
       
    72 
       
    73         void FetchAlertToneListTestL();
       
    74         void CancelFetchTestL();
       
    75 
       
    76     private:    // Implementation
       
    77 
       
    78 		EUNIT_DECLARE_TEST_TABLE; 
       
    79 		
       
    80     private:    // Data
       
    81 
       
    82         MProEngAlertToneSeeker* iSeeker;
       
    83         MT_CProEngAlertToneSeekerObserver* iObserver;
       
    84 
       
    85     };
       
    86 
       
    87 // Helper classes to test notifications:
       
    88 //
       
    89 
       
    90 class MT_CProEngAlertToneSeekerObserver: public CBase,
       
    91         public MProEngAlertToneSeekerObserver
       
    92     {
       
    93     public:
       
    94         static MT_CProEngAlertToneSeekerObserver* NewL()
       
    95             {return new (ELeave) MT_CProEngAlertToneSeekerObserver;}
       
    96         ~MT_CProEngAlertToneSeekerObserver() { delete iToneList; }
       
    97         virtual void HandleAlertToneListCompletedL( MDesCArray* aToneList )
       
    98             { iToneList = aToneList; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
       
    99 
       
   100         virtual void HandleError( TInt aError )
       
   101             { iError = aError; iNotified = ETrue; MT_CSchedulerUtility::InstanceL()->Stop();}
       
   102 
       
   103         MDesCArray* iToneList;
       
   104         TInt iNotified;
       
   105         TInt iError;
       
   106     };
       
   107 
       
   108 #endif      // MT_MPROENGALERTTONESEEKER_H
       
   109 
       
   110 // End of File
       
   111