|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MUSENGTESTDEFS_H |
|
21 #define MUSENGTESTDEFS_H |
|
22 |
|
23 #include <mcesession.h> |
|
24 #include <mcemanager.h> |
|
25 |
|
26 #include <digia/eunit/eunitmacros.h> |
|
27 // Next row is to disable warning emerging from EUnit code. |
|
28 // Placement is due to a fact that most test case files |
|
29 // include this file. Directive can be removed when |
|
30 // EUnit is fixed. |
|
31 #pragma warn_illtokenpasting off |
|
32 |
|
33 // Test values |
|
34 |
|
35 _LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" ); |
|
36 _LIT( KTestRecipient2SipUri, "sip:TestRecipient2@host.domain" ); |
|
37 _LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" ); |
|
38 _LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); |
|
39 _LIT( KTestRecipientTelUri, "tel:+3581111111"); |
|
40 _LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); |
|
41 |
|
42 _LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" ); |
|
43 _LIT8( KTestRecipient2SipUri8, "sip:TestRecipient2@host.domain" ); |
|
44 _LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" ); |
|
45 _LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" ); |
|
46 _LIT8( KTestRecipientTelUri8, "tel:+3581111111"); |
|
47 _LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" ); |
|
48 |
|
49 _LIT8( KTestRecipientRandomText8, "sfjsfjklsjdkfsj" ); |
|
50 _LIT8( KTestRecipientSipUriWithSpace8, "s:re cipi ent@" ); |
|
51 _LIT8( KTestRecipientTelUriWithAtSign8, "tel:+3581111111@host.domain" ); //invalid |
|
52 _LIT8( KTestRecipientTelUriWithXCharAtEnd8, "tel:+3581111111X" ); //invalid |
|
53 _LIT8( KTestRecipientTelUriWithXCharAtStart8, "tel:+X3581111111" ); //invalid |
|
54 |
|
55 _LIT8( KTestRecipientLocalTelUriNoTelPrefix8, "3581111111" ); |
|
56 _LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtEnd8, "3581111111X" ); //invalid |
|
57 _LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtStart8, "X3581111111" ); //invalid |
|
58 _LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtMiddle8, "35811X11111" ); //invalid |
|
59 |
|
60 _LIT8( KTestRecipientLocalTelUri8, "tel:3581111111"); |
|
61 _LIT8( KTestRecipientLocalTelUriPrefixUpperCase8, "TEL:3581111111"); |
|
62 _LIT8( KTestRecipientLocalTelUriWithXCharAtEnd8, "tel:3581111111X" ); //invalid |
|
63 _LIT8( KTestRecipientLocalTelUriWithXCharAtStart8, "tel:X3581111111" ); //invalid |
|
64 _LIT8( KTestRecipientLocalTelUriWithXCharAtMiddle8, "tel:35811X11111" ); //invalid |
|
65 _LIT8( KTestRecipientLocalTelUriTelPrefixAtMiddle8, "358tel:11X11111" ); //invalid |
|
66 |
|
67 _LIT8( KTestOriginator, "Frank Swis" ); |
|
68 |
|
69 _LIT( KTestAudioFileName, "audiofile" ); |
|
70 _LIT( KTestVideoFileName, "H263videofile" ); |
|
71 _LIT( KTestAvcVideoFileName, "H264videofile" ); |
|
72 |
|
73 const TInt KSipStatusCodeNoCodeSet = 0; |
|
74 const TInt KSipStatusCode200OK = 200; |
|
75 const TInt KSipStatusCode400BadRequest = 400; |
|
76 const TInt KSipStatusCode401Unauthorized = 401; |
|
77 const TInt KSipStatusCode402PaymentRequired = 402; |
|
78 const TInt KSipStatusCode404RecipientNotFound = 404; |
|
79 const TInt KSipStatusCode407ProxyAuthenticationRequired = 407; |
|
80 const TInt KSipStatusCode408ConnectionTimeOut = 408; |
|
81 const TInt KSipStatusCode415UnsupportedMediaType = 415; |
|
82 const TInt KSipStatusCode416UnsupportedUriScheme = 416; |
|
83 const TInt KSipStatusCode479NotAbleToProcessURI = 479; |
|
84 const TInt KSipStatusCode480TemporarilyNotAvailable = 480; |
|
85 const TInt KSipStatusCode486BusyHere = 486; |
|
86 const TInt KSipStatusCode487RequestCancelled = 487; |
|
87 const TInt KSipStatusCode488NotAcceptableHere = 488; |
|
88 const TInt KSipStatusCode603Decline = 603; |
|
89 const TInt KSipStatusCode606NotAcceptable = 606; |
|
90 const TInt KSipStatusCodeUnknown = 10000; |
|
91 |
|
92 const TInt KTelephonyVolumeMinValue = 1; |
|
93 const TInt KTelephonyVolumeDefaultValue = 4; |
|
94 const TInt KTelephonyVolumeMaxValue = 1; |
|
95 |
|
96 const TTimeIntervalMicroSeconds KMusEngTestFileDuration( 120000000 ); // 2 min |
|
97 const TTimeIntervalMicroSeconds KMusEngTestFilePosition( 60000000 ); // 2 min |
|
98 |
|
99 const TInt KTestMaxBrightness = 100; |
|
100 const TInt KTestMoreThanMaxBrightness = 101; |
|
101 const TInt KTestDefaultBrightness = 0; |
|
102 const TInt KTestMinBrightness = -100; |
|
103 const TInt KTestLessThanMinBrightness = -101; |
|
104 const TInt KTestSomeBrightness = 25; |
|
105 const TInt KTestBrightnessStepSize = 10; |
|
106 |
|
107 |
|
108 // Values originally introduced in telephonydomaincrkeys.h |
|
109 |
|
110 const TUid KCRUidInCallVolume = {0x102828B1}; |
|
111 const TUint32 KTelIncallEarVolume = 0x00000001; |
|
112 const TUint32 KTelIncallLoudspeakerVolume = 0x00000002; |
|
113 |
|
114 |
|
115 // Helper macros |
|
116 |
|
117 #define MUS_TEST_FORWARD_ALLOC_FAILURE( error )\ |
|
118 if ( error == KErrNoMemory )\ |
|
119 {\ |
|
120 User::Leave( error );\ |
|
121 } |
|
122 |
|
123 // NOTE! NMusSessionApi::KCategoryUid, NMusSessionApi::KRemoteSipAddress p&s property |
|
124 // should contain recipient address to be used for invitation. |
|
125 // |
|
126 #define ESTABLISH_OUT_SESSION( outSession )\ |
|
127 outSession->EstablishLcSessionL();\ |
|
128 outSession->iSession->iState = CMceSession::EEstablished;\ |
|
129 for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\ |
|
130 {\ |
|
131 outSession->iSession->Streams()[i]->iState =\ |
|
132 CMceMediaStream::EStreaming;\ |
|
133 }\ |
|
134 if ( outSession->iSession->iManager &&\ |
|
135 outSession->iSession->iManager->iSessionObserver )\ |
|
136 {\ |
|
137 outSession->iSession->iManager->iSessionObserver->SessionStateChanged(\ |
|
138 *(outSession->iSession),\ |
|
139 outSession->iSession->iManager->iContainer );\ |
|
140 } |
|
141 |
|
142 #define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\ |
|
143 ESTABLISH_OUT_SESSION( outSession );\ |
|
144 outSession->EnableDisplayL( ETrue );\ |
|
145 outSession->LocalVideoPlayer()->LcPlayL(); |
|
146 |
|
147 |
|
148 #define MUSENG_EUNIT_ASSERT_EQUALS( func, val ) \ |
|
149 {\ |
|
150 TInt musUnitTestRetVal = func;\ |
|
151 if ( musUnitTestRetVal != KErrNoMemory ){\ |
|
152 EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\ |
|
153 }\ |
|
154 else{\ |
|
155 User::Leave( KErrNoMemory );\ |
|
156 }\ |
|
157 } |
|
158 |
|
159 #define MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( func, val ) \ |
|
160 {\ |
|
161 TRAPD( musUnitTestRetVal, func );\ |
|
162 if ( val != KErrNoMemory && musUnitTestRetVal == KErrNoMemory ){\ |
|
163 User::Leave( KErrNoMemory );\ |
|
164 }\ |
|
165 else{\ |
|
166 EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\ |
|
167 }\ |
|
168 } |
|
169 |
|
170 #endif // MUSENGTESTDEFS_H |
|
171 |
|
172 |