|
1 /* |
|
2 * Copyright (c) 2009-2010 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 #include <QDate> |
|
18 #include <QTest> |
|
19 #include <QDebug> |
|
20 #include <QSignalSpy> |
|
21 #include <QThread> |
|
22 |
|
23 #include "cxetestutils.h" |
|
24 #include "cxefakecameradevicecontrol.h" |
|
25 #include "cxefakecameradevice.h" |
|
26 #include "cxefakesettings.h" |
|
27 #include "cxeautofocuscontrolsymbianunit.h" |
|
28 #include "unittest_cxeautofocuscontrolsymbian.h" |
|
29 #include "cxenamespace.h" |
|
30 |
|
31 UnitTestCxeAutoFocusControlSymbian::UnitTestCxeAutoFocusControlSymbian() |
|
32 : mAutoFocusControl(NULL), |
|
33 mCameraDeviceControl(NULL), |
|
34 mCameraDevice(NULL), |
|
35 mFakeSettings(NULL) |
|
36 { |
|
37 qRegisterMetaType<CxeError::Id>("CxeError::Id"); |
|
38 qRegisterMetaType<CxeAutoFocusControl::State>("CxeAutoFocusControl::State"); |
|
39 qRegisterMetaType<CxeAutoFocusControl::Mode>("CxeAutoFocusControl::Mode"); |
|
40 } |
|
41 |
|
42 UnitTestCxeAutoFocusControlSymbian::~UnitTestCxeAutoFocusControlSymbian() |
|
43 { |
|
44 } |
|
45 |
|
46 // Run before each individual test case |
|
47 void UnitTestCxeAutoFocusControlSymbian::init() |
|
48 { |
|
49 CX_DEBUG_ENTER_FUNCTION(); |
|
50 |
|
51 mFakeSettings = new CxeFakeSettings(); |
|
52 |
|
53 mCameraDeviceControl = new CxeFakeCameraDeviceControl(); |
|
54 mCameraDevice = new CxeFakeCameraDevice(); |
|
55 mCameraDevice->newCamera(mCameraDeviceControl->cameraIndex(), mCameraDeviceControl); |
|
56 |
|
57 mAutoFocusControl = new CxeAutoFocusControlSymbianUnit(*mCameraDevice, *mFakeSettings); |
|
58 |
|
59 // make sure that initialization is correct |
|
60 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
61 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Hyperfocal); |
|
62 QCOMPARE(mAutoFocusControl->isSoundEnabled(), false); |
|
63 QCOMPARE(mAutoFocusControl->supported(), true); |
|
64 |
|
65 CX_DEBUG_EXIT_FUNCTION(); |
|
66 } |
|
67 |
|
68 // Run after each individual test case |
|
69 void UnitTestCxeAutoFocusControlSymbian::cleanup() |
|
70 { |
|
71 CX_DEBUG_ENTER_FUNCTION(); |
|
72 |
|
73 delete mAutoFocusControl; |
|
74 mAutoFocusControl = NULL; |
|
75 |
|
76 delete mCameraDeviceControl; |
|
77 mCameraDeviceControl = NULL; |
|
78 |
|
79 delete mCameraDevice; |
|
80 mCameraDevice = NULL; |
|
81 |
|
82 delete mFakeSettings; |
|
83 mFakeSettings = NULL; |
|
84 |
|
85 CX_DEBUG_EXIT_FUNCTION(); |
|
86 } |
|
87 |
|
88 |
|
89 void UnitTestCxeAutoFocusControlSymbian::testStart() |
|
90 { |
|
91 // start takes a boolean input and returns CxeError |
|
92 // functionality depends on current state and current autofocus mode |
|
93 |
|
94 QSignalSpy stateSpy(mAutoFocusControl, |
|
95 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
96 CxeError::Id))); |
|
97 |
|
98 CxeError::Id returnValue = CxeError::None; |
|
99 // 1) Default input after initialisation (fixed focus) -> nothing should happen |
|
100 returnValue = mAutoFocusControl->start(); |
|
101 // verifying the result: |
|
102 QVERIFY(returnValue == CxeError::None); |
|
103 QCOMPARE(mAutoFocusControl->isSoundEnabled(), true); // check for input paramete |
|
104 // no state changes |
|
105 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
106 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
107 |
|
108 // 2) Input parameter false is handled correctly |
|
109 // prerequisites : not fixed mode & unknown state -> normal functionality |
|
110 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); // non-fixed |
|
111 // function call |
|
112 returnValue = mAutoFocusControl->start(false); |
|
113 // verifying the result: |
|
114 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); |
|
115 QCOMPARE(returnValue, CxeError::None); |
|
116 QCOMPARE(mAutoFocusControl->isSoundEnabled(), false); // check for input parameter |
|
117 |
|
118 // 3) Autofocus is not ready (state is cancelling or in progress) |
|
119 // prerequisites : |
|
120 mAutoFocusControl->setMode(CxeAutoFocusControl::Macro); // non-fixed mode |
|
121 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); |
|
122 // start should return CxeError::InUse |
|
123 returnValue = mAutoFocusControl->start(); |
|
124 QCOMPARE(returnValue, CxeError::InUse); |
|
125 |
|
126 // 4) Camera has been released |
|
127 // Cannot be tested like this since assertion crashes the function |
|
128 // AFTER prepareForCameraDelete CALL. |
|
129 /*mAutoFocusControl->prepareForCameraDelete(); |
|
130 stateSpy.clear(); |
|
131 returnValue = mAutoFocusControl->start(); |
|
132 // result: no signal should be emitted |
|
133 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
134 QCOMPARE(returnValue, CxeError::None); // should there be and error here? |
|
135 */ |
|
136 } |
|
137 |
|
138 void UnitTestCxeAutoFocusControlSymbian::testCancel() |
|
139 { |
|
140 // create signalspy to monitor that state changed signal |
|
141 QSignalSpy spy(mAutoFocusControl, |
|
142 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
143 CxeError::Id))); |
|
144 |
|
145 // 1) after initialisation cancel does nothing |
|
146 mAutoFocusControl->cancel(); |
|
147 // no state changes |
|
148 QCOMPARE(spy.count(), 0); |
|
149 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
150 |
|
151 // 2) When in fixed focus mode, cancel does nothing |
|
152 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); // non fixed mode so that start works |
|
153 mAutoFocusControl->start(); |
|
154 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
155 mAutoFocusControl->setMode(CxeAutoFocusControl::Infinity); // fixed mode |
|
156 spy.clear(); |
|
157 mAutoFocusControl->cancel(); |
|
158 QCOMPARE(spy.count(), 0); |
|
159 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); |
|
160 |
|
161 // 3) InProgress state and "normal cancel" |
|
162 // set mode back to non fixed mode |
|
163 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); |
|
164 mAutoFocusControl->cancel(); |
|
165 // -> state is changed to Canceling |
|
166 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); |
|
167 // -> focustype set correctly |
|
168 QVERIFY(mAutoFocusControl->focusType() |
|
169 == CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff); |
|
170 |
|
171 // 4) Canceling state (reached when calling canceling twice in a row, |
|
172 // now already in canceling state after previous test) |
|
173 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); |
|
174 mAutoFocusControl->cancel(); |
|
175 // -> state or focustype is not changing |
|
176 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); |
|
177 QVERIFY(mAutoFocusControl->focusType() |
|
178 == CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff); |
|
179 |
|
180 // 5) Ready state (cancel called after start has been called and focus |
|
181 // found) |
|
182 // force state to ready in order to test canceling |
|
183 mAutoFocusControl->setState(CxeAutoFocusControl::Unknown); |
|
184 mAutoFocusControl->start(); // changes to in progress + sets focus type & range |
|
185 mAutoFocusControl->setState(CxeAutoFocusControl::Ready); |
|
186 mAutoFocusControl->cancel(); |
|
187 // state is changed to canceling |
|
188 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); |
|
189 |
|
190 } |
|
191 |
|
192 |
|
193 void UnitTestCxeAutoFocusControlSymbian::testIsFixedFocusMode() |
|
194 { |
|
195 // default value (hyperfocal) |
|
196 QCOMPARE(mAutoFocusControl->isFixedFocusMode(mAutoFocusControl->mode()), true); |
|
197 |
|
198 // set non fixed focus mode |
|
199 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); |
|
200 QCOMPARE(mAutoFocusControl->isFixedFocusMode(mAutoFocusControl->mode()), false); |
|
201 |
|
202 // set fixed focus mode |
|
203 mAutoFocusControl->setMode(CxeAutoFocusControl::Infinity); |
|
204 QCOMPARE(mAutoFocusControl->isFixedFocusMode(mAutoFocusControl->mode()), true); |
|
205 |
|
206 } |
|
207 |
|
208 void UnitTestCxeAutoFocusControlSymbian::testSupported() |
|
209 { |
|
210 bool supported = mAutoFocusControl->supported(); |
|
211 QVERIFY(supported); |
|
212 } |
|
213 |
|
214 |
|
215 void UnitTestCxeAutoFocusControlSymbian::testPrepareForCameraDelete() |
|
216 { |
|
217 // prepareCameraDelete calls prepareCameraRelease plus sets advanced |
|
218 // settings false (supported() will return false) |
|
219 // this test is for both methods |
|
220 |
|
221 // 1) initial values |
|
222 mAutoFocusControl->prepareForCameraDelete(); |
|
223 QCOMPARE(mAutoFocusControl->supported(), false); |
|
224 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
225 |
|
226 // 2) test prepareForCameraDelete with non-initial values |
|
227 mAutoFocusControl->handleCameraAllocated(CxeError::None); |
|
228 // force state to be something else than Unknown and check that it will be changed |
|
229 mAutoFocusControl->setState(CxeAutoFocusControl::Canceling); |
|
230 // force mCancelled to be false and check that it will be changed |
|
231 mAutoFocusControl->mCancelled = true; |
|
232 mAutoFocusControl->prepareForCameraDelete(); |
|
233 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
234 QCOMPARE(mAutoFocusControl->mCancelled, false); |
|
235 QCOMPARE(mAutoFocusControl->supported(), false); |
|
236 |
|
237 } |
|
238 |
|
239 void UnitTestCxeAutoFocusControlSymbian::testHandleCameraAllocated() |
|
240 { |
|
241 // create signalspy to monitor that state changed signal |
|
242 QSignalSpy stateSpy(mAutoFocusControl, |
|
243 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
244 CxeError::Id))); |
|
245 |
|
246 // 1) initial setup without an error (camera is allocated already) |
|
247 mAutoFocusControl->handleCameraAllocated(CxeError::None); |
|
248 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
249 QCOMPARE(mAutoFocusControl->supported(), true); |
|
250 |
|
251 // 2) release camera and call with an error code |
|
252 // -> supported should return false since initializeResources is not called in error case |
|
253 // -> state is not changed |
|
254 mAutoFocusControl->prepareForCameraDelete(); |
|
255 stateSpy.clear(); |
|
256 mAutoFocusControl->handleCameraAllocated(CxeError::General); |
|
257 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
258 QCOMPARE(mAutoFocusControl->supported(), false); |
|
259 |
|
260 // 3) release camera and call without an error |
|
261 // (prepareForCameraDelete has been called in previous test) |
|
262 // -> resources are initialized i.e. supported returns true |
|
263 // first force state to something else so state change can be verified |
|
264 mAutoFocusControl->setState(CxeAutoFocusControl::Canceling); |
|
265 mAutoFocusControl->handleCameraAllocated(CxeError::None); |
|
266 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
267 QCOMPARE(mAutoFocusControl->supported(), true); |
|
268 |
|
269 } |
|
270 |
|
271 void UnitTestCxeAutoFocusControlSymbian::testPrepareForRelease() |
|
272 { |
|
273 // see testPrepareForCameraDelete |
|
274 } |
|
275 |
|
276 void UnitTestCxeAutoFocusControlSymbian::testHandleCameraEventOptimalFocus() |
|
277 { |
|
278 // handleCameraEvent handles callbacks and gets information about |
|
279 // focus events. handleCameraEvent calls private method handleAfEvent |
|
280 // for the focusing events that CxeAutoFocusControlSymbian needs |
|
281 |
|
282 // testing handleAfEvent is done by calling handleCameraEvent |
|
283 // and monitoring state changes after each "event" |
|
284 |
|
285 QSignalSpy stateSpy(mAutoFocusControl, |
|
286 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
287 CxeError::Id))); |
|
288 |
|
289 |
|
290 // Input 1 ---------------------------------------------------- |
|
291 // Optimal focus was reached or couldn't be found |
|
292 int eventUid = KUidECamEventCameraSettingsOptimalFocusUidValue; |
|
293 int symbianError = 0; //KErrNone |
|
294 |
|
295 // AutofocusControl class is not InProgress or Canceling state |
|
296 // => event ignored, nothing is changed |
|
297 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
298 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
299 |
|
300 // AutoFocusControl is InProgress state (waiting for the focus) |
|
301 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); // not fixed focus |
|
302 mAutoFocusControl->start(); |
|
303 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
304 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
305 // => state should change to Ready |
|
306 QVERIFY(CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
307 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Ready); |
|
308 |
|
309 // InProgress state but focus fails |
|
310 mAutoFocusControl->start(); |
|
311 stateSpy.clear(); |
|
312 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
313 mAutoFocusControl->handleCameraEvent(eventUid, -18); // KErrNotReady |
|
314 // => state should change to Failed |
|
315 QVERIFY(CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
316 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Failed); |
|
317 |
|
318 // AutoFocusControl is in Canceling state |
|
319 mAutoFocusControl->start(); |
|
320 mAutoFocusControl->cancel(); |
|
321 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); //verify start state |
|
322 stateSpy.clear(); |
|
323 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
324 // => state should change to Unknown |
|
325 QVERIFY(CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
326 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
327 } |
|
328 |
|
329 void UnitTestCxeAutoFocusControlSymbian::testHandleCameraEventAutofocusChanged() |
|
330 { |
|
331 QSignalSpy stateSpy(mAutoFocusControl, |
|
332 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
333 CxeError::Id))); |
|
334 // Input 2 ----------------------------------------------------- |
|
335 // Notifies a change in autofocus type |
|
336 int eventUid = KUidECamEventCameraSettingAutoFocusType2UidValue; |
|
337 int symbianError = -18; // == KErrNotReady |
|
338 |
|
339 // InProgress: event is ignored |
|
340 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); // not fixed focus |
|
341 mAutoFocusControl->start(); |
|
342 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
343 stateSpy.clear(); |
|
344 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
345 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
346 |
|
347 // Canceling: |
|
348 // error parameter is ignored, state is not changed |
|
349 mAutoFocusControl->cancel(); |
|
350 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Canceling); //verify start state |
|
351 stateSpy.clear(); |
|
352 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
353 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
354 |
|
355 } |
|
356 |
|
357 void UnitTestCxeAutoFocusControlSymbian::testHandleCameraEventFocusRangeChanged() |
|
358 { |
|
359 QSignalSpy stateSpy(mAutoFocusControl, |
|
360 SIGNAL(stateChanged(CxeAutoFocusControl::State, |
|
361 CxeError::Id))); |
|
362 |
|
363 // Input 3 ----------------------------------------------------- |
|
364 // Focus range have changed |
|
365 int eventUid = KUidECamEventCameraSettingFocusRangeUidValue; |
|
366 int symbianError = -2; // == KErrGeneral |
|
367 |
|
368 // In any other state than InProgress this event is ignored |
|
369 stateSpy.clear(); |
|
370 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
371 QVERIFY(!CxeTestUtils::waitForSignal(stateSpy, 1000)); |
|
372 |
|
373 // InProgress: because of the error parameter state changes to failed |
|
374 // (focus range change failed because of error) |
|
375 mAutoFocusControl->setMode(CxeAutoFocusControl::Auto); // not fixed focus |
|
376 mAutoFocusControl->start(); |
|
377 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
378 mAutoFocusControl->handleCameraEvent(eventUid, symbianError); |
|
379 // => state should change to Failed |
|
380 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Failed); |
|
381 } |
|
382 |
|
383 void UnitTestCxeAutoFocusControlSymbian::testHandleSceneChanged() |
|
384 { |
|
385 // changes the autofocus settings to match the new scene settings |
|
386 QVariantMap scene; |
|
387 |
|
388 // changes focus if new scene setting defines fixed focus |
|
389 // otherwise sets the autofocus control to Unknown state (==initial state) |
|
390 |
|
391 // 1) change to a scene with fixed focus mode (Infinity & Hyperfocal) |
|
392 scene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Infinity); |
|
393 mAutoFocusControl->handleSceneChanged(scene); |
|
394 // states are changed and mode is set correctly ->Unknown->InProgress |
|
395 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); // end state |
|
396 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Infinity); |
|
397 |
|
398 // 2) change to non-fixed mode (like Macro) |
|
399 scene.clear(); |
|
400 scene.insert(CxeSettingIds::FOCAL_RANGE, CxeAutoFocusControl::Macro); |
|
401 mAutoFocusControl->handleSceneChanged(scene); |
|
402 // states are changed and mode is set correctly |
|
403 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
404 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Macro); |
|
405 |
|
406 // 3) try with error input (scene does not contain focal_range) |
|
407 scene.clear(); |
|
408 // change the autofocuscontrol state from Unknown (last test) to |
|
409 // something else calling start() for example |
|
410 mAutoFocusControl->start(); |
|
411 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::InProgress); //verify start state |
|
412 mAutoFocusControl->handleSceneChanged(scene); |
|
413 // state is changed and mode is not changed |
|
414 QCOMPARE(mAutoFocusControl->state(), CxeAutoFocusControl::Unknown); |
|
415 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Macro); |
|
416 |
|
417 } |
|
418 |
|
419 void UnitTestCxeAutoFocusControlSymbian::testHandleSettingValueChanged() |
|
420 { |
|
421 // Autofocus mode needs to be updated when face trackin is actived in |
|
422 // scene mod which doesn't support facetracking |
|
423 |
|
424 QVariant on = QVariant(1); |
|
425 QVariant off = QVariant(0); |
|
426 |
|
427 // 1) check that mode does not change when some other setting value |
|
428 // than face tracking is given |
|
429 mAutoFocusControl->handleSettingValueChanged(CxeSettingIds::LIGHT_SENSITIVITY, on); |
|
430 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Hyperfocal); |
|
431 |
|
432 // 2) check turning facetracking on, when mode is fixed |
|
433 mAutoFocusControl->setMode(CxeAutoFocusControl::Infinity); |
|
434 mAutoFocusControl->handleSettingValueChanged(CxeSettingIds::FACE_TRACKING, on); |
|
435 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Auto); |
|
436 QCOMPARE(mAutoFocusControl->mFaceTrackingOverride, true); |
|
437 |
|
438 // 3) check turning facetracking off will return the previous mode |
|
439 mAutoFocusControl->handleSettingValueChanged(CxeSettingIds::FACE_TRACKING, off); |
|
440 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Infinity); |
|
441 QCOMPARE(mAutoFocusControl->mFaceTrackingOverride, false); |
|
442 |
|
443 // 4) check that turning facetracking off, when it is not on, won't |
|
444 // set the previous mode |
|
445 mAutoFocusControl->setMode(CxeAutoFocusControl::Macro); |
|
446 mAutoFocusControl->handleSettingValueChanged(CxeSettingIds::FACE_TRACKING, off); |
|
447 QCOMPARE(mAutoFocusControl->mode(), CxeAutoFocusControl::Macro); |
|
448 QCOMPARE(mAutoFocusControl->mFaceTrackingOverride, false); |
|
449 |
|
450 |
|
451 } |
|
452 |
|
453 |
|
454 |
|
455 // main() function - Need event loop for waiting signals, |
|
456 // so can't use QTEST_APPLESS_MAIN. |
|
457 QTEST_MAIN(UnitTestCxeAutoFocusControlSymbian); |