From da0e3d7a2dace5c29b7a252b744232e9a92e4f2e Mon Sep 17 00:00:00 2001 From: Saurav Chirania Date: Wed, 6 Jun 2018 11:22:42 +0530 Subject: WIP: uitest: complete combobox, tabcontrol wrapper Change-Id: I3ba1b0d1b5412c30e540cf45fe21ef946839afed Reviewed-on: https://gerrit.libreoffice.org/55372 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- vcl/source/uitest/uiobject.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'vcl/source/uitest') diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index c7c64f8c9189..adf26cbb2ac8 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1014,6 +1014,19 @@ OUString ComboBoxUIObject::get_name() const return OUString("ComboBoxUIObject"); } +OUString ComboBoxUIObject::get_action(VclEventId nEvent) const +{ + if (nEvent == VclEventId::ComboboxSelect) + { + sal_Int32 nPos = mxComboBox->GetSelectedEntryPos(); + return this->get_type() + " Action:SELECT Id:" + + mxComboBox->get_id() + " POS:" + OUString::number(nPos) + + " Parent:" + get_top_parent(mxComboBox)->get_id(); + } + else + return WindowUIObject::get_action(nEvent); +} + std::unique_ptr ComboBoxUIObject::create(vcl::Window* pWindow) { ComboBox* pComboBox = dynamic_cast(pWindow); @@ -1143,10 +1156,28 @@ void TabControlUIObject::execute(const OUString& rAction, StringMap TabControlUIObject::get_state() { StringMap aMap = WindowUIObject::get_state(); + aMap["PageCount"] = OUString::number(mxTabControl->GetPageCount()); + + sal_uInt16 nPageId = mxTabControl->GetCurPageId(); + aMap["CurrPageId"] = OUString::number(nPageId); + aMap["CurrPagePos"] = OUString::number(mxTabControl->GetPagePos(nPageId)); return aMap; } +OUString TabControlUIObject::get_action(VclEventId nEvent) const +{ + if (nEvent == VclEventId::TabpageActivate) + { + sal_Int32 nPageId = mxTabControl->GetCurPageId(); + return this->get_type() + " Action:SELECT Id:" + mxTabControl->get_id() + + " POS:" + OUString::number(mxTabControl->GetPagePos(nPageId)) + + " Parent:" + get_top_parent(mxTabControl)->get_id(); + } + else + return WindowUIObject::get_action(nEvent); +} + OUString TabControlUIObject::get_name() const { return OUString("TabControlUIObject"); -- cgit