phoneapp/phoneuiqtviewadapter/tsrc/ut_phoneresourceadapter/unit_tests.cpp
changeset 27 2f8f8080a020
parent 22 6bb1b21d2484
child 30 ebdbd102c78a
equal deleted inserted replaced
22:6bb1b21d2484 27:2f8f8080a020
   110     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA);
   110     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA);
   111     QCOMPARE (map.size (), 2);
   111     QCOMPARE (map.size (), 2);
   112     action = map [PhoneAction::ToolbarButton1];
   112     action = map [PhoneAction::ToolbarButton1];
   113     QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
   113     QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
   114     action = map [PhoneAction::ToolbarButton2];
   114     action = map [PhoneAction::ToolbarButton2];
   115     QCOMPARE (action->icon (), HbIcon("qtg_mono_mute"));
   115     QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off"));
   116     QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent);    
   116     QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent);    
   117     
   117     
   118     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA);
   118     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA);
   119     QCOMPARE (map.size (), 2);
   119     QCOMPARE (map.size (), 2);
   120     action = map [PhoneAction::ToolbarButton1];
   120     action = map [PhoneAction::ToolbarButton1];
   127     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA);
   127     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA);
   128     QCOMPARE (map.size (), 2);
   128     QCOMPARE (map.size (), 2);
   129     action = map [PhoneAction::ToolbarButton1];
   129     action = map [PhoneAction::ToolbarButton1];
   130     QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
   130     QCOMPARE (action->icon (), HbIcon("qtg_mono_send"));    
   131     action = map [PhoneAction::ToolbarButton2];
   131     action = map [PhoneAction::ToolbarButton2];
   132     QCOMPARE (action->icon (), HbIcon("qtg_mono_mute"));
   132     QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker_off"));
   133     //Command is disabled
   133     //Command is disabled
   134     //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); 
   134     //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); 
   135 
   135 
   136     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_CALLWAITING_CBA);
   136     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_CALLWAITING_CBA);
   137     QCOMPARE (map.size (), 2);
   137     QCOMPARE (map.size (), 2);
   212     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_EMERGENCY_CBA);
   212     map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_EMERGENCY_CBA);
   213     QCOMPARE (map.size (), 2);
   213     QCOMPARE (map.size (), 2);
   214     action = map [PhoneAction::ToolbarButton1];
   214     action = map [PhoneAction::ToolbarButton1];
   215     QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   215     QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   216     action = map [PhoneAction::ToolbarButton2];
   216     action = map [PhoneAction::ToolbarButton2];
   217     QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker"));
   217     QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
   218     QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
   218     QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
   219     
   219     
   220     map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL);
   220     map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL);
   221     QCOMPARE (map.size (), 1);
   221     QCOMPARE (map.size (), 1);
   222     action = map [PhoneAction::Text];
   222     action = map [PhoneAction::Text];
   275     QVERIFY( false == testString10.isEmpty() );
   275     QVERIFY( false == testString10.isEmpty() );
   276     
   276     
   277     QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); 
   277     QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); 
   278     QVERIFY( false == testString11.isEmpty() );
   278     QVERIFY( false == testString11.isEmpty() );
   279     
   279     
   280     QString testString12 = m_resourceAdapter->convertToString(0); 
   280     QString testString12 = m_resourceAdapter->convertToString(R_PHONE_ERROR_EMERGENCY_CALLS_ONLY); 
   281     QCOMPARE( testString12, QString ("") );
   281     QVERIFY( false == testString12.isEmpty() );
       
   282     
       
   283     QString testString13 = m_resourceAdapter->convertToString(R_NOTETEXT_NUMBER_NOT_IN_USE); 
       
   284     QVERIFY( false == testString13.isEmpty() );
       
   285     
       
   286     QString testString14 = m_resourceAdapter->convertToString(R_NOTETEXT_NETWORK_BUSY); 
       
   287     QVERIFY( false == testString14.isEmpty() );
       
   288     
       
   289     QString testString15 = m_resourceAdapter->convertToString(R_NOTETEXT_ERROR_IN_CONNECTION); 
       
   290     QVERIFY( false == testString15.isEmpty() );
       
   291     
       
   292     QString testString16 = m_resourceAdapter->convertToString(R_PHONEUI_ERROR_EMERGENCY_ATTEMPT_FAILED); 
       
   293     QVERIFY( false == testString16.isEmpty() );   
       
   294     
       
   295     QString testString17 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_TRANSFERRED_TEXT); 
       
   296     QVERIFY( false == testString17.isEmpty() );    
       
   297  
       
   298     QString testString18 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NO_SERVICE); 
       
   299     QVERIFY( false == testString18.isEmpty() ); 
       
   300     
       
   301     QString testString99 = m_resourceAdapter->convertToString(0); 
       
   302     QCOMPARE( testString99, QString ("") );
   282 }
   303 }
   283 
   304 
   284 void TestPhoneResourceAdapter::testConvertToString2 ()
   305 void TestPhoneResourceAdapter::testConvertToString2 ()
   285 {
   306 {
   286     m_resourceAdapter = PhoneResourceAdapter::Instance (this);
   307     m_resourceAdapter = PhoneResourceAdapter::Instance (this);
   307         QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   328         QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   308         action = map [PhoneAction::ToolbarButton2];
   329         action = map [PhoneAction::ToolbarButton2];
   309         QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_unmute"));
   330         QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_unmute"));
   310         QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute);    
   331         QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute);    
   311         action = map [PhoneAction::ToolbarButton3];
   332         action = map [PhoneAction::ToolbarButton3];
   312         QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker"));
   333         QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
   313         QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
   334         QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);        
   314         break;
   335         break;
   315     default:    
   336     default:    
   316         action = map [PhoneAction::ToolbarButton1];
   337         action = map [PhoneAction::ToolbarButton1];
   317         QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   338         QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer"));
   318         action = map [PhoneAction::ToolbarButton2];
   339         action = map [PhoneAction::ToolbarButton2];
   319         QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_mute"));
   340         QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_mute"));
   320         QCOMPARE (action->command (), (int)EPhoneInCallCmdMute);    
   341         QCOMPARE (action->command (), (int)EPhoneInCallCmdMute);    
   321         action = map [PhoneAction::ToolbarButton3];
   342         action = map [PhoneAction::ToolbarButton3];
   322         QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker"));
   343         QCOMPARE (action->icon (), HbIcon("qtg_mono_speaker"));
   323         QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);
   344         QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf);
   324         break;
   345         break;
   325     }
   346     }
   326 }
   347 }
   327 
   348