{
keyboard->setFocus(window);
EXPECT_TRUE(window == keyboard->getFocus());
+
+ keyboard->keyDown(100);
+ keyboard->keyUp(100);
+
+ keyboard->setRepeatRate(25);
+ keyboard->setRepeatDelay(400);
}
}
}
}
}
+TEST_F(DSWaylandCompositorTest, GetCurrentTime)
+{
+ bool res;
+ uint32_t currentTime;
+
+ DSWaylandCompositor *comp = DSWaylandCompositor::getInstance();
+ EXPECT_TRUE(comp != nullptr);
+
+ if (comp)
+ {
+ res = comp->create();
+ EXPECT_TRUE(res == true);
+
+ currentTime = comp->currentTime();
+ EXPECT_TRUE(currentTime <= comp->currentTime());
+
+ DSWaylandCompositor::releaseInstance();
+ }
+}
+
TEST_F(DSWaylandCompositorTest, AddRemoveClient)
{
bool res;
}
}
+TEST_F(DSWaylandKeyboardTest, BasicMethods)
+{
+ auto keyboard = new DSWaylandKeyboard(nullptr);
+ EXPECT_TRUE(keyboard != nullptr);
+
+ if (keyboard)
+ {
+ keyboard->sendKeyDown(100);
+ keyboard->sendKeyUp(100);
+ }
+}
+
#include "libds-tests.h"
#include "DSWaylandCompositor.h"
#include "DSWaylandSeat.h"
+#include "DSSeat.h"
+#include "DSXkb.h"
using namespace display_server;
}
}
+TEST_F(DSWaylandSeatTest, GetSetCurrentEventTime)
+{
+ DSWaylandCompositor *comp = DSWaylandCompositor::getInstance();
+ EXPECT_TRUE(comp != nullptr);
+
+ if (comp)
+ {
+ auto seat = new DSWaylandSeat(comp, DSWaylandSeat::capDefault);
+ EXPECT_TRUE(seat != nullptr);
+
+ uint32_t currentTime = comp->currentTime();
+ seat->setCurrentEventTime(currentTime);
+ EXPECT_TRUE(currentTime == seat->getCurrentEventTime());
+
+ DSWaylandCompositor::releaseInstance();
+ }
+}
+
+TEST_F(DSWaylandSeatTest, GetSetXkb)
+{
+ DSWaylandCompositor *comp = DSWaylandCompositor::getInstance();
+ EXPECT_TRUE(comp != nullptr);
+
+ if (comp)
+ {
+ auto seat = new DSSeat();
+ EXPECT_TRUE(seat != nullptr);
+
+ if (seat)
+ {
+ auto xkb = seat->getXkb();
+ EXPECT_TRUE(xkb != nullptr);
+
+ if (xkb)
+ {
+ auto waylandSeat = new DSWaylandSeat(comp, DSWaylandSeat::capDefault);
+ EXPECT_TRUE(waylandSeat != nullptr);
+
+ waylandSeat->setXkb(xkb);
+ EXPECT_TRUE(xkb == waylandSeat->getXkb());
+ }
+ }
+
+ DSWaylandCompositor::releaseInstance();
+ }
+}
+