os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestAudioPlayerDRM.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestAudioPlayerDRM.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,120 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file contains integration tests of the MMF Audio Client.
    1.18 +// The enabling of agent's user interface and disabling automatic intent 
    1.19 +// features are tested.
    1.20 +// CMdaAudioPlayerUtility
    1.21 +// 
    1.22 +//
    1.23 +
    1.24 +#ifndef TEST_AUDIOPLAYERDRM_H
    1.25 +#define TEST_AUDIOPLAYERDRM_H
    1.26 +
    1.27 +#include "TSI_MMFACLNT.h"
    1.28 +
    1.29 +// Audio events
    1.30 +enum TMmfAudioEvents
    1.31 +    {
    1.32 +    EAudioOpen = 0,
    1.33 +    EAudioPlay,
    1.34 +    EAudioPlayEnd,
    1.35 +    };
    1.36 +
    1.37 +/**
    1.38 +*
    1.39 +* Base class
    1.40 +*
    1.41 +* @lib "TSI_MMFACLNT.lib"
    1.42 +*
    1.43 +* @class CTestMmfDRMAudioPlayerBase
    1.44 +*
    1.45 +*/
    1.46 +class CTestMmfDRMAudioPlayerBase : public CTestMmfAclntStep,
    1.47 +                                   public MMdaAudioPlayerCallback
    1.48 +    {
    1.49 +public:
    1.50 +    void FsmL(TMmfAudioEvents aEvent, TInt aError = KErrNone);
    1.51 +
    1.52 +    // from CTestMmfAclntStep
    1.53 +	virtual TVerdict DoTestStepPreambleL();
    1.54 +	virtual TVerdict DoTestStepPostambleL();
    1.55 +
    1.56 +    // from MMdaAudioPlayerCallback
    1.57 +    virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    1.58 +    virtual void MapcPlayComplete(TInt aError);
    1.59 +
    1.60 +public:
    1.61 +    TInt iError;
    1.62 +    TFileName iFileName;
    1.63 +    CMdaAudioPlayerUtility* iAudioPlayer;
    1.64 +protected:
    1.65 +	virtual void AfterOpenL();
    1.66 +	CTestMmfDRMAudioPlayerBase(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    1.67 +	
    1.68 +	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
    1.69 +	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
    1.70 +	TBuf<KIDBufSize> iUniqueId;					// Unique ID for DRM protected content
    1.71 +    };
    1.72 +
    1.73 +// Positive Tests
    1.74 +
    1.75 +/**
    1.76 +*
    1.77 +* Enable agent's user interface for errors and confirmation requests property. 
    1.78 +* Open and play a protected audio clip from a file for PLAY intent.
    1.79 +*
    1.80 +* @lib "TSI_MMFACLNT.lib"
    1.81 +*
    1.82 +* @class CTestMmfAudioPlayDRMEnableAgentUI
    1.83 +*
    1.84 +*/
    1.85 +class CTestMmfAudioPlayDRMEnableAgentUI : public CTestMmfDRMAudioPlayerBase
    1.86 +    {
    1.87 +public:
    1.88 +    static CTestMmfAudioPlayDRMEnableAgentUI* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    1.89 +
    1.90 +    // from RTestStep
    1.91 +    virtual TVerdict DoTestStepL();
    1.92 +protected:
    1.93 +	void AfterOpenL();
    1.94 +
    1.95 +private:
    1.96 +    CTestMmfAudioPlayDRMEnableAgentUI(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
    1.97 +    };
    1.98 +
    1.99 +
   1.100 +/**
   1.101 +*
   1.102 +* Open a protected audio file and disable automatic intent. Play.
   1.103 +*
   1.104 +* @lib "TSI_MMFACLNT.lib"
   1.105 +*
   1.106 +* @class CTestMmfAudioPlayDRMDisableAutoIntent
   1.107 +*
   1.108 +*/
   1.109 +class CTestMmfAudioPlayDRMDisableAutoIntent : public CTestMmfDRMAudioPlayerBase
   1.110 +    {
   1.111 +public:
   1.112 +    static CTestMmfAudioPlayDRMDisableAutoIntent* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
   1.113 +
   1.114 +    // from RTestStep
   1.115 +    virtual TVerdict DoTestStepL();
   1.116 +
   1.117 +protected:
   1.118 +	void AfterOpenL();
   1.119 +private:
   1.120 +    CTestMmfAudioPlayDRMDisableAutoIntent(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, const TDesC& aUniqueId);
   1.121 +    };
   1.122 +
   1.123 +#endif //TEST_AUDIOPLAYERDRM_H