24
|
1 |
// Copyright (c) 2008-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 |
// EtelPacketMbmsSupport.cpp
|
|
15 |
// This contains EtelPacket TestCase
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
// Symbian OS includes
|
|
20 |
#include <e32base.h>
|
|
21 |
|
|
22 |
#include <etelpckt.h>
|
|
23 |
#include <pcktlist.h>
|
|
24 |
#include <pcktcs.h>
|
|
25 |
#include "Te_EtelPacketTestStepBase.h"
|
|
26 |
#include "testdef.h"
|
|
27 |
#include "Te_EtelPacketMbmsSupport.h"
|
|
28 |
#include "Te_etelpckt_defs.h"
|
|
29 |
|
|
30 |
// constructor
|
|
31 |
CTestMbmsSupport::CTestMbmsSupport()
|
|
32 |
{
|
|
33 |
// store the name of this test case
|
|
34 |
SetTestStepName(_L("MBMS_SUPPORT"));
|
|
35 |
}
|
|
36 |
|
|
37 |
// destructor
|
|
38 |
CTestMbmsSupport::~CTestMbmsSupport()
|
|
39 |
{
|
|
40 |
}
|
|
41 |
|
|
42 |
enum TVerdict CTestMbmsSupport::doTestStepL( void )
|
|
43 |
/**
|
|
44 |
* Test step to check the MBMS Support and Availability in a cell
|
|
45 |
*/
|
|
46 |
{
|
|
47 |
RPhone phone;
|
|
48 |
TInt ret=phone.Open(iTelServer,DPCKTTSY_PHONE_NAME);
|
|
49 |
|
|
50 |
RPacketService pcktService;
|
|
51 |
ret=pcktService.Open(phone);
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Verify the extension identification of MBMS functionality
|
|
55 |
*/
|
|
56 |
RPacketService::TMbmsServiceAvailabilityV1 aMbmsSAV1;
|
|
57 |
TESTL(aMbmsSAV1.ExtensionId() == KETelExtPcktV1);
|
|
58 |
INFO_PRINTF1(_L("MBMS Extension Identifier correct"));
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Verify whether the phone supports MBMS
|
|
62 |
*/
|
|
63 |
TUint aCaps;
|
|
64 |
TInt mbmsStaticCap = pcktService.GetStaticCaps(aCaps, RPacketContext::EPdpTypeIPv4);
|
|
65 |
TESTL(mbmsStaticCap == KErrNone);
|
|
66 |
TESTL(aCaps == DPCKTTSY_MISC_CAPS);
|
|
67 |
INFO_PRINTF1(_L("Test for MBMS support in the device - Completed"));
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Check whether MBMS is being used by the device. [Dynamic capability]
|
|
71 |
*/
|
|
72 |
TRequestStatus reqStatusNotifyDynCaps;
|
|
73 |
RPacketService::TDynamicCapsFlags dynamicCapsFlags;
|
|
74 |
pcktService.NotifyDynamicCapsChange(reqStatusNotifyDynCaps, dynamicCapsFlags);
|
|
75 |
User::WaitForRequest(reqStatusNotifyDynCaps);
|
|
76 |
TESTL(reqStatusNotifyDynCaps == KErrNone);
|
|
77 |
TESTL(dynamicCapsFlags == DPCKTTSY_DYNAMIC_CAPS2);
|
|
78 |
INFO_PRINTF1(_L("Notify Dynamic Caps - Completed"));
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Cancel Notify dynamic caps API
|
|
82 |
*/
|
|
83 |
TRequestStatus reqStatusNotifyDynCapsCancel;
|
|
84 |
pcktService.NotifyDynamicCapsChange(reqStatusNotifyDynCapsCancel, dynamicCapsFlags);
|
|
85 |
pcktService.CancelAsyncRequest(EPacketNotifyDynamicCapsChange);
|
|
86 |
User::WaitForRequest(reqStatusNotifyDynCapsCancel);
|
|
87 |
TESTL(reqStatusNotifyDynCapsCancel == KErrCancel);
|
|
88 |
INFO_PRINTF1(_L("Cancel Notify Dynamic Caps - Completed"));
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Get dynamic caps of MBMS
|
|
92 |
*/
|
|
93 |
TRequestStatus reqStatusGetDynCaps;
|
|
94 |
TInt retDynCaps = pcktService.GetDynamicCaps(dynamicCapsFlags);
|
|
95 |
TESTL(retDynCaps == KErrNone);
|
|
96 |
TESTL(dynamicCapsFlags == DPCKTTSY_DYNAMIC_CAPS1);
|
|
97 |
INFO_PRINTF1(_L("Get Dynamic Caps - Completed"));
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Receive notification about status change on MBMS support in the current network.
|
|
101 |
*/
|
|
102 |
TRequestStatus aGetNtwkServiceStatus;
|
|
103 |
TMbmsNetworkServiceStatus aMbmsNtwkServiceStatus;
|
|
104 |
pcktService.NotifyMbmsNetworkServiceStatusChange(aGetNtwkServiceStatus, aMbmsNtwkServiceStatus);
|
|
105 |
|
|
106 |
User::WaitForRequest(aGetNtwkServiceStatus);
|
|
107 |
TESTL(aMbmsNtwkServiceStatus == DPCKTTSY_MBMS_NETWORKSERVICE_SUPPORTED);
|
|
108 |
TESTL(aGetNtwkServiceStatus == KErrNone);
|
|
109 |
INFO_PRINTF1(_L("Test for notification on MBMS support in the device - Completed"));
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Cancel the notification posted to know about status change on MBMS support in the current network.
|
|
113 |
*/
|
|
114 |
pcktService.NotifyMbmsNetworkServiceStatusChange(aGetNtwkServiceStatus, aMbmsNtwkServiceStatus);
|
|
115 |
pcktService.CancelAsyncRequest(EPacketNotifyMbmsNetworkServiceStatusChange);
|
|
116 |
User::WaitForRequest(aGetNtwkServiceStatus);
|
|
117 |
|
|
118 |
TESTL(aGetNtwkServiceStatus == KErrCancel);
|
|
119 |
INFO_PRINTF1(_L("Test for notification cancellation on MBMS support in the device - CANCELLED"));
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Get status on the support of MBMS in the current network.
|
|
123 |
* Request to attempt GMM Attach if not done earlier.
|
|
124 |
*/
|
|
125 |
TBool gmmAttach =ETrue;
|
|
126 |
pcktService.GetMbmsNetworkServiceStatus(aGetNtwkServiceStatus, gmmAttach, aMbmsNtwkServiceStatus);
|
|
127 |
User::WaitForRequest(aGetNtwkServiceStatus);
|
|
128 |
TESTL(aMbmsNtwkServiceStatus == DPCKTTSY_MBMS_NETWORKSERVICE_SUPPORTED);
|
|
129 |
TESTL(aGetNtwkServiceStatus == KErrNone);
|
|
130 |
INFO_PRINTF1(_L("Test for MBMS support, without GMM Attach request, in the network - Completed"));
|
|
131 |
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Get status on the support of MBMS in the current network.
|
|
135 |
* Do not perform GMM Attach.
|
|
136 |
*/
|
|
137 |
gmmAttach = EFalse;
|
|
138 |
pcktService.GetMbmsNetworkServiceStatus(aGetNtwkServiceStatus, gmmAttach, aMbmsNtwkServiceStatus);
|
|
139 |
User::WaitForRequest(aGetNtwkServiceStatus);
|
|
140 |
TESTL(aMbmsNtwkServiceStatus == DPCKTTSY_MBMS_NETWORKSERVICE_UNKNOWN);
|
|
141 |
TESTL(aGetNtwkServiceStatus == KErrNone);
|
|
142 |
INFO_PRINTF1(_L("Test for MBMS support, with GMM Attach request, in the network - Completed"));
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Cancel the Get status on the support of MBMS in the current network
|
|
146 |
*/
|
|
147 |
gmmAttach = ETrue;
|
|
148 |
pcktService.GetMbmsNetworkServiceStatus(aGetNtwkServiceStatus,gmmAttach, aMbmsNtwkServiceStatus);
|
|
149 |
pcktService.CancelAsyncRequest(EPacketGetMbmsNetworkServiceStatus);
|
|
150 |
User::WaitForRequest(aGetNtwkServiceStatus);
|
|
151 |
|
|
152 |
TESTL(aGetNtwkServiceStatus == KErrCancel);
|
|
153 |
INFO_PRINTF1(_L("Test for GetMbmsNetworkServiceStatus cancellation on MBMS support in the device - CANCELLED"));
|
|
154 |
|
|
155 |
pcktService.Close();
|
|
156 |
phone.Close();
|
|
157 |
return TestStepResult();
|
|
158 |
}
|