phoneapp/phoneuiqtviewadapter/tsrc/ut_phonecommandextensionwrapper/unit_tests.cpp
changeset 45 6b911d05207e
parent 21 92ab7f8d0eab
child 74 d1c62c765e48
equal deleted inserted replaced
37:ba76fc04e6c2 45:6b911d05207e
    25 #include "pevirtualengine.h"
    25 #include "pevirtualengine.h"
    26 #include "menuextension_stub.h"
    26 #include "menuextension_stub.h"
    27 
    27 
    28 extern bool m_modifyMenuCommandListCalled;
    28 extern bool m_modifyMenuCommandListCalled;
    29 extern bool m_modifyPushButtonCommandListCalled;
    29 extern bool m_modifyPushButtonCommandListCalled;
       
    30 extern bool m_modifyToolBarCommandListCalled;
    30 extern bool m_addMenuActionsCalled;
    31 extern bool m_addMenuActionsCalled;
    31 extern bool m_releaseMenuCalled;
    32 extern bool m_releaseMenuCalled;
    32 extern bool m_releaseCalled;
    33 extern bool m_releaseCalled;
    33 extern bool m_useExtensionStub;
    34 extern bool m_useExtensionStub;
    34 
    35 
   103 void TestPhoneCommandExtensionWrapper::testNullPlugin()
   104 void TestPhoneCommandExtensionWrapper::testNullPlugin()
   104 {
   105 {
   105     QList<XQTelUiCommandExtension::CallInfo> callInfo; 
   106     QList<XQTelUiCommandExtension::CallInfo> callInfo; 
   106     QList<int> menuCmdList;
   107     QList<int> menuCmdList;
   107     QList<HbAction*> menuActions;
   108     QList<HbAction*> menuActions;
       
   109     QList<XQTelUiCommandExtension::ToolBarCommand> toolBar;
   108     m_useExtensionStub = false;
   110     m_useExtensionStub = false;
   109     m_wrapper = new PhoneCommandExtensionWrapper(123456);
   111     m_wrapper = new PhoneCommandExtensionWrapper(123456);
   110     
   112     
   111     m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
   113     m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
   112     QVERIFY( false == m_modifyMenuCommandListCalled );
   114     QVERIFY( false == m_modifyMenuCommandListCalled );
   113     
   115     
   114     m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
   116     m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
   115     QVERIFY( false == m_modifyPushButtonCommandListCalled );
   117     QVERIFY( false == m_modifyPushButtonCommandListCalled );
       
   118    
       
   119     m_wrapper->modifyToolBarCommandList(callInfo, toolBar);
       
   120     QVERIFY( false == m_modifyToolBarCommandListCalled );
   116     
   121     
   117     m_wrapper->addMenuActions(callInfo, menuActions);
   122     m_wrapper->addMenuActions(callInfo, menuActions);
   118     QVERIFY( false == m_addMenuActionsCalled );
   123     QVERIFY( false == m_addMenuActionsCalled );
   119     
   124     
   120     m_wrapper->releaseMenu();
   125     m_wrapper->releaseMenu();
   128 void TestPhoneCommandExtensionWrapper::testPlugin()
   133 void TestPhoneCommandExtensionWrapper::testPlugin()
   129 {
   134 {
   130     QList<XQTelUiCommandExtension::CallInfo> callInfo; 
   135     QList<XQTelUiCommandExtension::CallInfo> callInfo; 
   131     QList<int> menuCmdList;
   136     QList<int> menuCmdList;
   132     QList<HbAction*> menuActions;
   137     QList<HbAction*> menuActions;
       
   138     QList<XQTelUiCommandExtension::ToolBarCommand> toolBar;
   133     m_useExtensionStub = true;
   139     m_useExtensionStub = true;
   134     m_wrapper = new PhoneCommandExtensionWrapper(123456);
   140     m_wrapper = new PhoneCommandExtensionWrapper(123456);
   135     
   141     
   136     QVERIFY( 123456 == m_wrapper->pluginUid() );
   142     QVERIFY( 123456 == m_wrapper->pluginUid() );
   137     
   143     
   138     m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
   144     m_wrapper->modifyMenuCommandList(callInfo, menuCmdList);
   139     QVERIFY( m_modifyMenuCommandListCalled );
   145     QVERIFY( m_modifyMenuCommandListCalled );
   140     
   146     
   141     m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
   147     m_wrapper->modifyPushButtonCommandList(callInfo, menuCmdList);
   142     QVERIFY( m_modifyPushButtonCommandListCalled );
   148     QVERIFY( m_modifyPushButtonCommandListCalled );
       
   149     
       
   150     m_wrapper->modifyToolBarCommandList(callInfo, toolBar);
       
   151     QVERIFY( m_modifyToolBarCommandListCalled );
   143     
   152     
   144     m_wrapper->addMenuActions(callInfo, menuActions);
   153     m_wrapper->addMenuActions(callInfo, menuActions);
   145     QVERIFY( m_addMenuActionsCalled );
   154     QVERIFY( m_addMenuActionsCalled );
   146     
   155     
   147     m_wrapper->releaseMenu();
   156     m_wrapper->releaseMenu();