everytime aurum does some action, ui will change consequently.
and libaurum should have to wait for idle of ui objects.
this patch add add the logic
Change-Id: I101327be163ce65163bfb6b3a5c0d69518dff91c
private:
std::vector<std::unique_ptr<AccessibleNode>> getWindowRoot() const;
private:
std::vector<std::unique_ptr<AccessibleNode>> getWindowRoot() const;
+ bool waitForIdle() const;
private:
UiDevice();
UiDevice(DeviceType type, IDevice *impl);
private:
UiDevice();
UiDevice(DeviceType type, IDevice *impl);
#include <unistd.h>
#include <utility>
#include <vector>
#include <unistd.h>
#include <utility>
#include <vector>
+#include <chrono>
+#include <thread>
UiDevice::UiDevice() : UiDevice(DeviceType::DEFAULT, nullptr) {}
UiDevice::UiDevice() : UiDevice(DeviceType::DEFAULT, nullptr) {}
{
return mWaiter->waitFor(condition);
}
{
return mWaiter->waitFor(condition);
}
+bool UiDevice::waitForIdle() const
+{
+ std::this_thread::sleep_for(std::chrono::milliseconds{167});
+ return true;
+}
bool UiDevice::click(const int x, const int y)
{
bool UiDevice::click(const int x, const int y)
{
- return mDeviceImpl->click(x, y);
+ bool result = mDeviceImpl->click(x, y);
+ waitForIdle();
+ return result;
}
bool UiDevice::click(const int x, const int y, const unsigned int intv)
{
}
bool UiDevice::click(const int x, const int y, const unsigned int intv)
{
- return mDeviceImpl->click(x, y, intv);
+ bool result = mDeviceImpl->click(x, y, intv);
+ waitForIdle();
+ return result;
}
bool UiDevice::drag(const int sx, const int sy, const int ex, const int ey,
}
bool UiDevice::drag(const int sx, const int sy, const int ex, const int ey,
+ const int steps, const int durationMs)
- return mDeviceImpl->drag(sx, sy, ex, ey, steps);
+ bool result = mDeviceImpl->drag(sx, sy, ex, ey, steps, durationMs);
+ waitForIdle();
+ return result;
}
bool UiDevice::touchDown(const int x, const int y)
{
}
bool UiDevice::touchDown(const int x, const int y)
{
- return mDeviceImpl->touchDown(x, y);
+ bool result = mDeviceImpl->touchDown(x, y);
+
+ return result;
}
bool UiDevice::touchMove(const int x, const int y)
{
}
bool UiDevice::touchMove(const int x, const int y)
{
- return mDeviceImpl->touchMove(x, y);
+ bool result = mDeviceImpl->touchMove(x, y);
+ return result;
}
bool UiDevice::touchUp(const int x, const int y)
{
}
bool UiDevice::touchUp(const int x, const int y)
{
- return mDeviceImpl->touchUp(x, y);
+ bool result = mDeviceImpl->touchUp(x, y);
+ waitForIdle();
+ return result;
}
bool UiDevice::pressBack()
{
}
bool UiDevice::pressBack()
{
- return mDeviceImpl->pressBack();
+ bool result = mDeviceImpl->pressBack();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressHome()
{
}
bool UiDevice::pressHome()
{
- return mDeviceImpl->pressHome();
+ bool result = mDeviceImpl->pressHome();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressMenu()
{
}
bool UiDevice::pressMenu()
{
- return mDeviceImpl->pressMenu();
+ bool result = mDeviceImpl->pressMenu();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressVolUp()
{
}
bool UiDevice::pressVolUp()
{
- return mDeviceImpl->pressVolUp();
+ bool result = mDeviceImpl->pressVolUp();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressVolDown()
{
}
bool UiDevice::pressVolDown()
{
- return mDeviceImpl->pressVolDown();
+ bool result = mDeviceImpl->pressVolDown();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressPower()
{
}
bool UiDevice::pressPower()
{
- return mDeviceImpl->pressPower();
+ bool result = mDeviceImpl->pressPower();
+ waitForIdle();
+ return result;
}
bool UiDevice::pressKeyCode(std::string keycode)
{
}
bool UiDevice::pressKeyCode(std::string keycode)
{
- return mDeviceImpl->pressKeyCode(keycode);
+ bool result = mDeviceImpl->pressKeyCode(keycode);
+ waitForIdle();
+ return result;
}
bool UiDevice::takeScreenshot(std::string path, float scale, int quality)
}
bool UiDevice::takeScreenshot(std::string path, float scale, int quality)