Skip to content

Commit a607e0b

Browse files
committed
Added debugging to form show
1 parent 12144ce commit a607e0b

2 files changed

Lines changed: 47 additions & 6 deletions

File tree

Ports/JavaScriptPort/STATUS.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Current State
1616
- `TOP_BLOCKER=none|none|none`
1717
- The screenshot pipeline now decodes/report-generates reliably from logs, but screenshot content is still mostly wrong (white-frame capture path is still being used in CI artifacts).
1818
- New patch (not yet CI-validated in this document revision): worker-side fallback screenshot path now waits for a host-side UI-settle barrier before ready-callback dispatch and before canvas capture, to avoid pre-paint frame capture.
19+
- New patch (not yet CI-validated in this document revision): `BaseTest.registerReadyCallback` fallback now attempts to force-show the target `Form` before UI-settle/callback dispatch to avoid running screenshot setup against a stale previous form.
1920

2021
What Was Fixed In This Pass
2122
---------------------------
@@ -86,6 +87,18 @@ What Was Fixed In This Pass
8687
- Motivation:
8788
- CI showed near-identical screenshot payloads (same hash/size) indicating repeated capture of a stale frame rather than per-test painted UI.
8889

90+
8. Added force-show step in ready-callback fallback for per-test form activation.
91+
- File:
92+
- `Ports/JavaScriptPort/src/main/webapp/port.js`
93+
- Changes:
94+
- In `BaseTest.registerReadyCallbackImmediate`, attempt `Form.show()` before UI-settle and callback execution.
95+
- Added diagnostics:
96+
- `PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=1:...`
97+
- `PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=0:...`
98+
- `PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=formMissing:...`
99+
- Motivation:
100+
- CI diagnostics showed canvas signature locking to a single frame after initial tests, consistent with callbacks running while stale form remains active.
101+
89102
Known Failing Symptoms (Latest CI Logs/Artifacts)
90103
-------------------------------------------------
91104

@@ -110,11 +123,14 @@ Priority Next Steps
110123
1. Validate CI output after UI-settle barrier:
111124
- Expect non-identical PNG hashes for distinct tests.
112125
- Confirm `settleChanged` and `canvasSig` diagnostics vary across tests.
113-
2. If white-frame reuse persists, capture and compare per-test `settleSig`/`canvasSig` to identify whether paint is not happening or capture target is wrong.
114-
3. Fix per-test null receiver/init path (`__classDef` null) at first failing stack, not via broad fallbacks.
115-
4. Fix missing `Button.initLaf(UIManager)` symbol resolution in worker runtime path.
116-
5. Fix worker-mode orientation lock path so DOM access is host-bridge mediated (no direct `document` access in worker).
117-
6. Confirm VM completeness stability in CI with parser/runtime patches (`expected 7` consistently).
126+
2. Validate force-show diagnostics in CI:
127+
- Expect `forceShow=1` for screenshot tests with forms.
128+
- Expect per-test `canvasSig` to vary for graphics tests if activation works.
129+
3. If white-frame reuse persists, capture and compare per-test `settleSig`/`canvasSig` to identify whether paint is not happening or capture target is wrong.
130+
4. Fix per-test null receiver/init path (`__classDef` null) at first failing stack, not via broad fallbacks.
131+
5. Fix missing `Button.initLaf(UIManager)` symbol resolution in worker runtime path.
132+
6. Fix worker-mode orientation lock path so DOM access is host-bridge mediated (no direct `document` access in worker).
133+
7. Confirm VM completeness stability in CI with parser/runtime patches (`expected 7` consistently).
118134

119135
Files Touched In This Pass
120136
--------------------------

Ports/JavaScriptPort/src/main/webapp/port.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3236,12 +3236,37 @@ bindCiFallback("BaseTest.registerReadyCallbackImmediate", [
32363236
baseTestRegisterReadyCallbackMethodId + "__impl"
32373237
], function*(_baseTest, _form, callback) {
32383238
const activeTest = normalizeCn1ssTestName(cn1ssActiveTestName || "default");
3239+
if (_form && _form.__class) {
3240+
let showInvoked = false;
3241+
const showMethodIds = [
3242+
"cn1_com_codename1_ui_Form_show",
3243+
"cn1_com_codename1_ui_Form_show__"
3244+
];
3245+
for (let i = 0; i < showMethodIds.length && !showInvoked; i++) {
3246+
const methodId = showMethodIds[i];
3247+
try {
3248+
const showMethod = jvm.resolveVirtual(_form.__class, methodId);
3249+
if (typeof showMethod === "function") {
3250+
yield* showMethod(_form);
3251+
showInvoked = true;
3252+
emitDiagLine("PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=1:test=" + activeTest + ":method=" + methodId);
3253+
}
3254+
} catch (_showErr) {
3255+
// Try next candidate method id.
3256+
}
3257+
}
3258+
if (!showInvoked) {
3259+
emitDiagLine("PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=0:test=" + activeTest);
3260+
}
3261+
} else {
3262+
emitDiagLine("PARPAR:DIAG:FALLBACK:baseTestRegisterReady:forceShow=formMissing:test=" + activeTest);
3263+
}
32393264
let settleChanged = "na";
32403265
if (jvm && typeof jvm.invokeHostNative === "function") {
32413266
try {
32423267
const settleResult = yield jvm.invokeHostNative("__cn1_wait_for_ui_settle__", [{
32433268
reason: "ready:" + activeTest,
3244-
maxFrames: 24,
3269+
maxFrames: 36,
32453270
stableFrames: 2
32463271
}]);
32473272
if (settleResult && settleResult.changedFromPrevious != null) {

0 commit comments

Comments
 (0)