*
* @since_tizen 6.5
*/
- virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout) = 0;
+ virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName) = 0;
/**
* @brief Gets active application map.
/**
* @copydoc @AccessibleWatcher::executeAndWaitForEvents()
*/
- virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout) override;
+ virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName) override;
/**
* @copydoc @AccessibleWatcher::getActiveAppMap()
* @brief TBD
* @since_tizen 6.5
*/
- virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout) override;
+ virtual bool executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName) override;
std::map<AtspiAccessible *, std::shared_ptr<AccessibleApplication>> getActiveAppMap(void);
* @param[in] cmd @Runnable
* @param[in] type one of @A11yEvent
* @param[in] timeout time(millisecond) to wait event occur
+ * @param[in] packageName package name that event occurs
*
* @return true if event happened in time, otherwise false
*
* @since_tizen 6.5
*/
bool executeAndWaitForEvents(
- const Runnable *cmd, const A11yEvent type, const int timeout) const;
+ const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName) const;
public:
/**
* @brief Gets UiDevice instance.
return ret;
}
-bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout)
+bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName)
{
mMutex.lock();
mEventQueue.clear();
if (!localEvents.empty())
{
for (const auto &event : localEvents) {
- if (COMPARE(type, event->getEvent()))
+ if (COMPARE(type, event->getEvent()) && (packageName.empty() || packageName == event->getPkg()))
{
- LOGI("type %d == %d name %s pkg %s",static_cast<int>(type), static_cast<int>(event->getEvent()), event->getName().c_str(), event->getPkg().c_str());
+ LOGI("type %d == %d name %s pkg %s",static_cast<int>(type), static_cast<int>(event->getEvent()), event->getName().c_str(), event->getPkg().c_str());
return true;
}
}
return app;
}
-bool MockAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout)
+bool MockAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName)
{
return true;
}
bool UiDevice::waitForEvents(
const A11yEvent type, const int timeout) const
{
- return executeAndWaitForEvents(NULL, type, timeout);
+ return executeAndWaitForEvents(NULL, type, timeout, std::string());
}
bool UiDevice::executeAndWaitForEvents(
- const Runnable *cmd, const A11yEvent type, const int timeout) const
+ const Runnable *cmd, const A11yEvent type, const int timeout, const std::string packageName) const
{
- return AccessibleWatcher::getInstance()->executeAndWaitForEvents(cmd, type, timeout);
+ return AccessibleWatcher::getInstance()->executeAndWaitForEvents(cmd, type, timeout, packageName);
}
bool UiDevice::sendKeyAndWaitForEvents(
const std::string keycode, const A11yEvent type, const int timeout) const
{
std::unique_ptr<SendKeyRunnable> cmd = std::make_unique<SendKeyRunnable>(keycode);
- return executeAndWaitForEvents(cmd.get(), type, timeout);
+ return executeAndWaitForEvents(cmd.get(), type, timeout, std::string());
}
bool UiDevice::click(const int x, const int y)
std::unique_ptr<ActionAndWaitEventRunnable> cmd = std::make_unique<ActionAndWaitEventRunnable>(
mRequest->type(), mRequest->elementid(), mRequest->xf86keycode());
std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
- bool ret = obj->executeAndWaitForEvents(cmd.get(), convertEventType(mRequest->eventtype()), mRequest->timeoutms());
+ bool ret = obj->executeAndWaitForEvents(cmd.get(), convertEventType(mRequest->eventtype()), mRequest->timeoutms(), mRequest->packagename());
if (ret) mResponse->set_status(::aurum::RspStatus::OK);
else mResponse->set_status(::aurum::RspStatus::ERROR);
LOGI("LaunchApp --------------- ");
std::unique_ptr<LaunchAppRunnable> cmd = std::make_unique<LaunchAppRunnable>(mRequest->packagename(), mRequest->data());
std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
- obj->executeAndWaitForEvents(cmd.get(), A11yEvent::EVENT_WINDOW_ACTIVATE, WAIT_APP_LAUNCH);
+ obj->executeAndWaitForEvents(cmd.get(), A11yEvent::EVENT_WINDOW_ACTIVATE, WAIT_APP_LAUNCH, mRequest->packagename());
return grpc::Status::OK;
}
\ No newline at end of file
}
EventType eventType = 4;
int32 timeoutMs = 5;
+ string packageName = 6;
}
message RspActionAndWaitEvent {