telutils/dialpad/tsrc/unit/ut_dialpadkeyhandler/ut_dialpadkeyhandler.cpp
changeset 45 61f927bc9441
parent 39 cee7e9e0906c
equal deleted inserted replaced
39:cee7e9e0906c 45:61f927bc9441
    80 }
    80 }
    81 
    81 
    82 
    82 
    83 void UT_DialpadKeyHandler::t_constructionWithAllFilters()
    83 void UT_DialpadKeyHandler::t_constructionWithAllFilters()
    84 {
    84 {
    85     EXPECT(QObject::installEventFilter).times(5);
    85     EXPECT(QObject, installEventFilter).times(5);
    86     EXPECT(QObject::removeEventFilter).times(5);
    86     EXPECT(QObject, removeEventFilter).times(5);
    87     
    87     
    88     DialpadKeyHandler::DialpadKeyEventFilters filters(
    88     DialpadKeyHandler::DialpadKeyEventFilters filters(
    89         DialpadKeyHandler::VoiceMailbox |
    89         DialpadKeyHandler::VoiceMailbox |
    90         DialpadKeyHandler::VideoMailBox |
    90         DialpadKeyHandler::VideoMailBox |
    91         DialpadKeyHandler::Bluetooth |
    91         DialpadKeyHandler::Bluetooth |
   101 }
   101 }
   102 
   102 
   103 
   103 
   104 void UT_DialpadKeyHandler::t_constructionWithNoFilters()
   104 void UT_DialpadKeyHandler::t_constructionWithNoFilters()
   105 {
   105 {
   106     EXPECT(QObject::installEventFilter).times(0);
   106     EXPECT(QObject, installEventFilter).times(0);
   107     
   107     
   108     DialpadKeyHandler::DialpadKeyEventFilters filters;
   108     DialpadKeyHandler::DialpadKeyEventFilters filters;
   109     m_keyHandler = new DialpadKeyHandler(m_dialPad, filters, this);
   109     m_keyHandler = new DialpadKeyHandler(m_dialPad, filters, this);
   110     
   110     
   111     QVERIFY(verify());
   111     QVERIFY(verify());
   113 
   113 
   114 
   114 
   115 void UT_DialpadKeyHandler::t_deprecatedConstructionWithVideoMailbox()
   115 void UT_DialpadKeyHandler::t_deprecatedConstructionWithVideoMailbox()
   116 {
   116 {
   117 #ifdef Q_OS_SYMBIAN
   117 #ifdef Q_OS_SYMBIAN
   118     EXPECT(FeatureManager::FeatureSupported).returns(true);
   118     EXPECT(FeatureManager, FeatureSupported).returns(true);
   119     EXPECT(QObject::installEventFilter).times(4);
   119     EXPECT(QObject, installEventFilter).times(4);
   120     
   120     
   121     HbMainWindow *dummyWindow = 0;
   121     HbMainWindow *dummyWindow = 0;
   122     m_keyHandler = new DialpadKeyHandler(m_dialPad, *dummyWindow, this);
   122     m_keyHandler = new DialpadKeyHandler(m_dialPad, *dummyWindow, this);
   123     
   123     
   124     QVERIFY(verify());
   124     QVERIFY(verify());
   126 }
   126 }
   127 
   127 
   128 
   128 
   129 void UT_DialpadKeyHandler::t_deprecatedConstructionWithoutVideoMailbox()
   129 void UT_DialpadKeyHandler::t_deprecatedConstructionWithoutVideoMailbox()
   130 {
   130 {
   131     EXPECT(FeatureManager::FeatureSupported).returns(false);
   131     EXPECT(FeatureManager, FeatureSupported).returns(false);
   132     EXPECT(QObject::installEventFilter).times(3);
   132     EXPECT(QObject, installEventFilter).times(3);
   133     
   133     
   134     HbMainWindow *dummyWindow = 0;
   134     HbMainWindow *dummyWindow = 0;
   135     m_keyHandler = new DialpadKeyHandler(m_dialPad, *dummyWindow, this);
   135     m_keyHandler = new DialpadKeyHandler(m_dialPad, *dummyWindow, this);
   136     
   136     
   137     QVERIFY(verify());
   137     QVERIFY(verify());