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