Add XCUI input state validation sandbox batch

This commit is contained in:
2026-04-05 22:35:24 +08:00
parent 1908e81e5c
commit 5342e447af
7 changed files with 376 additions and 133 deletions

View File

@@ -54,11 +54,9 @@ bool ContainsPathWithFilename(
TEST(NewEditorStructuredShellTest, AuthoredEditorShellLoadsFromRepositoryResources) {
const std::filesystem::path viewPath = RepoRelative("new_editor/ui/views/editor_shell.xcui");
const std::filesystem::path themePath = RepoRelative("new_editor/ui/themes/editor_shell.xctheme");
const std::filesystem::path schemaPath = RepoRelative("new_editor/ui/schemas/editor_inspector_shell.xcschema");
ASSERT_TRUE(std::filesystem::exists(viewPath));
ASSERT_TRUE(std::filesystem::exists(themePath));
ASSERT_TRUE(std::filesystem::exists(schemaPath));
UIScreenAsset asset = {};
asset.screenId = "new_editor.editor_shell";
@@ -72,7 +70,6 @@ TEST(NewEditorStructuredShellTest, AuthoredEditorShellLoadsFromRepositoryResourc
ASSERT_NE(player.GetDocument(), nullptr);
EXPECT_TRUE(player.GetDocument()->hasThemeDocument);
EXPECT_TRUE(ContainsPathWithFilename(player.GetDocument()->dependencies, "editor_shell.xctheme"));
EXPECT_TRUE(ContainsPathWithFilename(player.GetDocument()->dependencies, "editor_inspector_shell.xcschema"));
UIScreenFrameInput input = {};
input.viewportRect = XCEngine::UI::UIRect(0.0f, 0.0f, 1440.0f, 900.0f);
@@ -81,11 +78,11 @@ TEST(NewEditorStructuredShellTest, AuthoredEditorShellLoadsFromRepositoryResourc
const auto& frame = player.Update(input);
EXPECT_TRUE(frame.stats.documentLoaded);
EXPECT_GT(frame.stats.nodeCount, 12u);
EXPECT_GT(frame.stats.commandCount, 20u);
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "XCUI Editor Sandbox"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Hierarchy"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Scene"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Inspector"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Status"));
EXPECT_GT(frame.stats.nodeCount, 6u);
EXPECT_GT(frame.stats.commandCount, 12u);
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "XCUI Core Validation"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Input Core"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Hover / Focus"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Pointer Capture"));
EXPECT_TRUE(DrawDataContainsText(frame.drawData, "Route Target"));
}