Route canvas hotkeys through app core

This commit is contained in:
2026-06-03 20:30:07 +02:00
parent 16a1d1e15b
commit 6945ce7e23
8 changed files with 953 additions and 52 deletions

View File

@@ -298,6 +298,16 @@ add_test(NAME pp_app_core_canvas_tool_ui_tests COMMAND pp_app_core_canvas_tool_u
set_tests_properties(pp_app_core_canvas_tool_ui_tests PROPERTIES
LABELS "app;ui;desktop-fast;fuzz")
add_executable(pp_app_core_canvas_hotkey_tests
app_core/canvas_hotkey_tests.cpp)
target_link_libraries(pp_app_core_canvas_hotkey_tests PRIVATE
pp_app_core
pp_test_harness)
add_test(NAME pp_app_core_canvas_hotkey_tests COMMAND pp_app_core_canvas_hotkey_tests)
set_tests_properties(pp_app_core_canvas_hotkey_tests PROPERTIES
LABELS "app;ui;document;paint;desktop-fast;fuzz")
add_executable(pp_app_core_grid_ui_tests
app_core/grid_ui_tests.cpp)
target_link_libraries(pp_app_core_grid_ui_tests PRIVATE
@@ -1274,6 +1284,36 @@ if(TARGET pano_cli)
LABELS "renderer;paint;integration;desktop-fast;fuzz"
WILL_FAIL TRUE)
add_test(NAME pano_cli_plan_canvas_hotkey_ctrl_z_smoke
COMMAND pano_cli plan-canvas-hotkey --event key-up --key z --ctrl --undo-count 2)
set_tests_properties(pano_cli_plan_canvas_hotkey_ctrl_z_smoke PROPERTIES
LABELS "app;document;ui;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"plan-canvas-hotkey\".*\"key\":\"z\".*\"ctrl\":true.*\"action\":\"history\".*\"historyOperation\":\"undo\".*\"historyNoOp\":false")
add_test(NAME pano_cli_plan_canvas_hotkey_save_dirty_version_smoke
COMMAND pano_cli plan-canvas-hotkey --event key-up --key s --ctrl --shift)
set_tests_properties(pano_cli_plan_canvas_hotkey_save_dirty_version_smoke PROPERTIES
LABELS "app;document;ui;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"plan-canvas-hotkey\".*\"key\":\"s\".*\"shift\":true.*\"action\":\"save-document\".*\"saveIntent\":\"save-dirty-version\"")
add_test(NAME pano_cli_plan_canvas_hotkey_erase_smoke
COMMAND pano_cli plan-canvas-hotkey --event key-down --key e)
set_tests_properties(pano_cli_plan_canvas_hotkey_erase_smoke PROPERTIES
LABELS "app;paint;ui;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"plan-canvas-hotkey\".*\"event\":\"key-down\".*\"key\":\"e\".*\"action\":\"select-tool\".*\"toolMode\":\"erase\"")
add_test(NAME pano_cli_plan_canvas_hotkey_two_finger_undo_smoke
COMMAND pano_cli plan-canvas-hotkey --event touch-tap --key other --touch-fingers 2 --undo-count 1)
set_tests_properties(pano_cli_plan_canvas_hotkey_two_finger_undo_smoke PROPERTIES
LABELS "app;document;ui;integration;desktop-fast"
PASS_REGULAR_EXPRESSION "\"command\":\"plan-canvas-hotkey\".*\"event\":\"touch-tap\".*\"touchFingers\":2.*\"action\":\"history\".*\"historyOperation\":\"undo\"")
add_test(NAME pano_cli_plan_canvas_hotkey_rejects_bad_count
COMMAND pano_cli plan-canvas-hotkey --event key-down --key android-back --undo-count -1)
set_tests_properties(pano_cli_plan_canvas_hotkey_rejects_bad_count PROPERTIES
LABELS "app;document;ui;integration;desktop-fast;fuzz"
WILL_FAIL TRUE)
add_test(NAME pano_cli_plan_canvas_tool_draw_smoke
COMMAND pano_cli plan-canvas-tool --kind draw)
set_tests_properties(pano_cli_plan_canvas_tool_draw_smoke PROPERTIES