editor: centralize product panel manifest
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "EditorShellAssetBuilder.h"
|
||||
#include "Panels/EditorPanelIds.h"
|
||||
#include "Product/EditorProductManifest.h"
|
||||
|
||||
#include <XCEditor/Shell/UIEditorShellAsset.h>
|
||||
|
||||
@@ -10,6 +12,13 @@ namespace {
|
||||
|
||||
using XCEngine::Input::KeyCode;
|
||||
using XCEngine::UI::Editor::App::BuildEditorApplicationShellAsset;
|
||||
using XCEngine::UI::Editor::App::EditorProductManifestValidationCode;
|
||||
using XCEngine::UI::Editor::App::EditorProductPanelRuntimeKind;
|
||||
using XCEngine::UI::Editor::App::EditorProductViewportRendererKind;
|
||||
using XCEngine::UI::Editor::App::FindEditorProductPanel;
|
||||
using XCEngine::UI::Editor::App::GetEditorProductPanels;
|
||||
using XCEngine::UI::Editor::App::kGamePanelId;
|
||||
using XCEngine::UI::Editor::App::ValidateEditorProductManifest;
|
||||
using XCEngine::UI::Editor::EditorShellAssetValidationCode;
|
||||
using XCEngine::UI::Editor::FindUIEditorPanelDescriptor;
|
||||
using XCEngine::UI::Editor::UIEditorCommandPanelSource;
|
||||
@@ -64,6 +73,24 @@ TEST(EditorShellAssetValidationTest, DefaultShellAssetPassesValidation) {
|
||||
shellAsset.panelRegistry.panels.front().presentationKind);
|
||||
}
|
||||
|
||||
TEST(EditorShellAssetValidationTest, ProductManifestDeclaresPanelRuntimeAndViewportOwners) {
|
||||
const auto validation = ValidateEditorProductManifest();
|
||||
EXPECT_EQ(validation.code, EditorProductManifestValidationCode::None)
|
||||
<< validation.message;
|
||||
ASSERT_TRUE(validation.IsValid());
|
||||
|
||||
const auto shellAsset = BuildEditorApplicationShellAsset(".");
|
||||
ASSERT_EQ(shellAsset.panelRegistry.panels.size(), GetEditorProductPanels().size());
|
||||
|
||||
const auto* gamePanel = FindEditorProductPanel(kGamePanelId);
|
||||
ASSERT_NE(gamePanel, nullptr);
|
||||
EXPECT_EQ(gamePanel->runtimeKind, EditorProductPanelRuntimeKind::None);
|
||||
EXPECT_EQ(
|
||||
gamePanel->viewportRendererKind,
|
||||
EditorProductViewportRendererKind::Placeholder);
|
||||
EXPECT_FALSE(gamePanel->viewportPlaceholderStatus.empty());
|
||||
}
|
||||
|
||||
TEST(EditorShellAssetValidationTest, ValidationRejectsWorkspacePanelMissingFromRegistry) {
|
||||
auto shellAsset = BuildEditorApplicationShellAsset(".");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user