|
1 /* |
|
2 * Copyright (c) 2002 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: Camcorder MMF API Test DLL |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CamcTest_7.h" |
|
22 |
|
23 // EXTERNAL DATA STRUCTURES |
|
24 |
|
25 // EXTERNAL FUNCTION PROTOTYPES |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // LOCAL CONSTANTS AND MACROS |
|
32 |
|
33 // MODULE DATA STRUCTURES |
|
34 |
|
35 // LOCAL FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 |
|
39 /////////////////////////////////////////////////////////////////// |
|
40 // Tests for Cooperation with Camera API |
|
41 // |
|
42 /////////////////////////////////////////////////////////////////// |
|
43 |
|
44 CCamcTest_7::CCamcTest_7 () |
|
45 { |
|
46 } |
|
47 |
|
48 |
|
49 |
|
50 CCamcTest_7::~CCamcTest_7 () |
|
51 { |
|
52 delete iCamcTestClient; |
|
53 iCamcTestClient = NULL; |
|
54 } |
|
55 |
|
56 |
|
57 void CCamcTest_7::setUpL () |
|
58 { |
|
59 iCamcTestClient = CCamcTestClient_7::NewL( ); |
|
60 } |
|
61 |
|
62 |
|
63 void CCamcTest_7::tearDown () |
|
64 { |
|
65 delete iCamcTestClient; |
|
66 iCamcTestClient = NULL; |
|
67 REComSession::FinalClose(); |
|
68 } |
|
69 |
|
70 |
|
71 // |
|
72 // Own test functions. |
|
73 // |
|
74 |
|
75 void CCamcTest_7::OpenFileL_007_L() |
|
76 { |
|
77 |
|
78 /////////////////////////////////////// |
|
79 // ID: CAMC_API.OPENFILEL_007 |
|
80 // |
|
81 // Action : |
|
82 // Video Format UID = NULL |
|
83 // Output : |
|
84 // Recording works, Doesn't leave. |
|
85 // Precondition : |
|
86 // CVideoRecorderUtility is ready |
|
87 /////////////////////////////////////// |
|
88 |
|
89 iCamcTestClient->Start_Active_ObjectL( K_Tc7_OpenFileWithVideoFormatNULL ); |
|
90 } |
|
91 |
|
92 void CCamcTest_7::OpenFileL_013_L() |
|
93 { |
|
94 /////////////////////////////////////// |
|
95 // ID: CAMC_API.OPENFILE_13 |
|
96 // Action : |
|
97 // Application release the camera while Camcorder still |
|
98 // records |
|
99 // Output : |
|
100 // Recording continues till the end. |
|
101 // Precondition : |
|
102 // Camera Reserved, CamC recording |
|
103 /////////////////////////////////////// |
|
104 |
|
105 iCamcTestClient->Start_Active_ObjectL(K_Tc7_ReleaseCameraWhileRecording); |
|
106 |
|
107 } |
|
108 |
|
109 void CCamcTest_7::OpenFileL_014_L() |
|
110 { |
|
111 /////////////////////////////////////// |
|
112 // ID: CAMC_API.OPENFILE_014 |
|
113 // Action : |
|
114 // Application powers off the camera while Camcorder still |
|
115 // records |
|
116 // Output : |
|
117 // Recording stops with KErrNotReady. |
|
118 // Precondition : |
|
119 // Camera Reserved, CamC recording |
|
120 /////////////////////////////////////// |
|
121 |
|
122 TRAPD(err, |
|
123 iCamcTestClient->Start_Active_ObjectL( K_Tc7_PowerOffCameraWhileRecording ) ); |
|
124 assertTIntsEqualL( KErrNotReady, err ); |
|
125 |
|
126 } |
|
127 |
|
128 void CCamcTest_7::OpenFileL_015_L() |
|
129 { |
|
130 /////////////////////////////////////// |
|
131 // ID: CAMC_API.OPENFILE_015 |
|
132 // Action : |
|
133 // Camera is used by an other application, |
|
134 // Call to OpenFileL() |
|
135 // Output : |
|
136 // Should leave. |
|
137 // Precondition : |
|
138 // Camera Reserved by an other application. |
|
139 /////////////////////////////////////// |
|
140 |
|
141 TRAPD(err,iCamcTestClient->Start_Active_ObjectL( K_Tc7_OpenFileWhenCameraIsNotAvailable )); |
|
142 assertTIntsEqualL( KErrInUse, err ); |
|
143 |
|
144 } |
|
145 |
|
146 void CCamcTest_7::Close_006_L() |
|
147 { |
|
148 /////////////////////////////////////// |
|
149 // ID: CAMC_API.CLOSE_006 |
|
150 // Action : |
|
151 // Application release the camera while Camcorder still |
|
152 // records |
|
153 // Camcorder is Closed |
|
154 // Output : |
|
155 // The Camera can be used by somebody else. |
|
156 // Precondition : |
|
157 // Camera Reserved, CamC recording |
|
158 /////////////////////////////////////// |
|
159 |
|
160 iCamcTestClient->Start_Active_ObjectL( K_Tc7_ReleaseCameraCloseRecorderUseCamera); |
|
161 |
|
162 |
|
163 // Succeed, if it doesn't leave. |
|
164 } |
|
165 // |
|
166 // An own static function to collect the test functions into one |
|
167 // suite of tests. The framework will run the tests and free the |
|
168 // memory allocated for the test suite. |
|
169 // |
|
170 MTest* CCamcTest_7::suiteL () |
|
171 { |
|
172 // Always use NewL (Do not use NewLC) !!! |
|
173 CTestSuite *suite = CTestSuite::NewL(_L8("CCamcTest_7")); |
|
174 |
|
175 suite->addTestL(CTestCaller<CCamcTest_7>::NewL(_L8("CAMC_API.OPENFILEL_007"), &OpenFileL_007_L)); |
|
176 suite->addTestL(CTestCaller<CCamcTest_7>::NewL(_L8("CAMC_API.OPENFILEL_013"), &OpenFileL_013_L)); |
|
177 suite->addTestL(CTestCaller<CCamcTest_7>::NewL(_L8("CAMC_API.OPENFILEL_014"), &OpenFileL_014_L)); |
|
178 suite->addTestL(CTestCaller<CCamcTest_7>::NewL(_L8("CAMC_API.OPENFILEL_015"), &OpenFileL_015_L)); |
|
179 // Removed from MuDo tests |
|
180 // suite->addTestL(CTestCaller<CCamcTest_7>::NewL(_L8("CAMC_API.CLOSE_006"), &Close_006_L)); |
|
181 return suite; |
|
182 } |
|
183 |