diff --git a/shell/platform/windows/keyboard_unittests.cc b/shell/platform/windows/keyboard_unittests.cc index 629c7ebdea372..7265dd5d2dbbd 100644 --- a/shell/platform/windows/keyboard_unittests.cc +++ b/shell/platform/windows/keyboard_unittests.cc @@ -544,9 +544,11 @@ class KeyboardTest : public WindowsTest { // Define compound `expect` in macros. If they're defined in functions, the // stacktrace wouldn't print where the function is called in the unit tests. -#define EXPECT_CALL_IS_EVENT(_key_call, ...) \ - EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnKey); \ - EXPECT_EVENT_EQUALS(_key_call.key_event, __VA_ARGS__); +#define EXPECT_CALL_IS_EVENT(_key_call, _type, _physical, _logical, \ + _character, _synthesized) \ + EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnKey); \ + EXPECT_EVENT_EQUALS(_key_call.key_event, _type, _physical, _logical, \ + _character, _synthesized); #define EXPECT_CALL_IS_TEXT(_key_call, u16_string) \ EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnText); \ diff --git a/shell/platform/windows/testing/test_keyboard.h b/shell/platform/windows/testing/test_keyboard.h index 1ec3a3b38c739..bcadb6f512662 100644 --- a/shell/platform/windows/testing/test_keyboard.h +++ b/shell/platform/windows/testing/test_keyboard.h @@ -145,13 +145,17 @@ class MockMessageQueue { // Expect the |_target| FlutterKeyEvent has the required properties. #define EXPECT_EVENT_EQUALS(_target, _type, _physical, _logical, _character, \ _synthesized) \ - EXPECT_PRED_FORMAT2(_EventEquals, _target, \ - (FlutterKeyEvent{ \ - .type = _type, \ - .physical = _physical, \ - .logical = _logical, \ - .character = _character, \ - .synthesized = _synthesized, \ - })); + EXPECT_PRED_FORMAT2( \ + _EventEquals, _target, \ + (FlutterKeyEvent{ \ + /* struct_size = */ sizeof(FlutterKeyEvent), \ + /* timestamp = */ 0, \ + /* type = */ _type, \ + /* physical = */ _physical, \ + /* logical = */ _logical, \ + /* character = */ _character, \ + /* synthesized = */ _synthesized, \ + /* device_type = */ kFlutterKeyEventDeviceTypeKeyboard, \ + })); #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_KEYBOARD_H_