mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-12 06:12:18 +00:00
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:
1 parent
555906da6b
commit
97e192ebce
2 files changed
+7
-4
No files matched your search
@@ -210,6 +210,8 @@ export async function whenTilesLoaded(page, { timeoutMs = 30000 } = {}) {
|
|||||||
() => {
|
() => {
|
||||||
const engine = window.__godsEyeView?.engine;
|
const engine = window.__godsEyeView?.engine;
|
||||||
if (!engine || engine.isDestroyed()) return false;
|
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();
|
return engine.surface.tilesLoaded();
|
||||||
},
|
},
|
||||||
{ timeout: timeoutMs, polling: 100 },
|
{ timeout: timeoutMs, polling: 100 },
|
||||||
@@ -221,6 +223,7 @@ export async function whenUiSettled(page) {
|
|||||||
const handle = await page.waitForFunction(
|
const handle = await page.waitForFunction(
|
||||||
() => {
|
() => {
|
||||||
const app = window.__godsEyeView;
|
const app = window.__godsEyeView;
|
||||||
|
app?.engine?.render.request('qa-ui-readiness');
|
||||||
return (
|
return (
|
||||||
!app?.styleManager?.transitions?.size &&
|
!app?.styleManager?.transitions?.size &&
|
||||||
document
|
document
|
||||||
|
|||||||
@@ -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 { engine } = pageEngine(t);
|
||||||
const previous = globalThis.document;
|
const previous = globalThis.document;
|
||||||
globalThis.document = { getAnimations: () => [] };
|
globalThis.document = { getAnimations: () => [] };
|
||||||
@@ -295,9 +295,8 @@ test('tile and UI polling never request globe frames', async (t) => {
|
|||||||
if (previous === undefined) delete globalThis.document;
|
if (previous === undefined) delete globalThis.document;
|
||||||
else globalThis.document = previous;
|
else globalThis.document = previous;
|
||||||
});
|
});
|
||||||
t.mock.method(engine.render, 'request', () => {
|
const reasons = [];
|
||||||
assert.fail('passive readiness requested a frame');
|
t.mock.method(engine.render, 'request', (reason) => reasons.push(reason));
|
||||||
});
|
|
||||||
const page = {
|
const page = {
|
||||||
async waitForFunction(predicate) {
|
async waitForFunction(predicate) {
|
||||||
assert.equal(predicate(), true);
|
assert.equal(predicate(), true);
|
||||||
@@ -306,4 +305,5 @@ test('tile and UI polling never request globe frames', async (t) => {
|
|||||||
};
|
};
|
||||||
await whenTilesLoaded(page);
|
await whenTilesLoaded(page);
|
||||||
await whenUiSettled(page);
|
await whenUiSettled(page);
|
||||||
|
assert.deepEqual(reasons, ['qa-tile-readiness', 'qa-ui-readiness']);
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user