equal
deleted
inserted
replaced
45 static const int KMINVOLUME = 0; |
45 static const int KMINVOLUME = 0; |
46 static const int KVOLUMECOMMAND = 5; |
46 static const int KVOLUMECOMMAND = 5; |
47 |
47 |
48 bool m_qtimer_stop_called; |
48 bool m_qtimer_stop_called; |
49 QString m_networkName; |
49 QString m_networkName; |
|
50 bool m_take_menu_called; |
|
51 bool m_set_menu_called; |
50 |
52 |
51 #define PHONE_QT_VIEW_TEST_MAIN(TestObject) \ |
53 #define PHONE_QT_VIEW_TEST_MAIN(TestObject) \ |
52 int main(int argc, char *argv[]) \ |
54 int main(int argc, char *argv[]) \ |
53 { \ |
55 { \ |
54 HbApplication app(argc, argv); \ |
56 HbApplication app(argc, argv); \ |
98 void testLongEndKeyPressEventOutsideTelephony(); |
100 void testLongEndKeyPressEventOutsideTelephony(); |
99 void testNetworkNameChanged(); |
101 void testNetworkNameChanged(); |
100 void testCaptureKey(); |
102 void testCaptureKey(); |
101 void testRestrictedMode(); |
103 void testRestrictedMode(); |
102 |
104 |
|
105 |
103 private: |
106 private: |
104 int createCallHeader(); |
107 int createCallHeader(); |
105 |
108 |
106 private: |
109 private: |
107 PhoneUIQtView *m_view; // class under test |
110 PhoneUIQtView *m_view; // class under test |
135 } |
138 } |
136 |
139 |
137 void TestPhoneUIQtView::init () |
140 void TestPhoneUIQtView::init () |
138 { |
141 { |
139 m_qtimer_stop_called = false; |
142 m_qtimer_stop_called = false; |
|
143 m_take_menu_called = false; |
|
144 m_set_menu_called = false; |
140 } |
145 } |
141 |
146 |
142 void TestPhoneUIQtView::cleanup () |
147 void TestPhoneUIQtView::cleanup () |
143 { |
148 { |
144 } |
149 } |
376 void TestPhoneUIQtView::testSetMenuActions() |
381 void TestPhoneUIQtView::testSetMenuActions() |
377 { |
382 { |
378 QList<PhoneAction*> actions; |
383 QList<PhoneAction*> actions; |
379 m_view->setMenuActions(actions); |
384 m_view->setMenuActions(actions); |
380 |
385 |
|
386 QVERIFY(m_take_menu_called); |
|
387 |
381 PhoneAction* phoneAction = new PhoneAction; |
388 PhoneAction* phoneAction = new PhoneAction; |
382 phoneAction->setText(QString("test")); |
389 phoneAction->setText(QString("test")); |
383 phoneAction->setCommand(1); |
390 phoneAction->setCommand(1); |
384 actions.append(phoneAction); |
391 actions.append(phoneAction); |
385 |
392 |
386 m_view->setMenuActions(actions); |
393 m_view->setMenuActions(actions); |
387 qDeleteAll(actions); |
394 qDeleteAll(actions); |
388 actions.clear(); |
395 actions.clear(); |
389 |
396 |
|
397 m_take_menu_called = false; |
390 m_view->setMenuActions(actions); |
398 m_view->setMenuActions(actions); |
|
399 QVERIFY(m_take_menu_called); |
391 } |
400 } |
392 |
401 |
393 //Private methods |
402 //Private methods |
394 int TestPhoneUIQtView::createCallHeader () |
403 int TestPhoneUIQtView::createCallHeader () |
395 { |
404 { |
473 QCOMPARE(upSpy.count(), 2); |
482 QCOMPARE(upSpy.count(), 2); |
474 QCOMPARE(m_view->m_dialpad->isCallButtonEnabled(), true); |
483 QCOMPARE(m_view->m_dialpad->isCallButtonEnabled(), true); |
475 QCOMPARE(m_view->m_backAction->isEnabled(), true); |
484 QCOMPARE(m_view->m_backAction->isEnabled(), true); |
476 } |
485 } |
477 |
486 |
|
487 HbMenu * HbView::takeMenu() |
|
488 { |
|
489 m_take_menu_called = true; |
|
490 return 0; |
|
491 } |
|
492 |
|
493 void HbView::setMenu(HbMenu* menu) |
|
494 { |
|
495 m_set_menu_called = true; |
|
496 } |
|
497 |
478 void HbView::setTitle (const QString &title) |
498 void HbView::setTitle (const QString &title) |
479 { |
499 { |
480 m_networkName = title; |
500 m_networkName = title; |
481 } |
501 } |
482 |
502 |