feat(app): construct the globe engine with the viewer

The scene builds the page's Cesium engine right after the viewer
(src/app/globeEngine.js), names the startup Google tileset to it once
loaded, returns it beside the viewer and destroys it before the viewer.
The debug handle exposes it as window.__godsEyeView.engine. Nothing
consumes it yet; render holds taken before the governor is installed
apply at install.

qa-globe-contract now runs on the app's engine (self-built only when the
app has none); a throwaway engine checks creation and destroy leave the
scene untouched.
This commit is contained in:
German Khokhlov committed 2026-10-15 18:02:11 +04:00
1 parent ab2368f3f3
commit a5c98c6b07
7 files changed
+141 -2

No files matched your search

+26
View File
@@ -83,6 +83,32 @@ test('startup shares one promise and teardown keeps data alive for controls', as
await assert.rejects(app.start(), /destroyed/);
});
test('later components receive the scene engine beside its viewer', async () => {
const viewer = { name: 'viewer' };
const engine = { kind: 'cesium' };
const seen = [];
const receive =
(phase) =>
({ scene }) => {
seen.push([phase, scene.viewer, scene.engine]);
return { name: phase };
};
const { app } = fixture({
createScene: () => ({ viewer, engine }),
createControls: receive('Controls'),
createData: receive('Data'),
createTools: receive('Tools'),
});
const components = await app.start();
assert.equal(components.scene.engine, engine);
assert.deepEqual(seen, [
['Controls', viewer, engine],
['Data', viewer, engine],
['Tools', viewer, engine],
]);
await app.destroy();
});
for (const phase of phases) {
test(`failure during ${phase} releases partially acquired resources`, async () => {
const { app, events } = fixture({