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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file The TEFUnit integration test suite for MBMS Context support in the Common TSY.
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include "cctsyucasembms007.h"
|
|
21 |
#include "cctsyactiveretriever.h"
|
|
22 |
#include <etel.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
#include <et_clsvr.h>
|
|
25 |
#include <ctsy/mmtsy_names.h>
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include "tmockltsydata.h"
|
|
28 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
29 |
|
|
30 |
#include <pcktcs.h>
|
|
31 |
#include <pcktlist.h>
|
|
32 |
#include "pcktretrieve.h"
|
|
33 |
#include "CMmCommonStaticUtility.h"
|
|
34 |
#include <ctsy/serviceapi/mmtsy_defaults.h>
|
|
35 |
|
|
36 |
CTestSuite* CCTsyUCaseMbms007::CreateSuiteL(const TDesC& aName)
|
|
37 |
{
|
|
38 |
SUB_SUITE;
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms007, CCtsyIntegrationTestMbms0001L );
|
|
40 |
END_SUITE;
|
|
41 |
}
|
|
42 |
|
|
43 |
//
|
|
44 |
// Actual test cases
|
|
45 |
//
|
|
46 |
|
|
47 |
/**
|
|
48 |
* @SYMTestCaseID BA-CTSY-INT-MB-0013
|
|
49 |
* @SYMFssID BA/CTSY/PKTS-0013
|
|
50 |
* @SYMTestCaseDesc Support being notified when MBMS network service availability changes to unavailable.
|
|
51 |
* @SYMTestPriority High
|
|
52 |
* @SYMTestActions RPacketService::NotifyMbmsNetworkServiceStatusChange
|
|
53 |
* @SYMTestExpectedResults Pass - MBMS network availability status is returned correctly.
|
|
54 |
* @SYMTestType CIT
|
|
55 |
* @SYMTestCaseDependencies live/manual
|
|
56 |
*
|
|
57 |
* Reason for test: Verify that NotifyMbmsNetworkServiceStatusChange completes correctly with correct MBMS network status.
|
|
58 |
*
|
|
59 |
* @return - none
|
|
60 |
*/
|
|
61 |
void CCTsyUCaseMbms007::CCtsyIntegrationTestMbms0001L()
|
|
62 |
{
|
|
63 |
|
|
64 |
//
|
|
65 |
// SET UP
|
|
66 |
//
|
|
67 |
|
|
68 |
OpenEtelServerL( EUseExtendedError );
|
|
69 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
70 |
OpenPhoneL();
|
|
71 |
|
|
72 |
RBuf8 data;
|
|
73 |
CleanupClosePushL(data);
|
|
74 |
|
|
75 |
RBuf8 data2;
|
|
76 |
CleanupClosePushL(data2);
|
|
77 |
|
|
78 |
RPacketService packetService;
|
|
79 |
OpenPacketServiceL( packetService );
|
|
80 |
CleanupClosePushL( packetService );
|
|
81 |
|
|
82 |
// Open new context
|
|
83 |
TInfoName contextId;
|
|
84 |
RPacketMbmsContext packetMbmsContext;
|
|
85 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
86 |
CleanupClosePushL( packetMbmsContext );
|
|
87 |
|
|
88 |
|
|
89 |
TRequestStatus requestStatus;
|
|
90 |
TRequestStatus requestStatus2;
|
|
91 |
TMbmsNetworkServiceStatus regStatus;
|
|
92 |
TRequestStatus mockLtsyStatus;
|
|
93 |
TMbmsNetworkServiceStatus regStatuscomplete = EMbmsSupported;
|
|
94 |
|
|
95 |
// Ensure packet service status is RPacketService::EStatusAttached.
|
|
96 |
RPacketService::TStatus sendStatus = RPacketService::EStatusAttached;
|
|
97 |
TBool isResumed = EFalse;
|
|
98 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData(sendStatus, isResumed);
|
|
99 |
ltsyData.SerialiseL(data);
|
|
100 |
RPacketService::TStatus contextStatus;
|
|
101 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
102 |
|
|
103 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
104 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
|
|
105 |
|
|
106 |
User::WaitForRequest(mockLtsyStatus);
|
|
107 |
User::WaitForRequest(requestStatus2);
|
|
108 |
AssertMockLtsyStatusL();
|
|
109 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
110 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
111 |
|
|
112 |
// post RPacketService::NotifyMbmsNetworkServiceStatusChange
|
|
113 |
packetService.NotifyMbmsNetworkServiceStatusChange(requestStatus, regStatus);
|
|
114 |
|
|
115 |
TMbmsNetworkServiceStatus sndData = EMbmsSupported;
|
|
116 |
TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData2(sndData);
|
|
117 |
data.Close();
|
|
118 |
ltsyData2.SerialiseL(data);
|
|
119 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
120 |
|
|
121 |
// Ensure RPacketService::NotifyMbmsNetworkServiceStatusChange completes with status EMbmsSupported.
|
|
122 |
iMockLTSY.CompleteL(EPacketNotifyMbmsNetworkServiceStatusChange, KErrNone, data);
|
|
123 |
User::WaitForRequest(mockLtsyStatus);
|
|
124 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
125 |
ASSERT_TRUE(regStatuscomplete == regStatus);
|
|
126 |
|
|
127 |
//
|
|
128 |
// SET UP END
|
|
129 |
//
|
|
130 |
|
|
131 |
//
|
|
132 |
// TEST START
|
|
133 |
//
|
|
134 |
|
|
135 |
|
|
136 |
regStatuscomplete = EMbmsSupportUnknown;
|
|
137 |
|
|
138 |
// post RPacketService::NotifyMbmsNetworkServiceStatusChange
|
|
139 |
packetService.NotifyMbmsNetworkServiceStatusChange(requestStatus, regStatus);
|
|
140 |
|
|
141 |
// Ensure packet service status is RPacketService::EStatusUnattached
|
|
142 |
sendStatus = RPacketService::EStatusUnattached;
|
|
143 |
isResumed = EFalse;
|
|
144 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData3(sendStatus, isResumed);
|
|
145 |
ltsyData3.SerialiseL(data);
|
|
146 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
147 |
|
|
148 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
149 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
|
|
150 |
|
|
151 |
User::WaitForRequest(mockLtsyStatus);
|
|
152 |
User::WaitForRequest(requestStatus2);
|
|
153 |
AssertMockLtsyStatusL();
|
|
154 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
155 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
156 |
|
|
157 |
TMbmsNetworkServiceStatus sndData2 = EMbmsSupportUnknown;
|
|
158 |
TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData4(sndData2);
|
|
159 |
data.Close();
|
|
160 |
ltsyData4.SerialiseL(data);
|
|
161 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
162 |
|
|
163 |
// Ensure RPacketService::NotifyMbmsNetworkServiceStatusChange completes with status EMbmsSupportUnknown.
|
|
164 |
iMockLTSY.CompleteL(EPacketNotifyMbmsNetworkServiceStatusChange, KErrNone, data);
|
|
165 |
User::WaitForRequest(mockLtsyStatus);
|
|
166 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
167 |
ASSERT_TRUE(regStatuscomplete == regStatus);
|
|
168 |
|
|
169 |
//
|
|
170 |
// TEST END
|
|
171 |
//
|
|
172 |
|
|
173 |
AssertMockLtsyStatusL();
|
|
174 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this
|
|
175 |
}
|
|
176 |
|