phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 30 ebdbd102c78a
parent 45 6b911d05207e
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
    64     void testShowGlobalNoteTwoTimes ();
    64     void testShowGlobalNoteTwoTimes ();
    65     void testShowGlobalNoteThreeTimes ();
    65     void testShowGlobalNoteThreeTimes ();
    66     void testShowNote();
    66     void testShowNote();
    67     void testShowQuery();
    67     void testShowQuery();
    68     void testShowClobalWaitNote();
    68     void testShowClobalWaitNote();
    69 
    69     void testShowIndicationDialogDefault ();
       
    70     void testShowIndicationDialogWithResourceId ();
       
    71     void testShowIndicationDialogWithText ();
       
    72     void testShowIndicationDialogTextAndResourceId ();
       
    73     void testShowIndicationDialogTwoTimes ();
       
    74     void testShowIndicationDialogThreeTimes ();
    70     
    75     
    71 private:
    76 private:
    72     PhoneNoteController *m_noteController; // class under test
    77     PhoneNoteController *m_noteController; // class under test
    73 };
    78 };
    74 
    79 
   180     
   185     
   181     globalNoteParam.SetText(_L("Test note 6"));
   186     globalNoteParam.SetText(_L("Test note 6"));
   182     
   187     
   183     m_noteController->showGlobalNote(&globalNoteParam);
   188     m_noteController->showGlobalNote(&globalNoteParam);
   184     
   189     
   185     QTest::qWait(20000);
   190     QTest::qWait(5000);
   186 }
   191 }
   187 
   192 
   188 void TestPhoneNoteController::testShowNote()
   193 void TestPhoneNoteController::testShowNote()
   189 {
   194 {
   190     TPhoneCmdParamNote noteParam;
   195     TPhoneCmdParamNote noteParam;
   198     
   203     
   199     noteParam.SetResourceId(R_PHONEUI_SENDING_DTMF_WAIT_NOTE);
   204     noteParam.SetResourceId(R_PHONEUI_SENDING_DTMF_WAIT_NOTE);
   200     noteParam.SetText(_L("Sending:\n123p456"));
   205     noteParam.SetText(_L("Sending:\n123p456"));
   201     
   206     
   202     m_noteController->showNote(&noteParam);
   207     m_noteController->showNote(&noteParam);
   203     QTest::qWait(20000);
   208     QTest::qWait(5000);
   204     
   209     
   205     noteParam.SetText(_L("Sending:\n123p456"));
   210     noteParam.SetText(_L("Sending:\n123p456"));
   206     m_noteController->showNote(&noteParam);
   211     m_noteController->showNote(&noteParam);
   207     
   212     
   208     QTest::qWait(20000);
   213     QTest::qWait(5000);
   209     
   214     
   210     m_noteController->removeNote();
   215     m_noteController->removeNote();
   211     
   216     
   212     QTest::qWait(20000);
   217     QTest::qWait(5000);
   213 }
   218 }
   214 
   219 
   215 void TestPhoneNoteController::testShowQuery()
   220 void TestPhoneNoteController::testShowQuery()
   216 {
   221 {
   217     TPhoneCmdParamQuery queryParam;    
   222     TPhoneCmdParamQuery queryParam;    
   225     m_noteController->removeQuery();
   230     m_noteController->removeQuery();
   226 
   231 
   227     queryParam.SetQueryResourceId(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY);
   232     queryParam.SetQueryResourceId(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY);
   228     m_noteController->showQuery(&queryParam);
   233     m_noteController->showQuery(&queryParam);
   229     
   234     
   230     QTest::qWait(20000);
   235     QTest::qWait(5000);
   231     m_noteController->showQuery(&queryParam);
   236     m_noteController->showQuery(&queryParam);
   232     
   237     
   233     m_noteController->removeQuery();
   238     m_noteController->removeQuery();
   234     
   239     
   235     QTest::qWait(20000);
   240     QTest::qWait(5000);
   236 }
   241 }
   237 
   242 
   238 void TestPhoneNoteController::testShowClobalWaitNote()
   243 void TestPhoneNoteController::testShowClobalWaitNote()
   239 {
   244 {
   240     TPhoneCmdParamQuery queryParam;    
   245     TPhoneCmdParamQuery queryParam;    
   254     queryParam.SetQueryPrompt(KNullDesC);
   259     queryParam.SetQueryPrompt(KNullDesC);
   255     TBuf<4> buf(_L("test"));
   260     TBuf<4> buf(_L("test"));
   256     queryParam.SetDataText(&buf);
   261     queryParam.SetDataText(&buf);
   257     queryParam.SetTimeOut(2000);
   262     queryParam.SetTimeOut(2000);
   258     m_noteController->showQuery(&queryParam);
   263     m_noteController->showQuery(&queryParam);
   259     QTest::qWait(10000);
   264     QTest::qWait(5000);
   260      
   265      
   261     queryParam.SetCustomCommandForTimeOut(10);
   266     queryParam.SetCustomCommandForTimeOut(10);
   262     m_noteController->showQuery(&queryParam);
   267     m_noteController->showQuery(&queryParam);
   263     QTest::qWait(10000);
   268     QTest::qWait(5000);
       
   269 }
       
   270 
       
   271 void TestPhoneNoteController::testShowIndicationDialogDefault ()
       
   272 {
       
   273     TPhoneCmdParamGlobalNote globalNoteParam;
       
   274     globalNoteParam.SetNotificationDialog( ETrue );
       
   275     globalNoteParam.SetTimeout(0);
       
   276     m_noteController->showGlobalNote(&globalNoteParam);
       
   277     QTest::qWait(2500);
       
   278     
       
   279     globalNoteParam.SetTimeout(KPhoneNoteNoTimeout);
       
   280     m_noteController->showGlobalNote(&globalNoteParam);
       
   281     QTest::qWait(2500);
       
   282 }
       
   283 
       
   284 void TestPhoneNoteController::testShowIndicationDialogWithResourceId ()
       
   285 {
       
   286     TPhoneCmdParamGlobalNote globalNoteParam;
       
   287     globalNoteParam.SetNotificationDialog( ETrue );
       
   288     globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
       
   289     globalNoteParam.SetType( EAknGlobalInformationNote );
       
   290     
       
   291     m_noteController->showGlobalNote(&globalNoteParam);
       
   292     
       
   293     QTest::qWait(5000);
       
   294 }
       
   295 
       
   296 void TestPhoneNoteController::testShowIndicationDialogWithText ()
       
   297 {
       
   298     TPhoneCmdParamGlobalNote globalNoteParam;
       
   299     globalNoteParam.SetNotificationDialog( ETrue );
       
   300     globalNoteParam.SetType( EAknGlobalWarningNote );
       
   301     globalNoteParam.SetText(_L("Test indication 1"));
       
   302     
       
   303     m_noteController->showGlobalNote(&globalNoteParam);
       
   304 }
       
   305 
       
   306 void TestPhoneNoteController::testShowIndicationDialogTextAndResourceId ()
       
   307 {
       
   308     TPhoneCmdParamGlobalNote globalNoteParam;
       
   309     globalNoteParam.SetNotificationDialog( ETrue );
       
   310     globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
       
   311     globalNoteParam.SetType( EAknGlobalInformationNote );
       
   312     globalNoteParam.SetText(_L("Indication number"));
       
   313     globalNoteParam.SetTimeout(1000);
       
   314     
       
   315     m_noteController->showGlobalNote(&globalNoteParam);
       
   316     
       
   317     QTest::qWait(2000);
       
   318 }
       
   319 
       
   320 void TestPhoneNoteController::testShowIndicationDialogTwoTimes ()
       
   321 {
       
   322     TPhoneCmdParamGlobalNote globalNoteParam;
       
   323     globalNoteParam.SetNotificationDialog( ETrue );
       
   324     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
       
   325     globalNoteParam.SetType( EAknGlobalInformationNote );
       
   326     globalNoteParam.SetText(_L("Test indication 2"));
       
   327     
       
   328     m_noteController->showGlobalNote(&globalNoteParam);
       
   329     
       
   330     globalNoteParam.SetText(_L("Test indication 3"));
       
   331     
       
   332     m_noteController->showGlobalNote(&globalNoteParam);
       
   333     
       
   334     QTest::qWait(5000);
       
   335 
       
   336 }
       
   337 
       
   338 void TestPhoneNoteController::testShowIndicationDialogThreeTimes ()
       
   339 {
       
   340     TPhoneCmdParamGlobalNote globalNoteParam;
       
   341     globalNoteParam.SetNotificationDialog( ETrue );
       
   342     globalNoteParam.SetType( EAknGlobalInformationNote );
       
   343     globalNoteParam.SetText(_L("Test indication 4"));
       
   344     
       
   345     m_noteController->showGlobalNote(&globalNoteParam);
       
   346     
       
   347     globalNoteParam.SetText(_L("Test indication 5"));
       
   348     
       
   349     globalNoteParam.SetTimeout(1000);
       
   350     m_noteController->showGlobalNote(&globalNoteParam);
       
   351     
       
   352     globalNoteParam.SetText(_L("Test indication 6"));
       
   353     
       
   354     m_noteController->showGlobalNote(&globalNoteParam);
       
   355     
       
   356     QTest::qWait(20000);
   264 }
   357 }
   265 
   358 
   266 PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestPhoneNoteController)
   359 PHONE_QT_NOTE_CONTROLLER_TEST_MAIN(TestPhoneNoteController)
   267 #include "unit_tests.moc"
   360 #include "unit_tests.moc"