Load the default renderer as the page starts, and follow through the camera port in tests

- The standalone page starts loading the default renderer as it starts
  (loadDefaultRenderer), so Cesium arrives beside the page's own setup,
  not after it; the scene takes a plugin or a promise of one.
- Where a follow target's layer has no display position yet, the followed
  position is the target's own position at the frame port's scene time.
- The globe engine's photoreal base that fails to come back is off again
  and the globe shown; a later switch tries again. The draped-imagery host
  asks the map engine whether the globe is shown where the renderer cannot
  say. The scene resizes the renderer with its container.
- Cockpit and voice tests follow through the camera port (followEntity),
  not by setting the viewer's tracked entity; the fake frame port has a
  scene time.
This commit is contained in:
Sameh Khamis committed 2026-11-10 17:44:29 -08:00
1 parent 6daf63d90c
commit ae4fbb5053
21 files changed
+328 -87

No files matched your search

+16 -4
View File
@@ -36,7 +36,8 @@ import { presentResult } from './resultDisplay.js';
import { withEntityRecord } from '../data/entityRecords.js';
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
import { fakeSceneQuery } from '../testSupport/fakeCesiumScene.mjs';
import { cameraOf } from '../render/rendererOf.js';
import { bindRenderer, cameraOf } from '../render/rendererOf.js';
import { entityFollowTarget } from '../data/followed.js';
test('every live basemap is reachable by its own id — no enum value without a voice alias', () => {
// B1 regression: a stack added to MAP_STACKS (and the set_map_stack enum)
@@ -1505,7 +1506,6 @@ test('voice Stop Tracking reports exact layers whose active or durable clear fai
getAll: () => [],
};
const viewer = {
trackedEntity: withEntityRecord({}, { trackedId: 'flights:active' }),
scene: {
canvas: { addEventListener() {}, removeEventListener() {} },
preRender: { addEventListener() {} },
@@ -1513,6 +1513,18 @@ test('voice Stop Tracking reports exact layers whose active or durable clear fai
camera: { moveEnd: { addEventListener() {} } },
clock: { onTick: { addEventListener() {} } },
};
// The camera follows the active aircraft through its port.
const camera = {
followed: entityFollowTarget(
withEntityRecord({}, { trackedId: 'flights:active' }),
{},
),
follow(target) {
camera.followed = target;
},
on: () => () => {},
};
bindRenderer(viewer, { camera, canvas: viewer.scene.canvas });
const runner = createGevActionRunner({
viewer,
styleManager: {},
@@ -1527,8 +1539,8 @@ test('voice Stop Tracking reports exact layers whose active or durable clear fai
error: 'Tracking could not be cleared for: flights, military',
});
assert.equal(
viewer.trackedEntity,
undefined,
camera.followed,
null,
'camera ownership still releases after partial failure',
);
});