Request frames again while waiting for tiles and transitions

A request-mode globe updates its tile state only on drawn frames, so tile
and UI readiness that never asked for one waited until something else
drew: imagery, weather and ground scenarios took several times longer.
The idle checks measure through their own passive observer and are not
affected.
This commit is contained in:
German Khokhlov committed 2026-11-10 21:25:08 +04:00
1 parent 555906da6b
commit 97e192ebce
2 files changed
+7 -4

No files matched your search

+3
View File
@@ -210,6 +210,8 @@ export async function whenTilesLoaded(page, { timeoutMs = 30000 } = {}) {
() => {
const engine = window.__godsEyeView?.engine;
if (!engine || engine.isDestroyed()) return false;
// A request-mode globe only updates tile state on drawn frames.
engine.render.request('qa-tile-readiness');
return engine.surface.tilesLoaded();
},
{ timeout: timeoutMs, polling: 100 },
@@ -221,6 +223,7 @@ export async function whenUiSettled(page) {
const handle = await page.waitForFunction(
() => {
const app = window.__godsEyeView;
app?.engine?.render.request('qa-ui-readiness');
return (
!app?.styleManager?.transitions?.size &&
document
+4 -4
View File
@@ -287,7 +287,7 @@ test('camera readiness also waits for the startup cover to stop intercepting cli
});
});
test('tile and UI polling never request globe frames', async (t) => {
test('tile and UI polling request frames so a request-mode globe progresses', async (t) => {
const { engine } = pageEngine(t);
const previous = globalThis.document;
globalThis.document = { getAnimations: () => [] };
@@ -295,9 +295,8 @@ test('tile and UI polling never request globe frames', async (t) => {
if (previous === undefined) delete globalThis.document;
else globalThis.document = previous;
});
t.mock.method(engine.render, 'request', () => {
assert.fail('passive readiness requested a frame');
});
const reasons = [];
t.mock.method(engine.render, 'request', (reason) => reasons.push(reason));
const page = {
async waitForFunction(predicate) {
assert.equal(predicate(), true);
@@ -306,4 +305,5 @@ test('tile and UI polling never request globe frames', async (t) => {
};
await whenTilesLoaded(page);
await whenUiSettled(page);
assert.deepEqual(reasons, ['qa-tile-readiness', 'qa-ui-readiness']);
});