os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestAudioPlayerDRM.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This file contains integration tests of the MMF Audio Client.
    15 // The enabling of agent's user interface and disabling automatic intent 
    16 // features are tested.
    17 // CMdaAudioPlayerUtility
    18 // 
    19 //
    20 
    21 #ifndef TEST_AUDIOPLAYERDRM_H
    22 #define TEST_AUDIOPLAYERDRM_H
    23 
    24 #include "TSI_MMFACLNT.h"
    25 
    26 // Audio events
    27 enum TMmfAudioEvents
    28     {
    29     EAudioOpen = 0,
    30     EAudioPlay,
    31     EAudioPlayEnd,
    32     };
    33 
    34 /**
    35 *
    36 * Base class
    37 *
    38 * @lib "TSI_MMFACLNT.lib"
    39 *
    40 * @class CTestMmfDRMAudioPlayerBase
    41 *
    42 */
    43 class CTestMmfDRMAudioPlayerBase : public CTestMmfAclntStep,
    44                                    public MMdaAudioPlayerCallback
    45     {
    46 public:
    47     void FsmL(TMmfAudioEvents aEvent, TInt aError = KErrNone);
    48 
    49     // from CTestMmfAclntStep
    50 	virtual TVerdict DoTestStepPreambleL();
    51 	virtual TVerdict DoTestStepPostambleL();
    52 
    53     // from MMdaAudioPlayerCallback
    54     virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    55     virtual void MapcPlayComplete(TInt aError);
    56 
    57 public:
    58     TInt iError;
    59     TFileName iFileName;
    60     CMdaAudioPlayerUtility* iAudioPlayer;
    61 protected:
    62 	virtual void AfterOpenL();
    63 	CTestMmfDRMAudioPlayerBase(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    64 	
    65 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
    66 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
    67 	TBuf<KIDBufSize> iUniqueId;					// Unique ID for DRM protected content
    68     };
    69 
    70 // Positive Tests
    71 
    72 /**
    73 *
    74 * Enable agent's user interface for errors and confirmation requests property. 
    75 * Open and play a protected audio clip from a file for PLAY intent.
    76 *
    77 * @lib "TSI_MMFACLNT.lib"
    78 *
    79 * @class CTestMmfAudioPlayDRMEnableAgentUI
    80 *
    81 */
    82 class CTestMmfAudioPlayDRMEnableAgentUI : public CTestMmfDRMAudioPlayerBase
    83     {
    84 public:
    85     static CTestMmfAudioPlayDRMEnableAgentUI* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    86 
    87     // from RTestStep
    88     virtual TVerdict DoTestStepL();
    89 protected:
    90 	void AfterOpenL();
    91 
    92 private:
    93     CTestMmfAudioPlayDRMEnableAgentUI(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    94     };
    95 
    96 
    97 /**
    98 *
    99 * Open a protected audio file and disable automatic intent. Play.
   100 *
   101 * @lib "TSI_MMFACLNT.lib"
   102 *
   103 * @class CTestMmfAudioPlayDRMDisableAutoIntent
   104 *
   105 */
   106 class CTestMmfAudioPlayDRMDisableAutoIntent : public CTestMmfDRMAudioPlayerBase
   107     {
   108 public:
   109     static CTestMmfAudioPlayDRMDisableAutoIntent* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
   110 
   111     // from RTestStep
   112     virtual TVerdict DoTestStepL();
   113 
   114 protected:
   115 	void AfterOpenL();
   116 private:
   117     CTestMmfAudioPlayDRMDisableAutoIntent(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
   118     };
   119 
   120 #endif //TEST_AUDIOPLAYERDRM_H