UI
This commit is contained in:
@@ -150,3 +150,21 @@ BOOST_AUTO_TEST_CASE(zero_touch_stop_and_destruction_suppress_queued_commands) {
|
||||
BOOST_TEST(commands.empty());
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(zero_touch_reset_discards_old_score_gestures_but_accepts_new_input) {
|
||||
auto io = boost::asio::io_context{};
|
||||
auto commands = std::vector<std::string>{};
|
||||
auto touch = vamp_zero::touch_input{io.get_executor(), [&](auto command) { commands.emplace_back(vamp_protocol::page_command_name(command)); }};
|
||||
auto base = std::chrono::steady_clock::now() - std::chrono::seconds{10};
|
||||
touch.handle(touch_event(luma::touch_phase::DOWN, base));
|
||||
touch.handle(touch_event(luma::touch_phase::UP, base + std::chrono::milliseconds{700}));
|
||||
touch.reset();
|
||||
io.run();
|
||||
BOOST_TEST(commands.empty());
|
||||
io.restart();
|
||||
touch.handle(touch_event(luma::touch_phase::DOWN, base));
|
||||
touch.handle(touch_event(luma::touch_phase::UP, base + std::chrono::milliseconds{30}));
|
||||
io.run();
|
||||
BOOST_REQUIRE_EQUAL(commands.size(), 1U);
|
||||
BOOST_TEST(commands.front() == "next");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user