[Core] Add Repeat Key ("repeat last key") as a core feature. (#19700)

Co-authored-by: casuanoob <96005765+casuanoob@users.noreply.github.com>
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
This commit is contained in:
Pascal Getreuer 2023-05-20 05:35:06 -07:00 committed by GitHub
parent e1766df185
commit 3993b15f05
Failed to generate hash of commit
29 changed files with 2508 additions and 6 deletions

View file

@ -20,6 +20,7 @@
#include <stdint.h>
#include "host.h"
#include "keyboard_report_util.hpp"
#include "keycode_util.hpp"
#include "test_logger.hpp"
class TestDriver {
@ -98,6 +99,17 @@ class TestDriver {
*/
#define EXPECT_NO_REPORT(driver) EXPECT_ANY_REPORT(driver).Times(0)
/** @brief Tests whether keycode `actual` is equal to `expected`. */
#define EXPECT_KEYCODE_EQ(actual, expected) EXPECT_THAT((actual), KeycodeEq((expected)))
MATCHER_P(KeycodeEq, expected_keycode, "is equal to " + testing::PrintToString(expected_keycode) + ", keycode " + get_keycode_identifier_or_default(expected_keycode)) {
if (arg == expected_keycode) {
return true;
}
*result_listener << "keycode " << get_keycode_identifier_or_default(arg);
return false;
}
/**
* @brief Verify and clear all gmock expectations that have been setup until
* this point.