phoneuis/bubblemanager2/tsrc/unit/ut_bubbleimagewidget/ut_bubbleimagewidget.cpp
changeset 45 6b911d05207e
parent 37 ba76fc04e6c2
child 46 bc5a64e5bc3c
equal deleted inserted replaced
37:ba76fc04e6c2 45:6b911d05207e
    38     void cleanupTestCase();
    38     void cleanupTestCase();
    39 
    39 
    40     void testPixmap();
    40     void testPixmap();
    41     void testWidePixmap();
    41     void testWidePixmap();
    42     void testDefaultAvatar();
    42     void testDefaultAvatar();
       
    43 
       
    44     void testSetKeepSquareShape();
    43 
    45 
    44 private:
    46 private:
    45     QString fileNameWithPath(const QString& fileName);    
    47     QString fileNameWithPath(const QString& fileName);    
    46 
    48 
    47 private:
    49 private:
   100     mImage->show();
   102     mImage->show();
   101     QTest::qWait(500);
   103     QTest::qWait(500);
   102     // there is now way to verify using public API
   104     // there is now way to verify using public API
   103 }
   105 }
   104 
   106 
       
   107 void ut_BubbleImageWidget::testSetKeepSquareShape()
       
   108 {
       
   109     mImage->setKeepSquareShape(true);
       
   110     QVERIFY(mImage->keepSquareShape()==true);
       
   111     QVERIFY(mImage->sizePolicy().verticalPolicy()==QSizePolicy::Expanding);
       
   112     QVERIFY(mImage->sizePolicy().horizontalPolicy()==QSizePolicy::Fixed);
       
   113     mImage->setKeepSquareShape(false);
       
   114     QVERIFY(mImage->keepSquareShape()==false);
       
   115     QVERIFY(mImage->sizePolicy().verticalPolicy()==QSizePolicy::Expanding);
       
   116     QVERIFY(mImage->sizePolicy().horizontalPolicy()==QSizePolicy::Expanding);
       
   117 }
       
   118 
   105 BUBBLE_TEST_MAIN(ut_BubbleImageWidget)
   119 BUBBLE_TEST_MAIN(ut_BubbleImageWidget)
   106 #include "ut_bubbleimagewidget.moc"
   120 #include "ut_bubbleimagewidget.moc"