feat(xcui): advance core and editor validation flow
This commit is contained in:
12
tests/UI/Core/integration/input/CMakeLists.txt
Normal file
12
tests/UI/Core/integration/input/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
add_subdirectory(keyboard_focus)
|
||||
add_subdirectory(pointer_states)
|
||||
add_subdirectory(scroll_view)
|
||||
add_subdirectory(shortcut_scope)
|
||||
|
||||
add_custom_target(core_ui_input_integration_tests
|
||||
DEPENDS
|
||||
core_ui_input_keyboard_focus_validation
|
||||
core_ui_input_pointer_states_validation
|
||||
core_ui_input_scroll_view_validation
|
||||
core_ui_input_shortcut_scope_validation
|
||||
)
|
||||
8
tests/UI/Core/integration/input/README.md
Normal file
8
tests/UI/Core/integration/input/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Core Input Integration
|
||||
|
||||
这个分类只放共享 XCUI 输入能力的手工验证场景。
|
||||
|
||||
规则:
|
||||
- 一个场景目录对应一个独立 exe
|
||||
- 共享宿主层只放在 `integration/shared/`
|
||||
- 不允许把多个无关检查点塞进同一个 exe
|
||||
@@ -0,0 +1,35 @@
|
||||
set(CORE_UI_INPUT_KEYBOARD_FOCUS_RESOURCES
|
||||
View.xcui
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/themes/core_validation.xctheme
|
||||
)
|
||||
|
||||
add_executable(core_ui_input_keyboard_focus_validation WIN32
|
||||
main.cpp
|
||||
${CORE_UI_INPUT_KEYBOARD_FOCUS_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(core_ui_input_keyboard_focus_validation PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/src
|
||||
${CMAKE_SOURCE_DIR}/engine/include
|
||||
)
|
||||
|
||||
target_compile_definitions(core_ui_input_keyboard_focus_validation PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(core_ui_input_keyboard_focus_validation PRIVATE /utf-8 /FS)
|
||||
set_property(TARGET core_ui_input_keyboard_focus_validation PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
target_link_libraries(core_ui_input_keyboard_focus_validation PRIVATE
|
||||
core_ui_integration_host
|
||||
)
|
||||
|
||||
set_target_properties(core_ui_input_keyboard_focus_validation PROPERTIES
|
||||
OUTPUT_NAME "XCUICoreInputKeyboardFocusValidation"
|
||||
)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES View.xcui)
|
||||
15
tests/UI/Core/integration/input/keyboard_focus/README.md
Normal file
15
tests/UI/Core/integration/input/keyboard_focus/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Keyboard Focus Validation
|
||||
|
||||
可执行 target:
|
||||
- `core_ui_input_keyboard_focus_validation`
|
||||
|
||||
运行:
|
||||
```bash
|
||||
build\tests\UI\Core\integration\input\keyboard_focus\Debug\XCUICoreInputKeyboardFocusValidation.exe
|
||||
```
|
||||
|
||||
检查点:
|
||||
1. 按 `Tab`,焦点依次切换三个按钮。
|
||||
2. 按 `Shift+Tab`,焦点反向切换。
|
||||
3. 按 `Enter` 或 `Space`,当前 `focus` 按钮进入 `active`。
|
||||
4. 松开按键后,`active` 清空。
|
||||
30
tests/UI/Core/integration/input/keyboard_focus/View.xcui
Normal file
30
tests/UI/Core/integration/input/keyboard_focus/View.xcui
Normal file
@@ -0,0 +1,30 @@
|
||||
<View
|
||||
name="CoreInputKeyboardFocus"
|
||||
theme="../../shared/themes/core_validation.xctheme">
|
||||
<Column padding="24" gap="16">
|
||||
<Card
|
||||
title="Core Validation | Keyboard Focus"
|
||||
subtitle="当前批次:Tab 焦点遍历 | Enter / Space 激活"
|
||||
tone="accent"
|
||||
height="90">
|
||||
<Column gap="8">
|
||||
<Text text="这是 Core 层验证场景,不承载 runtime 游戏 UI。" />
|
||||
<Text text="这一轮只检查键盘焦点和激活,不混入上层业务面板。" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Card title="Keyboard Focus" subtitle="tab focus active" height="214">
|
||||
<Column gap="12">
|
||||
<Text text="只检查下面三个可聚焦按钮和右下角状态叠层。" />
|
||||
<Row gap="12">
|
||||
<Button id="focus-first" text="First Focus" />
|
||||
<Button id="focus-second" text="Second Focus" />
|
||||
<Button id="focus-third" text="Third Focus" />
|
||||
</Row>
|
||||
<Text text="1. 按 Tab:focus 应依次切到 First / Second / Third。" />
|
||||
<Text text="2. 按 Shift+Tab:focus 应反向切换。" />
|
||||
<Text text="3. focus 停在任一按钮后,按 Enter 或 Space:active 应出现;松开后 active 清空。" />
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</View>
|
||||
8
tests/UI/Core/integration/input/keyboard_focus/main.cpp
Normal file
8
tests/UI/Core/integration/input/keyboard_focus/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "Application.h"
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
|
||||
return XCEngine::Tests::CoreUI::RunCoreUIValidationApp(
|
||||
hInstance,
|
||||
nCmdShow,
|
||||
"core.input.keyboard_focus");
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
set(CORE_UI_INPUT_POINTER_STATES_RESOURCES
|
||||
View.xcui
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/themes/core_validation.xctheme
|
||||
)
|
||||
|
||||
add_executable(core_ui_input_pointer_states_validation WIN32
|
||||
main.cpp
|
||||
${CORE_UI_INPUT_POINTER_STATES_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(core_ui_input_pointer_states_validation PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/src
|
||||
${CMAKE_SOURCE_DIR}/engine/include
|
||||
)
|
||||
|
||||
target_compile_definitions(core_ui_input_pointer_states_validation PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(core_ui_input_pointer_states_validation PRIVATE /utf-8 /FS)
|
||||
set_property(TARGET core_ui_input_pointer_states_validation PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
target_link_libraries(core_ui_input_pointer_states_validation PRIVATE
|
||||
core_ui_integration_host
|
||||
)
|
||||
|
||||
set_target_properties(core_ui_input_pointer_states_validation PROPERTIES
|
||||
OUTPUT_NAME "XCUICoreInputPointerStatesValidation"
|
||||
)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES View.xcui)
|
||||
14
tests/UI/Core/integration/input/pointer_states/README.md
Normal file
14
tests/UI/Core/integration/input/pointer_states/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Pointer States Validation
|
||||
|
||||
可执行 target:
|
||||
- `core_ui_input_pointer_states_validation`
|
||||
|
||||
运行:
|
||||
```bash
|
||||
build\tests\UI\Core\integration\input\pointer_states\Debug\XCUICoreInputPointerStatesValidation.exe
|
||||
```
|
||||
|
||||
检查点:
|
||||
1. hover 左侧按钮,只应变化 `hover`。
|
||||
2. 按住中间按钮,应看到 `focus`、`active`、`capture`。
|
||||
3. 拖到右侧再松开,应看到 `capture` 清空,route 转到新的目标。
|
||||
30
tests/UI/Core/integration/input/pointer_states/View.xcui
Normal file
30
tests/UI/Core/integration/input/pointer_states/View.xcui
Normal file
@@ -0,0 +1,30 @@
|
||||
<View
|
||||
name="CoreInputPointerStates"
|
||||
theme="../../shared/themes/core_validation.xctheme">
|
||||
<Column padding="24" gap="16">
|
||||
<Card
|
||||
title="Core Validation | Pointer States"
|
||||
subtitle="当前批次:鼠标 hover / focus / active / capture"
|
||||
tone="accent"
|
||||
height="90">
|
||||
<Column gap="8">
|
||||
<Text text="这是 Core 层验证场景,不承载 runtime 游戏 UI。" />
|
||||
<Text text="这一轮只检查鼠标输入状态,不混入别的控件实验。" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Card title="Pointer Input" subtitle="hover focus active capture" height="196">
|
||||
<Column gap="12">
|
||||
<Text text="这一轮只需要检查下面这三个按钮。" />
|
||||
<Row gap="12">
|
||||
<Button id="input-hover" text="Hover / Focus" />
|
||||
<Button id="input-capture" text="Pointer Capture" capturePointer="true" />
|
||||
<Button id="input-route" text="Route Target" />
|
||||
</Row>
|
||||
<Text text="1. 鼠标移到左侧按钮:hover 应变化,focus 保持空。" />
|
||||
<Text text="2. 按住中间按钮:focus、active、capture 都应留在中间。" />
|
||||
<Text text="3. 拖到右侧再松开:hover 移到右侧,capture 清空,focus 仍留中间。" />
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</View>
|
||||
8
tests/UI/Core/integration/input/pointer_states/main.cpp
Normal file
8
tests/UI/Core/integration/input/pointer_states/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "Application.h"
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
|
||||
return XCEngine::Tests::CoreUI::RunCoreUIValidationApp(
|
||||
hInstance,
|
||||
nCmdShow,
|
||||
"core.input.pointer_states");
|
||||
}
|
||||
35
tests/UI/Core/integration/input/scroll_view/CMakeLists.txt
Normal file
35
tests/UI/Core/integration/input/scroll_view/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
set(CORE_UI_INPUT_SCROLL_VIEW_RESOURCES
|
||||
View.xcui
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/themes/core_validation.xctheme
|
||||
)
|
||||
|
||||
add_executable(core_ui_input_scroll_view_validation WIN32
|
||||
main.cpp
|
||||
${CORE_UI_INPUT_SCROLL_VIEW_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(core_ui_input_scroll_view_validation PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/src
|
||||
${CMAKE_SOURCE_DIR}/engine/include
|
||||
)
|
||||
|
||||
target_compile_definitions(core_ui_input_scroll_view_validation PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(core_ui_input_scroll_view_validation PRIVATE /utf-8 /FS)
|
||||
set_property(TARGET core_ui_input_scroll_view_validation PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
target_link_libraries(core_ui_input_scroll_view_validation PRIVATE
|
||||
core_ui_integration_host
|
||||
)
|
||||
|
||||
set_target_properties(core_ui_input_scroll_view_validation PROPERTIES
|
||||
OUTPUT_NAME "XCUICoreInputScrollViewValidation"
|
||||
)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES View.xcui)
|
||||
61
tests/UI/Core/integration/input/scroll_view/View.xcui
Normal file
61
tests/UI/Core/integration/input/scroll_view/View.xcui
Normal file
@@ -0,0 +1,61 @@
|
||||
<View
|
||||
name="CoreInputScrollView"
|
||||
theme="../../shared/themes/core_validation.xctheme">
|
||||
<Column padding="20" gap="12">
|
||||
<Card
|
||||
title="功能:ScrollView 滚动 / clip / overflow"
|
||||
subtitle="只检查滚轮滚动、裁剪、overflow 与 target 路由,不检查业务面板"
|
||||
tone="accent"
|
||||
height="118">
|
||||
<Column gap="6">
|
||||
<Text text="1. 把鼠标放到下方日志区内滚动滚轮:内容应上下移动,右下角 Scroll target 应落到 validation-scroll。" />
|
||||
<Text text="2. 连续向下滚到末尾再继续滚:Offset 应被 clamp,Result 应显示 Scroll delta clamped to current offset。" />
|
||||
<Text text="3. 把鼠标移到日志区外再滚动:日志位置不应变化,Result 应显示 No hovered ScrollView。" />
|
||||
<Text text="4. 这个场景只验证 ScrollView 基础能力,不验证上层业务面板。" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Scrollable Log"
|
||||
subtitle="wheel inside this viewport"
|
||||
height="fill">
|
||||
<ScrollView id="validation-scroll" height="fill">
|
||||
<Column gap="8">
|
||||
<Text text="Line 01 - Scroll validation log" />
|
||||
<Text text="Line 02 - Scroll validation log" />
|
||||
<Text text="Line 03 - Scroll validation log" />
|
||||
<Text text="Line 04 - Scroll validation log" />
|
||||
<Text text="Line 05 - Scroll validation log" />
|
||||
<Text text="Line 06 - Scroll validation log" />
|
||||
<Text text="Line 07 - Scroll validation log" />
|
||||
<Text text="Line 08 - Scroll validation log" />
|
||||
<Text text="Line 09 - Scroll validation log" />
|
||||
<Text text="Line 10 - Scroll validation log" />
|
||||
<Text text="Line 11 - Scroll validation log" />
|
||||
<Text text="Line 12 - Scroll validation log" />
|
||||
<Text text="Line 13 - Scroll validation log" />
|
||||
<Text text="Line 14 - Scroll validation log" />
|
||||
<Text text="Line 15 - Scroll validation log" />
|
||||
<Text text="Line 16 - Scroll validation log" />
|
||||
<Text text="Line 17 - Scroll validation log" />
|
||||
<Text text="Line 18 - Scroll validation log" />
|
||||
<Text text="Line 19 - Scroll validation log" />
|
||||
<Text text="Line 20 - Scroll validation log" />
|
||||
<Text text="Line 21 - Scroll validation log" />
|
||||
<Text text="Line 22 - Scroll validation log" />
|
||||
<Text text="Line 23 - Scroll validation log" />
|
||||
<Text text="Line 24 - Scroll validation log" />
|
||||
</Column>
|
||||
</ScrollView>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Outside Area"
|
||||
subtitle="wheel here should not move the log"
|
||||
height="84">
|
||||
<Column gap="8">
|
||||
<Text text="把鼠标移到这个区域再滚动,用来检查 No hovered ScrollView。" />
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</View>
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
8
tests/UI/Core/integration/input/scroll_view/main.cpp
Normal file
8
tests/UI/Core/integration/input/scroll_view/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "Application.h"
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
|
||||
return XCEngine::Tests::CoreUI::RunCoreUIValidationApp(
|
||||
hInstance,
|
||||
nCmdShow,
|
||||
"core.input.scroll_view");
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
set(CORE_UI_INPUT_SHORTCUT_SCOPE_RESOURCES
|
||||
View.xcui
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/themes/core_validation.xctheme
|
||||
)
|
||||
|
||||
add_executable(core_ui_input_shortcut_scope_validation WIN32
|
||||
main.cpp
|
||||
${CORE_UI_INPUT_SHORTCUT_SCOPE_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(core_ui_input_shortcut_scope_validation PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Core/integration/shared/src
|
||||
${CMAKE_SOURCE_DIR}/engine/include
|
||||
)
|
||||
|
||||
target_compile_definitions(core_ui_input_shortcut_scope_validation PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(core_ui_input_shortcut_scope_validation PRIVATE /utf-8 /FS)
|
||||
set_property(TARGET core_ui_input_shortcut_scope_validation PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
target_link_libraries(core_ui_input_shortcut_scope_validation PRIVATE
|
||||
core_ui_integration_host
|
||||
)
|
||||
|
||||
set_target_properties(core_ui_input_shortcut_scope_validation PROPERTIES
|
||||
OUTPUT_NAME "XCUICoreInputShortcutScopeValidation"
|
||||
)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES View.xcui)
|
||||
69
tests/UI/Core/integration/input/shortcut_scope/View.xcui
Normal file
69
tests/UI/Core/integration/input/shortcut_scope/View.xcui
Normal file
@@ -0,0 +1,69 @@
|
||||
<View
|
||||
name="CoreInputShortcutScope"
|
||||
theme="../../shared/themes/core_validation.xctheme"
|
||||
shortcut="Ctrl+P"
|
||||
shortcutCommand="global.command"
|
||||
shortcutScope="global">
|
||||
<Column padding="20" gap="12">
|
||||
<Card
|
||||
title="Core Validation | Shortcut Scope"
|
||||
subtitle="验证功能:Core shortcut scope 路由与 text input suppression"
|
||||
tone="accent"
|
||||
height="100">
|
||||
<Column gap="6">
|
||||
<Text text="功能 1:验证 Ctrl+P 在 Widget / Panel / Window / Global 间按优先级命中 shortcut。" />
|
||||
<Text text="功能 2:验证 Text Input Proxy 会抑制 Ctrl+P 和 Tab 焦点遍历。" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Button id="global-focus" text="Global Focus" />
|
||||
|
||||
<Card
|
||||
id="window-shell"
|
||||
title="Window Scope"
|
||||
subtitle="Ctrl+P -> window.command"
|
||||
shortcutScopeRoot="window"
|
||||
shortcut="Ctrl+P"
|
||||
shortcutCommand="window.command"
|
||||
shortcutScope="window">
|
||||
<Column gap="10">
|
||||
<Text text="先检查优先级:widget > panel > window > global。" />
|
||||
<Button id="window-focus" text="Window Focus" />
|
||||
|
||||
<Card
|
||||
id="panel-shell"
|
||||
title="Panel Scope"
|
||||
subtitle="Ctrl+P -> panel.command"
|
||||
shortcutScopeRoot="panel"
|
||||
shortcut="Ctrl+P"
|
||||
shortcutCommand="panel.command"
|
||||
shortcutScope="panel">
|
||||
<Column gap="10">
|
||||
<Button id="panel-focus" text="Panel Focus" />
|
||||
|
||||
<Card
|
||||
id="widget-shell"
|
||||
title="Widget Scope"
|
||||
subtitle="Ctrl+P -> widget.command"
|
||||
tone="accent-alt"
|
||||
shortcutScopeRoot="widget"
|
||||
shortcut="Ctrl+P"
|
||||
shortcutCommand="widget.command"
|
||||
shortcutScope="widget">
|
||||
<Column gap="10">
|
||||
<Button id="widget-focus" text="Widget Focus" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Button id="text-input" text="Text Input Proxy" textInput="true" />
|
||||
<Text text="操作指引:" />
|
||||
<Text text="1. 依次点 Widget / Panel / Window / Global Focus,再按 Ctrl+P。" />
|
||||
<Text text="2. 右下角 Recent shortcut 应分别显示 widget / panel / window / global,且状态为 handled。" />
|
||||
<Text text="3. 点 Text Input Proxy 再按 Ctrl+P,Recent shortcut 状态应变为 suppressed。" />
|
||||
<Text text="4. 保持 Text Input Proxy focus 再按 Tab,Result 应显示 focus traversal suppressed,focus 不应跳走。" />
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</View>
|
||||
8
tests/UI/Core/integration/input/shortcut_scope/main.cpp
Normal file
8
tests/UI/Core/integration/input/shortcut_scope/main.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "Application.h"
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
|
||||
return XCEngine::Tests::CoreUI::RunCoreUIValidationApp(
|
||||
hInstance,
|
||||
nCmdShow,
|
||||
"core.input.shortcut_scope");
|
||||
}
|
||||
Reference in New Issue
Block a user