sl@0
|
1 |
// Copyright (c) 2007-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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "teststepciunderflowautostopcontrol.h"
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStepL()
|
sl@0
|
20 |
{
|
sl@0
|
21 |
iTestStepResult = ETestSuiteError;
|
sl@0
|
22 |
|
sl@0
|
23 |
INFO_PRINTF1(_L("Initializing test CI device"));
|
sl@0
|
24 |
|
sl@0
|
25 |
if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0091-HP")) == 0)
|
sl@0
|
26 |
{
|
sl@0
|
27 |
iTestStepResult = DoTestStep0091L();
|
sl@0
|
28 |
}
|
sl@0
|
29 |
else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0092-HP")) == 0)
|
sl@0
|
30 |
{
|
sl@0
|
31 |
iTestStepResult = DoTestStep0092L();
|
sl@0
|
32 |
}
|
sl@0
|
33 |
|
sl@0
|
34 |
return iTestStepResult;
|
sl@0
|
35 |
}
|
sl@0
|
36 |
|
sl@0
|
37 |
|
sl@0
|
38 |
TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0091L()
|
sl@0
|
39 |
{
|
sl@0
|
40 |
iTestStepResult = EFail;
|
sl@0
|
41 |
|
sl@0
|
42 |
INFO_PRINTF1(_L("UnderflowAutoStopControl - Instantiating"));
|
sl@0
|
43 |
|
sl@0
|
44 |
//Initialize - with the UID of our test HwDevice
|
sl@0
|
45 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
sl@0
|
46 |
TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
|
sl@0
|
47 |
#else
|
sl@0
|
48 |
TFourCC testUID('T','0','2','1');
|
sl@0
|
49 |
#endif
|
sl@0
|
50 |
|
sl@0
|
51 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
sl@0
|
52 |
|
sl@0
|
53 |
if (iTestStepResult != EPass)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
|
sl@0
|
56 |
return EInconclusive;
|
sl@0
|
57 |
}
|
sl@0
|
58 |
|
sl@0
|
59 |
// reset the value as previous test is pass
|
sl@0
|
60 |
iTestStepResult = EFail;
|
sl@0
|
61 |
|
sl@0
|
62 |
// KUidunderflowAutoStopControl
|
sl@0
|
63 |
MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
|
sl@0
|
64 |
|
sl@0
|
65 |
if (ptr)
|
sl@0
|
66 |
{
|
sl@0
|
67 |
INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl instantiated successfully"));
|
sl@0
|
68 |
|
sl@0
|
69 |
iTestStepResult = EPass;
|
sl@0
|
70 |
}
|
sl@0
|
71 |
else
|
sl@0
|
72 |
{
|
sl@0
|
73 |
ERR_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
|
sl@0
|
74 |
}
|
sl@0
|
75 |
|
sl@0
|
76 |
return iTestStepResult;
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
|
sl@0
|
80 |
TVerdict CTestStepCIUnderflowAutoStopControl::DoTestStep0092L()
|
sl@0
|
81 |
{
|
sl@0
|
82 |
iTestStepResult = EFail;
|
sl@0
|
83 |
TInt result = KErrGeneral;
|
sl@0
|
84 |
|
sl@0
|
85 |
INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl - SetConversionFormat"));
|
sl@0
|
86 |
|
sl@0
|
87 |
//Initialize - with the UID of our test HwDevice
|
sl@0
|
88 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
sl@0
|
89 |
TUid testUID = {KUidUnderflowAutoStopControlTestDevice};
|
sl@0
|
90 |
#else
|
sl@0
|
91 |
TFourCC testUID('T','0','2','1');
|
sl@0
|
92 |
#endif
|
sl@0
|
93 |
|
sl@0
|
94 |
iTestStepResult = TestInitialize(testUID, EMMFStatePlaying);
|
sl@0
|
95 |
|
sl@0
|
96 |
if (iTestStepResult != EPass)
|
sl@0
|
97 |
{
|
sl@0
|
98 |
INFO_PRINTF1(_L("DevSound failed to instantiate the test device"));
|
sl@0
|
99 |
return EInconclusive;
|
sl@0
|
100 |
}
|
sl@0
|
101 |
|
sl@0
|
102 |
// reset the value as previous test is pass
|
sl@0
|
103 |
iTestStepResult = EFail;
|
sl@0
|
104 |
|
sl@0
|
105 |
// KUidUnderflowAutoStopControl
|
sl@0
|
106 |
MMMFUnderflowAutoStopControl* ptr = static_cast <MMMFUnderflowAutoStopControl*> (iMMFDevSound->CustomInterface(KUidUnderflowAutoStopControl));
|
sl@0
|
107 |
|
sl@0
|
108 |
if (ptr)
|
sl@0
|
109 |
{
|
sl@0
|
110 |
result = ptr->MmuascTurnOffUnderflowAutoStop(); // call method
|
sl@0
|
111 |
|
sl@0
|
112 |
if (result == KErrNone)
|
sl@0
|
113 |
{
|
sl@0
|
114 |
INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop finished successfully"));
|
sl@0
|
115 |
|
sl@0
|
116 |
iTestStepResult = EPass;
|
sl@0
|
117 |
}
|
sl@0
|
118 |
else
|
sl@0
|
119 |
{
|
sl@0
|
120 |
ERR_PRINTF2(_L("MMMFUnderflowAutoStopControl::MmuascTurnOffUnderflowAutoStop failed with error %d"), result);
|
sl@0
|
121 |
}
|
sl@0
|
122 |
}
|
sl@0
|
123 |
else
|
sl@0
|
124 |
{
|
sl@0
|
125 |
INFO_PRINTF1(_L("MMMFUnderflowAutoStopControl failed to retrieve the interface"));
|
sl@0
|
126 |
iTestStepResult = EInconclusive;
|
sl@0
|
127 |
}
|
sl@0
|
128 |
|
sl@0
|
129 |
return iTestStepResult;
|
sl@0
|
130 |
}
|