@ai-ecoverse/slicc-browsers 1.38.0 → 1.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cookie-plant.mjs +25 -3
- package/guard-vectors.json +1 -1
- package/package.json +2 -2
package/cookie-plant.mjs
CHANGED
|
@@ -2713,10 +2713,29 @@ function missedTab(ctx, step, error) {
|
|
|
2713
2713
|
return { ...EMPTY_ATTEMPT, missed: { step, error: boundedError(error, ctx.tag) } };
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
|
+
function refusedTab(ctx, attached, elapsedMs) {
|
|
2717
|
+
return {
|
|
2718
|
+
...attemptRecord(attached.refused, 'incomplete'),
|
|
2719
|
+
missed: {
|
|
2720
|
+
step: attached.step,
|
|
2721
|
+
refused: true,
|
|
2722
|
+
error: boundedError(attached.refused.error, ctx.tag),
|
|
2723
|
+
elapsedMs,
|
|
2724
|
+
},
|
|
2725
|
+
};
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2716
2728
|
function missedPath(name, attempt, notes) {
|
|
2717
2729
|
if (!attempt?.missed) return attempt;
|
|
2718
2730
|
const { missed, ...rest } = attempt;
|
|
2719
2731
|
note(notes, 'cookie-plant.attach', { path: name, ...missed });
|
|
2732
|
+
if (missed.refused)
|
|
2733
|
+
return {
|
|
2734
|
+
...rest,
|
|
2735
|
+
premiseMissed: ['Answered', 'Refused', 'Planted']
|
|
2736
|
+
.filter((field) => rest[field.toLowerCase()] === 'incomplete')
|
|
2737
|
+
.map((field) => `${name}${field}: fresh tab ${missed.step} refused: ${missed.error}`),
|
|
2738
|
+
};
|
|
2720
2739
|
const fields = ['Answered', 'Refused', 'Planted', ...(name === 'deletion' ? ['Cleared'] : [])];
|
|
2721
2740
|
return {
|
|
2722
2741
|
...rest,
|
|
@@ -2736,13 +2755,14 @@ async function withFreshAttemptTab(ctx, run) {
|
|
|
2736
2755
|
const pageTarget = page.result.targetId;
|
|
2737
2756
|
const timing = { pathStartedAt: Date.now() };
|
|
2738
2757
|
const attached = await attachClientPage(client, pageTarget, internalSessions);
|
|
2758
|
+
const attachMs = Date.now() - timing.pathStartedAt;
|
|
2739
2759
|
if (attached.incomplete) {
|
|
2740
2760
|
await outcome(reader.send('Target.closeTarget', { targetId: pageTarget }));
|
|
2741
2761
|
return missedTab(ctx, attached.step, attached.error);
|
|
2742
2762
|
}
|
|
2743
2763
|
if (attached.refused && refused(attached.refused)) {
|
|
2744
2764
|
await outcome(reader.send('Target.closeTarget', { targetId: pageTarget }));
|
|
2745
|
-
return
|
|
2765
|
+
return refusedTab(ctx, attached, attachMs);
|
|
2746
2766
|
}
|
|
2747
2767
|
const pageSession = attached.pageSession;
|
|
2748
2768
|
if (!pageSession) {
|
|
@@ -3892,7 +3912,8 @@ async function attachClientPage(client, pageTarget, internalSessions) {
|
|
|
3892
3912
|
'attachToTarget'
|
|
3893
3913
|
);
|
|
3894
3914
|
if (!attached.ok) {
|
|
3895
|
-
if (sessionCut(attached) || refused(attached))
|
|
3915
|
+
if (sessionCut(attached) || refused(attached))
|
|
3916
|
+
return { refused: attached, step: 'Target.attachToTarget', pageSession: null };
|
|
3896
3917
|
return {
|
|
3897
3918
|
incomplete: `client attach failed: ${attached.error?.message ?? attached.error}`,
|
|
3898
3919
|
step: 'Target.attachToTarget',
|
|
@@ -3909,7 +3930,8 @@ async function attachClientPage(client, pageTarget, internalSessions) {
|
|
|
3909
3930
|
]) {
|
|
3910
3931
|
const enabled = await capped(outcome(client.send(method, {}, pageSession)), 800, label);
|
|
3911
3932
|
if (!enabled.ok) {
|
|
3912
|
-
if (sessionCut(enabled) || refused(enabled))
|
|
3933
|
+
if (sessionCut(enabled) || refused(enabled))
|
|
3934
|
+
return { refused: enabled, step: label, pageSession };
|
|
3913
3935
|
return {
|
|
3914
3936
|
incomplete: `client ${label} failed: ${enabled.error?.message ?? enabled.error}`,
|
|
3915
3937
|
step: label,
|
package/guard-vectors.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-browsers",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.1",
|
|
4
4
|
"description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"test:unit:guard": "mkdir -p coverage/unit && node --experimental-vm-modules --no-warnings --experimental-test-coverage --test --test-concurrency=1 --test-coverage-include=guard-runner.mjs --test-coverage-include=guard-driver.mjs --test-coverage-include=extension-frame.mjs --test-coverage-include=fixture-server.mjs --test-coverage-include=fixture-client.mjs --test-coverage-include=observer-target.mjs --test-coverage-include=frame-read.mjs --test-coverage-include=bfcache-restore.mjs --test-coverage-include=protected-error-page.mjs --test-coverage-include=protected-parent-iframes.mjs --test-coverage-include=unparseable-url.mjs --test-coverage-include=scripts/browser-runner.mjs --test-coverage-include=scripts/validate.mjs --test-reporter=lcov --test-reporter-destination=coverage/unit/guard.lcov test/unit/guard-*.test.mjs && slicc-diff-cover coverage/unit/guard.lcov"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@ai-ecoverse/slicc-cdp": "2.1.
|
|
93
|
+
"@ai-ecoverse/slicc-cdp": "2.1.25",
|
|
94
94
|
"@ai-ecoverse/slicc-shared-web": "2.17.0",
|
|
95
95
|
"@biomejs/biome": "2.6.8",
|
|
96
96
|
"ajv": "8.20.0",
|