test(D.2b): chat golden fixture + resolved-Type conformance (widget-generalization Task 1)
- Add ChatLayoutFixtureGenerator.cs (Skip-by-default) to regenerate
chat_21000006.json from the live portal.dat via LayoutImporter.ImportInfos
- Commit generated fixture chat_21000006.json (13 KB, 400 lines) — dat-free,
auto-copied to test output via existing *.json csproj glob
- Refactor FixtureLoader: extract shared LoadInfos(fileName) helper; add
LoadChat() + LoadChatInfos() mirroring the vitals pattern; LoadVitalsInfos()
now delegates to the shared loader (behavior unchanged, vitals tests green)
- Add ChatLayoutConformanceTests: ResolvesKnownElements + ResolvedTypes_MatchRetailRegistry
Confirmed resolved Types from live dat:
0x10000011 (transcript) → Type 12 (style-prototype, skipped by factory)
0x10000016 (input) → Type 12 (style-prototype, skipped by factory)
0x10000014 (menu) → Type 6
0x10000012 (scrollbar) → Type 11
0x10000019 (send) → Type 1
0x1000046F (max/min) → Type 1
Also fix pre-existing build break: UiChatInput.MoveCaret(int delta) was made
private in ce848c1 but UiChatInputTests.Backspace_DeletesBeforeCaret called it
as public. Expose a public MoveCaret(int) overload (no-shift) alongside the
private MoveCaret(int,bool) — restores the intended test surface.
Full suite: 398 passed, 2 skipped (generator + pre-existing), 0 failed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
34e79096f3
commit
d1b13a7dbf
5 changed files with 661 additions and 9 deletions
542
tests/AcDream.App.Tests/UI/Layout/fixtures/chat_21000006.json
Normal file
542
tests/AcDream.App.Tests/UI/Layout/fixtures/chat_21000006.json
Normal file
|
|
@ -0,0 +1,542 @@
|
|||
{
|
||||
"Id": 0,
|
||||
"Type": 3,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 0,
|
||||
"Height": 0,
|
||||
"Left": 0,
|
||||
"Top": 0,
|
||||
"Right": 0,
|
||||
"Bottom": 0,
|
||||
"ReadOrder": 0,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435484,
|
||||
"Type": 3,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 382,
|
||||
"Height": 104,
|
||||
"Left": 1,
|
||||
"Top": 2,
|
||||
"Right": 2,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100667980,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435485,
|
||||
"Type": 5,
|
||||
"X": 0,
|
||||
"Y": 2,
|
||||
"Width": 382,
|
||||
"Height": 102,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268436774,
|
||||
"Type": 1,
|
||||
"X": 2,
|
||||
"Y": 0,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 3,
|
||||
"FontDid": 1073741861,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100688408,
|
||||
"Item2": 1
|
||||
},
|
||||
"Highlight": {
|
||||
"Item1": 100688409,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268435486,
|
||||
"Type": 12,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 191,
|
||||
"Height": 17,
|
||||
"Left": 0,
|
||||
"Top": 0,
|
||||
"Right": 0,
|
||||
"Bottom": 0,
|
||||
"ReadOrder": 2,
|
||||
"FontDid": 1073741825,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100667982,
|
||||
"Item2": 1
|
||||
},
|
||||
"Ghosted": {
|
||||
"Item1": 100667982,
|
||||
"Item2": 1
|
||||
},
|
||||
"Talkfocus_highlight": {
|
||||
"Item1": 100667981,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268435470,
|
||||
"Type": 268435521,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 800,
|
||||
"Height": 100,
|
||||
"Left": 1,
|
||||
"Top": 2,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 0,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100667725,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268436772,
|
||||
"Type": 1,
|
||||
"X": 0,
|
||||
"Y": 46,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 6,
|
||||
"FontDid": 1073741861,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100688408,
|
||||
"Item2": 1
|
||||
},
|
||||
"Highlight": {
|
||||
"Item1": 100688409,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268436773,
|
||||
"Type": 1,
|
||||
"X": 0,
|
||||
"Y": 64,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 7,
|
||||
"FontDid": 1073741861,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100688408,
|
||||
"Item2": 1
|
||||
},
|
||||
"Highlight": {
|
||||
"Item1": 100688409,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268436591,
|
||||
"Type": 1,
|
||||
"X": 474,
|
||||
"Y": 0,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 2,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 3,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"Maximized": {
|
||||
"Item1": 100687460,
|
||||
"Item2": 1
|
||||
},
|
||||
"Minimized": {
|
||||
"Item1": 100687461,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Minimized",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268435471,
|
||||
"Type": 9,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 800,
|
||||
"Height": 9,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100667685,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268435472,
|
||||
"Type": 3,
|
||||
"X": 0,
|
||||
"Y": 9,
|
||||
"Width": 490,
|
||||
"Height": 74,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 2,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100667669,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435473,
|
||||
"Type": 12,
|
||||
"X": 16,
|
||||
"Y": 0,
|
||||
"Width": 458,
|
||||
"Height": 74,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 1073741824,
|
||||
"StateMedia": {},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268436620,
|
||||
"Type": 1,
|
||||
"X": 0,
|
||||
"Y": 58,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 3,
|
||||
"Top": 2,
|
||||
"Right": 3,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100687630,
|
||||
"Item2": 1
|
||||
},
|
||||
"Normal_pressed": {
|
||||
"Item1": 100687630,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Ghosted",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268435474,
|
||||
"Type": 11,
|
||||
"X": 474,
|
||||
"Y": 6,
|
||||
"Width": 16,
|
||||
"Height": 68,
|
||||
"Left": 2,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 2,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100682847,
|
||||
"Item2": 3
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268435475,
|
||||
"Type": 3,
|
||||
"X": 0,
|
||||
"Y": 83,
|
||||
"Width": 490,
|
||||
"Height": 17,
|
||||
"Left": 1,
|
||||
"Top": 2,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 8,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"": {
|
||||
"Item1": 100667706,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435476,
|
||||
"Type": 6,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 46,
|
||||
"Height": 17,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100683109,
|
||||
"Item2": 3
|
||||
},
|
||||
"Normal_pressed": {
|
||||
"Item1": 100683110,
|
||||
"Item2": 3
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435477,
|
||||
"Type": 12,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 46,
|
||||
"Height": 17,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 1073741826,
|
||||
"StateMedia": {},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268435478,
|
||||
"Type": 12,
|
||||
"X": 46,
|
||||
"Y": 0,
|
||||
"Width": 398,
|
||||
"Height": 17,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 2,
|
||||
"FontDid": 1073741824,
|
||||
"StateMedia": {
|
||||
"Normal_focussed": {
|
||||
"Item1": 100667819,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": [
|
||||
{
|
||||
"Id": 268435479,
|
||||
"Type": 3,
|
||||
"X": 0,
|
||||
"Y": 0,
|
||||
"Width": 1,
|
||||
"Height": 17,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 1,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"Normal_focussed": {
|
||||
"Item1": 100683111,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268435480,
|
||||
"Type": 3,
|
||||
"X": 397,
|
||||
"Y": 0,
|
||||
"Width": 1,
|
||||
"Height": 17,
|
||||
"Left": 2,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 2,
|
||||
"FontDid": 0,
|
||||
"StateMedia": {
|
||||
"Normal_focussed": {
|
||||
"Item1": 100683111,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268435481,
|
||||
"Type": 1,
|
||||
"X": 444,
|
||||
"Y": 0,
|
||||
"Width": 46,
|
||||
"Height": 17,
|
||||
"Left": 2,
|
||||
"Top": 1,
|
||||
"Right": 1,
|
||||
"Bottom": 1,
|
||||
"ReadOrder": 3,
|
||||
"FontDid": 1073741826,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100669717,
|
||||
"Item2": 1
|
||||
},
|
||||
"Normal_pressed": {
|
||||
"Item1": 100669718,
|
||||
"Item2": 1
|
||||
},
|
||||
"Ghosted": {
|
||||
"Item1": 100669748,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 268436770,
|
||||
"Type": 1,
|
||||
"X": 0,
|
||||
"Y": 10,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 4,
|
||||
"FontDid": 1073741861,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100688408,
|
||||
"Item2": 1
|
||||
},
|
||||
"Highlight": {
|
||||
"Item1": 100688409,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Id": 268436771,
|
||||
"Type": 1,
|
||||
"X": 0,
|
||||
"Y": 28,
|
||||
"Width": 16,
|
||||
"Height": 16,
|
||||
"Left": 1,
|
||||
"Top": 1,
|
||||
"Right": 2,
|
||||
"Bottom": 2,
|
||||
"ReadOrder": 5,
|
||||
"FontDid": 1073741861,
|
||||
"StateMedia": {
|
||||
"Normal": {
|
||||
"Item1": 100688408,
|
||||
"Item2": 1
|
||||
},
|
||||
"Highlight": {
|
||||
"Item1": 100688409,
|
||||
"Item2": 1
|
||||
}
|
||||
},
|
||||
"DefaultStateName": "Normal",
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue