phoneuis/bubblemanager2/tsrc/unit/ut_bubbleparticipantlistitem/ut_bubbleparticipantlistitem.cpp
changeset 30 ebdbd102c78a
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
equal deleted inserted replaced
27:2f8f8080a020 30:ebdbd102c78a
    25 #include <hbinstance.h>
    25 #include <hbinstance.h>
    26 #include <hbstyle.h>
    26 #include <hbstyle.h>
    27 
    27 
    28 #include "bubbletest.h"
    28 #include "bubbletest.h"
    29 #include "bubbleparticipantlistitem.h"
    29 #include "bubbleparticipantlistitem.h"
    30 #include "bubblebuttonstyle.h"
       
    31 
    30 
    32 class ut_BubbleParticipantListItem : public QObject
    31 class ut_BubbleParticipantListItem : public QObject
    33 {
    32 {
    34     Q_OBJECT
    33     Q_OBJECT
    35 
    34 
    41     void testUpdateChildItems();
    40     void testUpdateChildItems();
    42 
    41 
    43 private:
    42 private:
    44     BubbleParticipantListItem* mItem;
    43     BubbleParticipantListItem* mItem;
    45     HbMainWindow* mMainWindow;
    44     HbMainWindow* mMainWindow;
    46     BubbleButtonStyle* mButtonStyle;
       
    47     int mStyleBaseId;
    45     int mStyleBaseId;
    48 };
    46 };
    49 
    47 
    50 void ut_BubbleParticipantListItem::initTestCase()
    48 void ut_BubbleParticipantListItem::initTestCase()
    51 {
    49 {
    52     mMainWindow = new HbMainWindow();
    50     mMainWindow = new HbMainWindow();
    53     mButtonStyle = new BubbleButtonStyle();
    51     mItem = new BubbleParticipantListItem();
    54     mItem = new BubbleParticipantListItem(BUBBLE_STYLE_PLUGIN,*mButtonStyle);
       
    55     mMainWindow->addView(mItem);
    52     mMainWindow->addView(mItem);
    56     HbListViewItem* item = static_cast<HbListViewItem*>(mItem);
    53     BubbleParticipantListItem* item =
       
    54         static_cast<BubbleParticipantListItem*>(mItem);
    57     item->updateChildItems();
    55     item->updateChildItems();
    58     mMainWindow->show();
    56     mMainWindow->show();
    59 }
    57 }
    60 
    58 
    61 void ut_BubbleParticipantListItem::cleanupTestCase()
    59 void ut_BubbleParticipantListItem::cleanupTestCase()
    62 {
    60 {
    63     mItem->clearActions();
    61     mItem->clearActions();
    64     delete mMainWindow;
    62     delete mMainWindow;
    65     delete mButtonStyle;
       
    66 }
    63 }
    67 
    64 
    68 void ut_BubbleParticipantListItem::testCreateItem()
    65 void ut_BubbleParticipantListItem::testCreateItem()
    69 {
    66 {
    70     HbAbstractViewItem* item = mItem->createItem();
    67     HbAbstractViewItem* item = mItem->createItem();