phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp
changeset 76 cfea66083b62
parent 46 bc5a64e5bc3c
child 78 baacf668fe89
--- a/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp	Fri Sep 17 17:09:12 2010 +0300
+++ b/phoneapp/phoneuiview2/tsrc/ut_phoneuiqtview/unit_tests.cpp	Mon Oct 04 16:06:10 2010 +0300
@@ -47,6 +47,8 @@
 
 bool m_qtimer_stop_called;
 QString m_networkName;
+bool m_take_menu_called;
+bool m_set_menu_called;
 
 #define PHONE_QT_VIEW_TEST_MAIN(TestObject) \
 int main(int argc, char *argv[]) \
@@ -100,6 +102,7 @@
     void testCaptureKey();
     void testRestrictedMode();
 
+
 private:
     int createCallHeader();
 
@@ -137,6 +140,8 @@
 void TestPhoneUIQtView::init ()
 {
     m_qtimer_stop_called = false;
+    m_take_menu_called = false;
+    m_set_menu_called = false;
 }
 
 void TestPhoneUIQtView::cleanup ()
@@ -378,6 +383,8 @@
     QList<PhoneAction*> actions;
     m_view->setMenuActions(actions);
     
+    QVERIFY(m_take_menu_called);
+    
     PhoneAction* phoneAction = new PhoneAction; 
     phoneAction->setText(QString("test"));
     phoneAction->setCommand(1);
@@ -387,7 +394,9 @@
     qDeleteAll(actions);
     actions.clear();
     
+    m_take_menu_called = false;
     m_view->setMenuActions(actions);
+    QVERIFY(m_take_menu_called);
 }
 
 //Private methods
@@ -475,6 +484,17 @@
     QCOMPARE(m_view->m_backAction->isEnabled(), true);
 }
 
+HbMenu * HbView::takeMenu()
+{
+    m_take_menu_called = true; 
+    return 0;
+}
+
+void HbView::setMenu(HbMenu* menu)
+{
+    m_set_menu_called = true;
+}
+
 void HbView::setTitle (const QString &title)
 {
     m_networkName = title;