|
1 /* |
|
2 * Copyright (c) 2009 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 "ut_infowidgetlayoutmanager.h" |
|
18 #include <QGraphicsWidget> |
|
19 #include <QRectF> |
|
20 #include <QPointF> |
|
21 #include <QString> |
|
22 #include <QFont> |
|
23 #include <QFontMetricsF> |
|
24 #include <hbmarqueeitem.h> |
|
25 #include <hbstyle.h> |
|
26 #define private public |
|
27 #include "infowidgetlayoutmanager.h" |
|
28 #include "qtestmains60.h" |
|
29 |
|
30 const int KNumOfSettingsDisplayRoles = 5; |
|
31 const int KNumOfInfoDisplayRoles = 7; |
|
32 const QString KInfoWidgetDocmlFile = ":/resource/infowidget.docml"; |
|
33 const QString KSettingsDialogDocmlFile = ":/resource/settingsdialog.docml"; |
|
34 const QString KMargueeItemClassName = HbMarqueeItem::staticMetaObject.className(); |
|
35 |
|
36 //class HbStyle; |
|
37 /*! |
|
38 UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager |
|
39 */ |
|
40 UT_InfoWidgetLayoutManager::UT_InfoWidgetLayoutManager() |
|
41 : |
|
42 m_layoutManager(NULL), |
|
43 m_documentLoader(NULL) |
|
44 { |
|
45 m_graphicsWidgetPtr = new QGraphicsWidget; |
|
46 } |
|
47 |
|
48 |
|
49 /*! |
|
50 UT_InfoWidgetLayoutManager::~UT_InfoWidgetLayoutManager |
|
51 */ |
|
52 UT_InfoWidgetLayoutManager::~UT_InfoWidgetLayoutManager() |
|
53 { |
|
54 delete m_layoutManager; |
|
55 delete m_graphicsWidgetPtr; |
|
56 } |
|
57 |
|
58 |
|
59 /*! |
|
60 UT_InfoWidgetLayoutManager::init |
|
61 */ |
|
62 void UT_InfoWidgetLayoutManager::init() |
|
63 { |
|
64 initialize(); |
|
65 bool loadResultInfoWidgetDocml = true; |
|
66 bool loadResultSettingsDialogDocml = true; |
|
67 |
|
68 QObjectList objectListInfoDisplayWidgets; |
|
69 QObjectList objectListSettingsDialogWidgets; |
|
70 |
|
71 EXPECT(HbDocumentLoader::load) |
|
72 .with(KInfoWidgetDocmlFile, loadResultInfoWidgetDocml) |
|
73 .returns(&objectListInfoDisplayWidgets); |
|
74 EXPECT(HbDocumentLoader::load) |
|
75 .with(KSettingsDialogDocmlFile, loadResultSettingsDialogDocml) |
|
76 .returns(&objectListSettingsDialogWidgets); |
|
77 m_layoutManager = new InfoWidgetLayoutManager(); |
|
78 |
|
79 m_documentLoader = new InfoWidgetDocumentLoader; |
|
80 |
|
81 QVERIFY(verify()); |
|
82 } |
|
83 |
|
84 /*! |
|
85 UT_InfoWidgetLayoutManager::cleanup |
|
86 */ |
|
87 void UT_InfoWidgetLayoutManager::cleanup() |
|
88 { |
|
89 reset(); |
|
90 |
|
91 delete m_layoutManager; |
|
92 m_layoutManager = NULL; |
|
93 |
|
94 delete m_documentLoader; |
|
95 m_documentLoader = NULL; |
|
96 } |
|
97 |
|
98 /*! |
|
99 UT_InfoWidgetLayoutManager::fillDisplayContainers |
|
100 */ |
|
101 void UT_InfoWidgetLayoutManager::fillDisplayContainers() |
|
102 { |
|
103 InfoWidgetLayoutManager::LayoutItemRole currentRole; |
|
104 |
|
105 QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayWidgetRoles = |
|
106 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay); |
|
107 foreach (currentRole, infoDisplayWidgetRoles) { |
|
108 m_layoutManager->m_infoDisplayWidgets.insert(currentRole, m_graphicsWidgetPtr.data()); |
|
109 } |
|
110 |
|
111 QList<InfoWidgetLayoutManager::LayoutItemRole> settingsDisplayWidgetRoles = |
|
112 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDialog); |
|
113 foreach (currentRole, settingsDisplayWidgetRoles) { |
|
114 m_layoutManager->m_settingsDialogWidgets.insert(currentRole, m_graphicsWidgetPtr.data()); |
|
115 } |
|
116 } |
|
117 |
|
118 /*! |
|
119 UT_InfoWidgetLayoutManager::fillParams |
|
120 */ |
|
121 void UT_InfoWidgetLayoutManager::fillParams(const QString & fileName, |
|
122 bool * ok){ |
|
123 Q_UNUSED(fileName) |
|
124 *ok = true; |
|
125 } |
|
126 |
|
127 /*! |
|
128 UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer |
|
129 */ |
|
130 void UT_InfoWidgetLayoutManager::fillCurrentWidgetsContainer() |
|
131 { |
|
132 InfoWidgetLayoutManager::LayoutItemRole currentRole; |
|
133 |
|
134 QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayWidgetRoles = |
|
135 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay); |
|
136 foreach (currentRole, infoDisplayWidgetRoles) { |
|
137 m_layoutManager->m_widgets.insert(currentRole, m_graphicsWidgetPtr.data()); |
|
138 } |
|
139 } |
|
140 |
|
141 /*! |
|
142 UT_InfoWidgetLayoutManager::t_currentDisplayRole |
|
143 */ |
|
144 void UT_InfoWidgetLayoutManager::t_currentDisplayRole() |
|
145 { |
|
146 InfoWidgetLayoutManager::DisplayRole role = |
|
147 m_layoutManager->currentDisplayRole(); |
|
148 |
|
149 QVERIFY(InfoWidgetLayoutManager::InfoDisplay == role); |
|
150 } |
|
151 |
|
152 |
|
153 /*! |
|
154 UT_InfoWidgetLayoutManager::t_currentWidgetRoles |
|
155 */ |
|
156 void UT_InfoWidgetLayoutManager::t_currentWidgetRoles() |
|
157 { |
|
158 // Initial state after layout manager construction |
|
159 QList<InfoWidgetLayoutManager::LayoutItemRole> roles = |
|
160 m_layoutManager->currentWidgetRoles(); |
|
161 QVERIFY(roles.count() == 0); |
|
162 |
|
163 // Fill display container data |
|
164 fillDisplayContainers(); |
|
165 |
|
166 QGraphicsLayout *activeLayout; |
|
167 activeLayout= m_layoutManager->layoutInfoDisplay(); |
|
168 QVERIFY(!activeLayout); |
|
169 |
|
170 roles = m_layoutManager->currentWidgetRoles(); |
|
171 |
|
172 QVERIFY(roles.count() == KNumOfInfoDisplayRoles); |
|
173 if (roles.count() == KNumOfInfoDisplayRoles) { |
|
174 QVERIFY(0 <= roles.indexOf( |
|
175 InfoWidgetLayoutManager::RoleContent)); |
|
176 QVERIFY(0 <= roles.indexOf( |
|
177 InfoWidgetLayoutManager::RoleSpnMarqueeItem)); |
|
178 QVERIFY(0 <= roles.indexOf( |
|
179 InfoWidgetLayoutManager::RoleMcnMarqueeItem)); |
|
180 QVERIFY(0 <= roles.indexOf( |
|
181 InfoWidgetLayoutManager::RoleSatMarqueeItem)); |
|
182 QVERIFY(0 <= roles.indexOf( |
|
183 InfoWidgetLayoutManager::RoleSpnIcon)); |
|
184 QVERIFY(0 <= roles.indexOf( |
|
185 InfoWidgetLayoutManager::RoleMcnIcon)); |
|
186 QVERIFY(0 <= roles.indexOf( |
|
187 InfoWidgetLayoutManager::RoleSatTextIcon)); |
|
188 } |
|
189 |
|
190 activeLayout= m_layoutManager->layoutSettingsDialog(); |
|
191 QVERIFY(!activeLayout); |
|
192 |
|
193 roles = m_layoutManager->currentWidgetRoles(); |
|
194 int dVar = roles.count(); |
|
195 QVERIFY(roles.count() == KNumOfSettingsDisplayRoles); |
|
196 |
|
197 } |
|
198 |
|
199 |
|
200 /*! |
|
201 UT_InfoWidgetLayoutManager::t_layoutRows |
|
202 */ |
|
203 void UT_InfoWidgetLayoutManager::t_layoutRows() |
|
204 { |
|
205 int rows = m_layoutManager->layoutRows(); |
|
206 QVERIFY(0 == rows); |
|
207 } |
|
208 |
|
209 |
|
210 /*! |
|
211 UT_InfoWidgetLayoutManager::t_setLayoutRows |
|
212 */ |
|
213 void UT_InfoWidgetLayoutManager::t_setLayoutRows() |
|
214 { |
|
215 const int KLayoutRows = 1; |
|
216 m_layoutManager->setLayoutRows(KLayoutRows); |
|
217 QVERIFY(KLayoutRows == m_layoutManager->layoutRows()); |
|
218 } |
|
219 |
|
220 /*! |
|
221 UT_InfoWidgetLayoutManager::t_setLayoutRows |
|
222 */ |
|
223 void UT_InfoWidgetLayoutManager::t_rowHeight() |
|
224 { |
|
225 bool b = false; |
|
226 EXPECT(HbStyle::parameter).returns(b); |
|
227 m_layoutManager->layoutRowHeight(); |
|
228 |
|
229 b = true; |
|
230 EXPECT(HbStyle::parameter).returns(b); |
|
231 m_layoutManager->layoutRowHeight(); |
|
232 |
|
233 QVERIFY(verify()); |
|
234 } |
|
235 |
|
236 /*! |
|
237 UT_InfoWidgetLayoutManager::t_layoutInfoDisplay |
|
238 */ |
|
239 void UT_InfoWidgetLayoutManager::t_layoutInfoDisplay() |
|
240 { |
|
241 QVERIFY(!m_layoutManager->layoutInfoDisplay()); |
|
242 } |
|
243 |
|
244 |
|
245 /*! |
|
246 UT_InfoWidgetLayoutManager::t_layoutSettingsDialog |
|
247 */ |
|
248 void UT_InfoWidgetLayoutManager::t_layoutSettingsDialog() |
|
249 { |
|
250 QVERIFY(!m_layoutManager->layoutSettingsDialog()); |
|
251 } |
|
252 |
|
253 /*! |
|
254 UT_InfoWidgetLayoutManager::t_widgetRoles |
|
255 */ |
|
256 void UT_InfoWidgetLayoutManager::t_widgetRoles() |
|
257 { |
|
258 const QList<InfoWidgetLayoutManager::LayoutItemRole> settingDisplayRoles = |
|
259 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDialog); |
|
260 |
|
261 QVERIFY(settingDisplayRoles.count() == KNumOfSettingsDisplayRoles); |
|
262 if (settingDisplayRoles.count() == KNumOfSettingsDisplayRoles) { |
|
263 QVERIFY(0 <= settingDisplayRoles.indexOf( |
|
264 InfoWidgetLayoutManager::RoleSettingsDialog)); |
|
265 QVERIFY(0 <= settingDisplayRoles.indexOf( |
|
266 InfoWidgetLayoutManager::RoleSpnCheckBox)); |
|
267 QVERIFY(0 <= settingDisplayRoles.indexOf( |
|
268 InfoWidgetLayoutManager::RoleMcnCheckBox)); |
|
269 QVERIFY(0 <= settingDisplayRoles.indexOf( |
|
270 InfoWidgetLayoutManager::RoleSatTextCheckBox)); |
|
271 QVERIFY(0 <= settingDisplayRoles.indexOf( |
|
272 InfoWidgetLayoutManager::RoleSettingsContainer)); |
|
273 } |
|
274 |
|
275 const QList<InfoWidgetLayoutManager::LayoutItemRole> infoDisplayRoles = |
|
276 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::InfoDisplay); |
|
277 QVERIFY(infoDisplayRoles.count() == KNumOfInfoDisplayRoles); |
|
278 if (infoDisplayRoles.count() == KNumOfInfoDisplayRoles) { |
|
279 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
280 InfoWidgetLayoutManager::RoleContent)); |
|
281 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
282 InfoWidgetLayoutManager::RoleSpnMarqueeItem)); |
|
283 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
284 InfoWidgetLayoutManager::RoleMcnMarqueeItem)); |
|
285 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
286 InfoWidgetLayoutManager::RoleSatMarqueeItem)); |
|
287 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
288 InfoWidgetLayoutManager::RoleSpnIcon)); |
|
289 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
290 InfoWidgetLayoutManager::RoleMcnIcon)); |
|
291 QVERIFY(0 <= infoDisplayRoles.indexOf( |
|
292 InfoWidgetLayoutManager::RoleSatTextIcon)); |
|
293 } |
|
294 } |
|
295 |
|
296 /*! |
|
297 UT_InfoWidgetLayoutManager::t_loadWidgets |
|
298 */ |
|
299 void UT_InfoWidgetLayoutManager::t_loadWidgets() |
|
300 { |
|
301 QObjectList list = QObjectList(); |
|
302 EXPECT(HbDocumentLoader::load) |
|
303 .willOnce(invoke(this, &fillParams)).returns(list); |
|
304 |
|
305 const QList<InfoWidgetLayoutManager::LayoutItemRole> settingDisplayRoles = |
|
306 m_layoutManager->widgetRoles(InfoWidgetLayoutManager::SettingsDialog); |
|
307 bool loadResult = m_layoutManager->loadWidgets(InfoWidgetLayoutManager::SettingsDialog, |
|
308 settingDisplayRoles, |
|
309 m_layoutManager->m_infoDisplayWidgets); |
|
310 |
|
311 QVERIFY(!loadResult); |
|
312 } |
|
313 |
|
314 /*! |
|
315 UT_InfoWidgetLayoutManager::t_loadWidget |
|
316 */ |
|
317 void UT_InfoWidgetLayoutManager::t_loadWidget() |
|
318 { |
|
319 QGraphicsWidget *currentWidget; |
|
320 InfoWidgetLayoutManager::LayoutItemRole currentRole; |
|
321 |
|
322 QList<InfoWidgetLayoutManager::LayoutItemRole> |
|
323 infoDisplayWidgetRoles = m_layoutManager->widgetRoles( |
|
324 InfoWidgetLayoutManager::InfoDisplay); |
|
325 |
|
326 infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleUndefined); |
|
327 infoDisplayWidgetRoles.append(InfoWidgetLayoutManager::RoleContainer); |
|
328 |
|
329 |
|
330 foreach (currentRole, infoDisplayWidgetRoles) { |
|
331 currentWidget = m_layoutManager->loadWidget(*m_documentLoader, |
|
332 InfoWidgetLayoutManager::InfoDisplay, |
|
333 currentRole); |
|
334 QVERIFY(!currentWidget); |
|
335 } |
|
336 |
|
337 QList<InfoWidgetLayoutManager::LayoutItemRole> |
|
338 settingsDisplayWidgetRoles = m_layoutManager->widgetRoles( |
|
339 InfoWidgetLayoutManager::SettingsDialog); |
|
340 |
|
341 foreach (currentRole, settingsDisplayWidgetRoles) { |
|
342 currentWidget = m_layoutManager->loadWidget(*m_documentLoader, |
|
343 InfoWidgetLayoutManager::SettingsDialog, |
|
344 currentRole); |
|
345 QVERIFY(!currentWidget); |
|
346 } |
|
347 |
|
348 currentWidget = m_layoutManager->loadWidget(*m_documentLoader, |
|
349 (InfoWidgetLayoutManager::DisplayRole)2, |
|
350 InfoWidgetLayoutManager::RoleLastEnum ); |
|
351 |
|
352 QVERIFY(!currentWidget); |
|
353 } |
|
354 |
|
355 /*! |
|
356 UT_InfoWidgetLayoutManager::t_loadObject |
|
357 */ |
|
358 void UT_InfoWidgetLayoutManager::t_loadObject() |
|
359 { |
|
360 QObject *currentObject(NULL); |
|
361 InfoWidgetLayoutManager::LayoutItemRole currentRole; |
|
362 |
|
363 QList<InfoWidgetLayoutManager::LayoutItemRole> objectRoles; |
|
364 |
|
365 objectRoles.append(InfoWidgetLayoutManager::RoleCancelAction); |
|
366 QObject *okAction = new QObject; |
|
367 |
|
368 objectRoles.append(InfoWidgetLayoutManager::RoleOkAction); |
|
369 QObject *cancelAction = new QObject; |
|
370 |
|
371 // Test: |
|
372 EXPECT(HbDocumentLoader::findObject).with(QString("sd:cancelAction")).returns(cancelAction); |
|
373 EXPECT(HbDocumentLoader::findObject).with(QString("sd:okAction")).returns(okAction); |
|
374 |
|
375 foreach(currentRole, objectRoles) { |
|
376 currentObject = m_layoutManager->loadObject(*m_documentLoader, |
|
377 InfoWidgetLayoutManager::SettingsDialog, |
|
378 currentRole); |
|
379 QVERIFY(currentObject); |
|
380 } |
|
381 |
|
382 QVERIFY(verify()); |
|
383 } |
|
384 |
|
385 |
|
386 |
|
387 /*! |
|
388 UT_InfoWidgetLayoutManager::t_getWidget |
|
389 */ |
|
390 void UT_InfoWidgetLayoutManager::t_getWidget() |
|
391 { |
|
392 fillCurrentWidgetsContainer(); |
|
393 |
|
394 QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleUndefined)); |
|
395 QVERIFY(m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleContent)); |
|
396 QVERIFY(!m_layoutManager->getWidget(InfoWidgetLayoutManager::RoleLastEnum)); |
|
397 } |
|
398 |
|
399 /*! |
|
400 UT_InfoWidgetLayoutManager::t_removeWidget |
|
401 */ |
|
402 void UT_InfoWidgetLayoutManager::t_removeWidget() |
|
403 { |
|
404 fillCurrentWidgetsContainer(); |
|
405 |
|
406 m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleUndefined); |
|
407 m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleContent); |
|
408 m_layoutManager->removeWidget(InfoWidgetLayoutManager::RoleLastEnum); |
|
409 |
|
410 QVERIFY(verify()); |
|
411 } |
|
412 |
|
413 |
|
414 /*! |
|
415 UT_InfoWidgetLayoutManager::t_contentWidget |
|
416 */ |
|
417 void UT_InfoWidgetLayoutManager::t_contentWidget() |
|
418 { |
|
419 fillCurrentWidgetsContainer(); |
|
420 |
|
421 QVERIFY(m_layoutManager->contentWidget()); |
|
422 } |
|
423 |
|
424 /*! |
|
425 UT_InfoWidgetLayoutManager::t_reloadWidgets |
|
426 */ |
|
427 void UT_InfoWidgetLayoutManager::t_reloadWidgets() |
|
428 { |
|
429 bool loadResultIw = true; |
|
430 bool loadResultSd = true; |
|
431 |
|
432 QObjectList objectListId; |
|
433 QObjectList objectListSd; |
|
434 |
|
435 EXPECT(HbDocumentLoader::load) |
|
436 .with(KInfoWidgetDocmlFile, loadResultIw) |
|
437 .returns(&objectListId); |
|
438 QVERIFY(!m_layoutManager->reloadWidgets(InfoWidgetLayoutManager::InfoDisplay)); |
|
439 |
|
440 EXPECT(HbDocumentLoader::load) |
|
441 .with(KSettingsDialogDocmlFile, loadResultSd) |
|
442 .returns(&objectListSd); |
|
443 QVERIFY(!m_layoutManager->reloadWidgets(InfoWidgetLayoutManager::SettingsDialog)); |
|
444 |
|
445 QVERIFY(verify()); |
|
446 } |
|
447 |
|
448 /*! |
|
449 UT_InfoWidgetLayoutManager::t_destroyWidgets |
|
450 */ |
|
451 void UT_InfoWidgetLayoutManager::t_destroyWidgets() |
|
452 { |
|
453 m_layoutManager->destroyWidgets(); |
|
454 |
|
455 QGraphicsWidget *widgetInfo = new QGraphicsWidget(); |
|
456 QGraphicsWidget *widgetSettings = new QGraphicsWidget(); |
|
457 m_layoutManager->m_infoDisplayWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetInfo); |
|
458 m_layoutManager->m_settingsDialogWidgets.insert(InfoWidgetLayoutManager::RoleContent, widgetSettings); |
|
459 m_layoutManager->destroyWidgets(); |
|
460 |
|
461 QVERIFY(verify()); |
|
462 } |
|
463 |
|
464 /*! |
|
465 UT_InfoWidgetLayoutManager::t_textFitsToRect |
|
466 */ |
|
467 void UT_InfoWidgetLayoutManager::t_textFitsToRect() |
|
468 { |
|
469 QString text; |
|
470 QFont font; |
|
471 bool fits(false); |
|
472 |
|
473 QRectF testRect; |
|
474 |
|
475 // Currently not possible to use with .pro definition |
|
476 // QFontMetrics to be properly mocked |
|
477 // QT -= gui |
|
478 // Test 1: use valid text and rect to which text fits |
|
479 //text = "testtesttesttest"; |
|
480 //testRect = QRectF(QPointF(0,0), QSizeF(200,100)); |
|
481 //fits = m_layoutManager->textFitsToRect(text, font, testRect); |
|
482 //QVERIFY(fits); |
|
483 |
|
484 QVERIFY(verify()); |
|
485 } |
|
486 |
|
487 |
|
488 |
|
489 /*! |
|
490 UT_InfoWidgetLayoutManager::t_marqueeItems |
|
491 */ |
|
492 void UT_InfoWidgetLayoutManager::t_marqueeItems() |
|
493 { |
|
494 QList<HbMarqueeItem *> items; |
|
495 |
|
496 // Test 1: uninitialized |
|
497 items = m_layoutManager->marqueeItems(); |
|
498 QVERIFY(items.count() == 0); |
|
499 |
|
500 // Test: |
|
501 HbMarqueeItem item1; |
|
502 HbMarqueeItem item2; |
|
503 HbMarqueeItem item3; |
|
504 |
|
505 m_layoutManager->m_widgets.insert(InfoWidgetLayoutManager::RoleSpnMarqueeItem, &item1); |
|
506 m_layoutManager->m_widgets.insert(InfoWidgetLayoutManager::RoleMcnMarqueeItem, &item2); |
|
507 m_layoutManager->m_widgets.insert(InfoWidgetLayoutManager::RoleSatMarqueeItem, &item3); |
|
508 |
|
509 items = m_layoutManager->marqueeItems(); |
|
510 QVERIFY(items.count() == 3); |
|
511 |
|
512 QVERIFY(verify()); |
|
513 } |
|
514 |
|
515 |
|
516 /*! |
|
517 UT_InfoWidgetLayoutManager::t_createObject |
|
518 */ |
|
519 void UT_InfoWidgetLayoutManager::t_createObject() |
|
520 { |
|
521 QObject *object = m_documentLoader->createObject(QString(), QString()); |
|
522 QVERIFY(!object); |
|
523 object = m_documentLoader->createObject(KMargueeItemClassName, QString()); |
|
524 QVERIFY(object); |
|
525 delete object; |
|
526 |
|
527 //For destructor coverage |
|
528 delete m_layoutManager->m_documentLoader; |
|
529 m_layoutManager->m_documentLoader = NULL; |
|
530 } |
|
531 |
|
532 QTEST_MAIN_S60(UT_InfoWidgetLayoutManager) |