phoneapp/phoneuiqtviewadapter/tsrc/ut_phonenotecontroller/unit_tests.cpp
changeset 56 5bcb308bd24d
parent 45 6b911d05207e
child 65 2a5d4ab426d3
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
   119 void TestPhoneNoteController::testShowGlobalInfoNoteWithResourceId ()
   119 void TestPhoneNoteController::testShowGlobalInfoNoteWithResourceId ()
   120 {
   120 {
   121     TPhoneCmdParamGlobalNote globalNoteParam;
   121     TPhoneCmdParamGlobalNote globalNoteParam;
   122     globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   122     globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   123     globalNoteParam.SetWaitForReady(EFalse);
   123     globalNoteParam.SetWaitForReady(EFalse);
   124     globalNoteParam.SetType( EAknGlobalInformationNote );
   124     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   125     
   125     
   126     m_noteController->showGlobalNote(&globalNoteParam);
   126     m_noteController->showGlobalNote(&globalNoteParam);
   127     
   127     
   128     QTest::qWait(5000);
   128     QTest::qWait(5000);
   129 }
   129 }
   130 
   130 
   131 void TestPhoneNoteController::testShowGlobalWarningNoteWithText ()
   131 void TestPhoneNoteController::testShowGlobalWarningNoteWithText ()
   132 {
   132 {
   133     TPhoneCmdParamGlobalNote globalNoteParam;
   133     TPhoneCmdParamGlobalNote globalNoteParam;
   134     globalNoteParam.SetWaitForReady(ETrue);
   134     globalNoteParam.SetWaitForReady(ETrue);
   135     globalNoteParam.SetType( EAknGlobalWarningNote );
   135     globalNoteParam.SetType( EPhoneMessageBoxWarning );
   136     globalNoteParam.SetText(_L("Test note 1"));
   136     globalNoteParam.SetText(_L("Test note 1"));
   137     
   137     
   138     m_noteController->showGlobalNote(&globalNoteParam);
   138     m_noteController->showGlobalNote(&globalNoteParam);
   139 }
   139 }
   140 
   140 
   141 void TestPhoneNoteController::testShowGlobalNoteWithTextAndResourceId ()
   141 void TestPhoneNoteController::testShowGlobalNoteWithTextAndResourceId ()
   142 {
   142 {
   143     TPhoneCmdParamGlobalNote globalNoteParam;
   143     TPhoneCmdParamGlobalNote globalNoteParam;
   144     globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
   144     globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
   145     globalNoteParam.SetWaitForReady(EFalse);
   145     globalNoteParam.SetWaitForReady(EFalse);
   146     globalNoteParam.SetType( EAknGlobalInformationNote );
   146     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   147     globalNoteParam.SetText(_L("Test number"));
   147     globalNoteParam.SetText(_L("Test number"));
   148     
   148     
   149     m_noteController->showGlobalNote(&globalNoteParam);
   149     m_noteController->showGlobalNote(&globalNoteParam);
   150     
   150     
   151     QTest::qWait(5000);
   151     QTest::qWait(5000);
   154 void TestPhoneNoteController::testShowGlobalNoteTwoTimes ()
   154 void TestPhoneNoteController::testShowGlobalNoteTwoTimes ()
   155 {
   155 {
   156     TPhoneCmdParamGlobalNote globalNoteParam;
   156     TPhoneCmdParamGlobalNote globalNoteParam;
   157     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   157     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   158     globalNoteParam.SetWaitForReady(EFalse);
   158     globalNoteParam.SetWaitForReady(EFalse);
   159     globalNoteParam.SetType( EAknGlobalInformationNote );
   159     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   160     globalNoteParam.SetText(_L("Test note 2"));
   160     globalNoteParam.SetText(_L("Test note 2"));
   161     
   161     
   162     m_noteController->showGlobalNote(&globalNoteParam);
   162     m_noteController->showGlobalNote(&globalNoteParam);
   163     
   163     
   164     globalNoteParam.SetText(_L("Test note 3"));
   164     globalNoteParam.SetText(_L("Test note 3"));
   172 void TestPhoneNoteController::testShowGlobalNoteThreeTimes ()
   172 void TestPhoneNoteController::testShowGlobalNoteThreeTimes ()
   173 {
   173 {
   174     TPhoneCmdParamGlobalNote globalNoteParam;
   174     TPhoneCmdParamGlobalNote globalNoteParam;
   175     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   175     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   176     globalNoteParam.SetWaitForReady(EFalse);
   176     globalNoteParam.SetWaitForReady(EFalse);
   177     globalNoteParam.SetType( EAknGlobalInformationNote );
   177     globalNoteParam.SetType( EPhoneMessageBoxInformation );
   178     globalNoteParam.SetText(_L("Test note 4"));
   178     globalNoteParam.SetText(_L("Test note 4"));
   179     
   179     
   180     m_noteController->showGlobalNote(&globalNoteParam);
   180     m_noteController->showGlobalNote(&globalNoteParam);
   181     
   181     
   182     globalNoteParam.SetText(_L("Test note 5"));
   182     globalNoteParam.SetText(_L("Test note 5"));
   284 void TestPhoneNoteController::testShowIndicationDialogWithResourceId ()
   284 void TestPhoneNoteController::testShowIndicationDialogWithResourceId ()
   285 {
   285 {
   286     TPhoneCmdParamGlobalNote globalNoteParam;
   286     TPhoneCmdParamGlobalNote globalNoteParam;
   287     globalNoteParam.SetNotificationDialog( ETrue );
   287     globalNoteParam.SetNotificationDialog( ETrue );
   288     globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   288     globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   289     globalNoteParam.SetType( EAknGlobalInformationNote );
   289     globalNoteParam.SetType( EPhoneNotificationDialog );
   290     
   290     
   291     m_noteController->showGlobalNote(&globalNoteParam);
   291     m_noteController->showGlobalNote(&globalNoteParam);
   292     
   292     
   293     QTest::qWait(5000);
   293     QTest::qWait(5000);
   294 }
   294 }
   306 void TestPhoneNoteController::testShowIndicationDialogTextAndResourceId ()
   306 void TestPhoneNoteController::testShowIndicationDialogTextAndResourceId ()
   307 {
   307 {
   308     TPhoneCmdParamGlobalNote globalNoteParam;
   308     TPhoneCmdParamGlobalNote globalNoteParam;
   309     globalNoteParam.SetNotificationDialog( ETrue );
   309     globalNoteParam.SetNotificationDialog( ETrue );
   310     globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
   310     globalNoteParam.SetTextResourceId(R_PHONE_TEXT_COLP_CONNECTED);
   311     globalNoteParam.SetType( EAknGlobalInformationNote );
   311     globalNoteParam.SetType( EPhoneNotificationDialog );
   312     globalNoteParam.SetText(_L("Indication number"));
   312     globalNoteParam.SetText(_L("Indication number"));
   313     globalNoteParam.SetTimeout(1000);
   313     globalNoteParam.SetTimeout(1000);
   314     
   314     
   315     m_noteController->showGlobalNote(&globalNoteParam);
   315     m_noteController->showGlobalNote(&globalNoteParam);
   316     
   316     
   320 void TestPhoneNoteController::testShowIndicationDialogTwoTimes ()
   320 void TestPhoneNoteController::testShowIndicationDialogTwoTimes ()
   321 {
   321 {
   322     TPhoneCmdParamGlobalNote globalNoteParam;
   322     TPhoneCmdParamGlobalNote globalNoteParam;
   323     globalNoteParam.SetNotificationDialog( ETrue );
   323     globalNoteParam.SetNotificationDialog( ETrue );
   324     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   324     //globalNoteParam.SetTextResourceId(R_NOTETEXT_NO_ANSWER);
   325     globalNoteParam.SetType( EAknGlobalInformationNote );
   325     globalNoteParam.SetType( EPhoneNotificationDialog );
   326     globalNoteParam.SetText(_L("Test indication 2"));
   326     globalNoteParam.SetText(_L("Test indication 2"));
   327     
   327     
   328     m_noteController->showGlobalNote(&globalNoteParam);
   328     m_noteController->showGlobalNote(&globalNoteParam);
   329     
   329     
   330     globalNoteParam.SetText(_L("Test indication 3"));
   330     globalNoteParam.SetText(_L("Test indication 3"));
   337 
   337 
   338 void TestPhoneNoteController::testShowIndicationDialogThreeTimes ()
   338 void TestPhoneNoteController::testShowIndicationDialogThreeTimes ()
   339 {
   339 {
   340     TPhoneCmdParamGlobalNote globalNoteParam;
   340     TPhoneCmdParamGlobalNote globalNoteParam;
   341     globalNoteParam.SetNotificationDialog( ETrue );
   341     globalNoteParam.SetNotificationDialog( ETrue );
   342     globalNoteParam.SetType( EAknGlobalInformationNote );
   342     globalNoteParam.SetType( EPhoneNotificationDialog );
   343     globalNoteParam.SetText(_L("Test indication 4"));
   343     globalNoteParam.SetText(_L("Test indication 4"));
   344     
   344     
   345     m_noteController->showGlobalNote(&globalNoteParam);
   345     m_noteController->showGlobalNote(&globalNoteParam);
   346     
   346     
   347     globalNoteParam.SetText(_L("Test indication 5"));
   347     globalNoteParam.SetText(_L("Test indication 5"));