|
1 // Copyright (c) 2007-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 |
|
18 @internalComponent |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef DVBHHAIASYNCTEST_H |
|
23 #define DVBHHAIASYNCTEST_H |
|
24 |
|
25 #include <testframework.h> |
|
26 #include "dvbhhaitestutil.h" |
|
27 #include <e32property.h> |
|
28 #include <mobiletv/hai/dvbh/dvbhreceiverinfo.h> |
|
29 |
|
30 class RDvbhHaiAsyncTest : public RAsyncTestStep, |
|
31 public MDvbhHaiTestLoggerInterface, |
|
32 public MDvbhStateObserver, |
|
33 public MDvbhSignalQualityObserver, |
|
34 public MDvbhPlatformObserver, |
|
35 public MDvbhNetworkTimeObserver, |
|
36 public MDvbhFrequencyObserver, |
|
37 public MDvbhCellIdObserver, |
|
38 public MDvbhNetworkIdObserver |
|
39 { |
|
40 private: |
|
41 class CAlternativeStateObserver; |
|
42 friend class CDvbhTestUtil; |
|
43 friend class CAlternativeStateObserver; |
|
44 |
|
45 public: |
|
46 static RDvbhHaiAsyncTest* NewL(TBool aRequireReceiverInfo, const TDesC& aTestName); |
|
47 |
|
48 //MDvbhStateObserver |
|
49 virtual void DvbhStateChange( TDvbhState aNewState ); |
|
50 |
|
51 //MDvbhSignalQualityObserver |
|
52 void DvbhSignalQualityChange( const TDvbhSignalQuality& aNewSignalQuality ); |
|
53 |
|
54 //MDvbhPlatformObserver |
|
55 void DvbhPlatformChange( const TDvbhPlatform& aNewPlatform, const TIp6Addr& aESGRoot ); |
|
56 |
|
57 //MDvbhNetworkTimeObserver |
|
58 void DvbhNetworkTimeUpdate(); |
|
59 |
|
60 //MDvbhFrequencyObserver |
|
61 void DvbhFrequencyChange( const TDvbhFrequency& aNewFrequency ); |
|
62 |
|
63 //MDvbhCellIdObserver |
|
64 void DvbhCellIdChange( const TDvbhCellId& aNewCellId ); |
|
65 |
|
66 //MDvbhNetworkIdObserver |
|
67 void DvbhNetworkIdChange( const TDvbhNetworkId& aNewNetworkId ); |
|
68 protected: |
|
69 //From RAsyncTestStep |
|
70 virtual void KickoffTestL(); |
|
71 virtual void CloseTest(); |
|
72 |
|
73 //From MDvbhHaiTestLoggerInterface |
|
74 void InfoPrintf3(const TDesC16& aString, TInt aInt1, TInt aInt2); |
|
75 void InfoPrintf4(const TDesC16& aString, TInt aInt1, TInt aInt2, TInt aInt3); |
|
76 |
|
77 //Access to protected data |
|
78 |
|
79 //CDvbhReceiverInfo Positive Async Test Steps |
|
80 void DoSetStateObserverTestStep(TBool aProperyExists); //111 & 118 |
|
81 void DoSetSignalQualityObserverTestStep(TBool aProperyExists); //112 & 119 |
|
82 void DoSetPlatformObserverTestStep(TBool aProperyExists); //113 & 120 |
|
83 void DoSetNetworkTimeObserverTestStep(TBool aProperyExists); //114 & 121 |
|
84 void DoSetFrequencyObserverTestStep(TBool aProperyExists); //115 & 122 |
|
85 void DoSetCellIdObserverTestStep(TBool aProperyExists); //116 & 123 |
|
86 void DoSetNetworkIdObserverTestStep(TBool aProperyExists); //117 & 124 |
|
87 void DoSetMultipleStateObserversTestStep(TBool aProperyExists); //125 & 126 |
|
88 void DoCreateMultipleReceiverInfoTestStep(TBool aProperyExists); //127 & 128 |
|
89 |
|
90 //CDvbhReceiverInfo Negative Async Test Steps |
|
91 void DoSetObserversNoMemory(); //401 |
|
92 private: |
|
93 /** |
|
94 * A second state observer to test setting multiple observers. |
|
95 */ |
|
96 class CAlternativeStateObserver : public CBase, |
|
97 public MDvbhStateObserver |
|
98 { |
|
99 public: |
|
100 static CAlternativeStateObserver* NewL(RDvbhHaiAsyncTest& aTestStep); |
|
101 virtual void DvbhStateChange( TDvbhState aNewState ); |
|
102 private: |
|
103 CAlternativeStateObserver(RDvbhHaiAsyncTest& aTestStep); |
|
104 RDvbhHaiAsyncTest& iTestStep; |
|
105 }; |
|
106 |
|
107 enum |
|
108 { |
|
109 E1stStateObserver = 0, |
|
110 E2ndStateObserver = 1 |
|
111 }; |
|
112 |
|
113 private: |
|
114 RDvbhHaiAsyncTest(TBool aRequireReceiverInfo, const TDesC& aTestName); |
|
115 TVerdict DoPreTest(); |
|
116 void SetupParameterData(); |
|
117 private: |
|
118 TTime iExpectedNetworkTime; |
|
119 TTime iInitialNetworkTime; |
|
120 TDvbhPlatformProperty iInitialPlatform; |
|
121 TDvbhPlatformProperty iExpectedPlatform; |
|
122 |
|
123 TBool iPreTestRun; |
|
124 TBool iRequireReceiverInfo; |
|
125 |
|
126 TInt iStateCallbackVerdicts[2]; |
|
127 |
|
128 CDvbhReceiverInfo* iRxInfo; |
|
129 CDvbhReceiverInfo* i2ndRxInfo; |
|
130 CDvbhTestUtil* iTestUtils; |
|
131 CAlternativeStateObserver* i2ndStateObserver; |
|
132 }; |
|
133 |
|
134 |
|
135 #endif // DVBHHAIASYNCTEST_H |