50 void testText3(); |
50 void testText3(); |
51 void testCallStatusIcon(); |
51 void testCallStatusIcon(); |
52 void testVideoCallStatusIcon(); |
52 void testVideoCallStatusIcon(); |
53 void testVoipCallStatusIcon(); |
53 void testVoipCallStatusIcon(); |
54 void testNumberTypeIcon(); |
54 void testNumberTypeIcon(); |
|
55 void testCipheringIcon(); |
55 |
56 |
56 private: |
57 private: |
57 BubbleStylePlugin* mPlugin; |
58 BubbleStylePlugin* mPluginInstance; |
|
59 HbStyleInterface* mPlugin; |
58 HbWidget* mParent; |
60 HbWidget* mParent; |
59 }; |
61 }; |
60 |
62 |
61 void ut_BubbleStylePlugin::initTestCase() |
63 void ut_BubbleStylePlugin::initTestCase() |
62 { |
64 { |
63 mPlugin = new BubbleStylePlugin(); |
65 mPluginInstance = new BubbleStylePlugin(); |
|
66 mPlugin = static_cast<HbStyleInterface*>(mPluginInstance); |
64 mParent = new HbWidget(); |
67 mParent = new HbWidget(); |
65 } |
68 } |
66 |
69 |
67 void ut_BubbleStylePlugin::cleanupTestCase() |
70 void ut_BubbleStylePlugin::cleanupTestCase() |
68 { |
71 { |
69 delete mPlugin; |
72 delete mPluginInstance; |
70 delete mParent; |
73 delete mParent; |
71 } |
74 } |
72 |
75 |
73 void ut_BubbleStylePlugin::testPrimitiveCount() |
76 void ut_BubbleStylePlugin::testPrimitiveCount() |
74 { |
77 { |
313 option.mCallState = BubbleManagerIF::Incoming; |
316 option.mCallState = BubbleManagerIF::Incoming; |
314 option.mCallFlags |= BubbleManagerIF::Diverted; |
317 option.mCallFlags |= BubbleManagerIF::Diverted; |
315 mPlugin->updatePrimitive( |
318 mPlugin->updatePrimitive( |
316 item, (HbStyle::Primitive)(BP_NumberType_icon), |
319 item, (HbStyle::Primitive)(BP_NumberType_icon), |
317 &option); |
320 &option); |
318 QVERIFY(icon->icon().iconName()==":/resources/qgn_indi_call_diverted.svg"); |
321 QVERIFY(icon->icon().iconName()==":/qgn_indi_call_diverted.svg"); |
319 option.mCallState = BubbleManagerIF::Incoming; |
322 option.mCallState = BubbleManagerIF::Incoming; |
320 option.mCallFlags &= ~BubbleManagerIF::Diverted; |
323 option.mCallFlags &= ~BubbleManagerIF::Diverted; |
321 mPlugin->updatePrimitive( |
324 mPlugin->updatePrimitive( |
322 item, (HbStyle::Primitive)(BP_NumberType_icon), |
325 item, (HbStyle::Primitive)(BP_NumberType_icon), |
323 &option); |
326 &option); |
327 option.mCallState = BubbleManagerIF::Waiting; |
330 option.mCallState = BubbleManagerIF::Waiting; |
328 option.mCallFlags |= BubbleManagerIF::Diverted; |
331 option.mCallFlags |= BubbleManagerIF::Diverted; |
329 mPlugin->updatePrimitive( |
332 mPlugin->updatePrimitive( |
330 item, (HbStyle::Primitive)(BP_NumberType_icon), |
333 item, (HbStyle::Primitive)(BP_NumberType_icon), |
331 &option); |
334 &option); |
332 QVERIFY(icon->icon().iconName()==":/resources/qgn_indi_call_diverted.svg"); |
335 QVERIFY(icon->icon().iconName()==":/qgn_indi_call_diverted.svg"); |
333 option.mCallState = BubbleManagerIF::Waiting; |
336 option.mCallState = BubbleManagerIF::Waiting; |
334 option.mCallFlags &= ~BubbleManagerIF::Diverted; |
337 option.mCallFlags &= ~BubbleManagerIF::Diverted; |
335 mPlugin->updatePrimitive( |
338 mPlugin->updatePrimitive( |
336 item, (HbStyle::Primitive)(BP_NumberType_icon), |
339 item, (HbStyle::Primitive)(BP_NumberType_icon), |
|
340 &option); |
|
341 QVERIFY(icon->icon().iconName()==""); |
|
342 } |
|
343 |
|
344 void ut_BubbleStylePlugin::testCipheringIcon() |
|
345 { |
|
346 QGraphicsItem *item = mPlugin->createPrimitive( |
|
347 (HbStyle::Primitive)(BP_Ciphering_icon),mParent); |
|
348 QVERIFY(item); |
|
349 QVERIFY(item->parentItem()==mParent); |
|
350 |
|
351 HbIconItem* icon = qgraphicsitem_cast<HbIconItem*>(item); |
|
352 QVERIFY(icon); |
|
353 BubbleStyleOption option; |
|
354 option.mCallState = BubbleManagerIF::Active; |
|
355 option.mCallFlags |= BubbleManagerIF::NoCiphering; |
|
356 mPlugin->updatePrimitive( |
|
357 item, (HbStyle::Primitive)(BP_Ciphering_icon), |
|
358 &option); |
|
359 QVERIFY(icon->icon().iconName()=="qtg_mono_ciphering_off"); |
|
360 option.mCallState = BubbleManagerIF::Incoming; |
|
361 option.mCallFlags &= ~BubbleManagerIF::NoCiphering; |
|
362 mPlugin->updatePrimitive( |
|
363 item, (HbStyle::Primitive)(BP_Ciphering_icon), |
337 &option); |
364 &option); |
338 QVERIFY(icon->icon().iconName()==""); |
365 QVERIFY(icon->icon().iconName()==""); |
339 } |
366 } |
340 |
367 |
341 BUBBLE_TEST_MAIN(ut_BubbleStylePlugin) |
368 BUBBLE_TEST_MAIN(ut_BubbleStylePlugin) |