27 lines
3 KiB
JavaScript
27 lines
3 KiB
JavaScript
'use strict';
|
|
const {assert,functionSource,app,css,buildMeta}=require('./helpers/app-source');
|
|
const fs=require('fs'),path=require('path'),frameScheduler=fs.readFileSync(path.join(__dirname,'../client/input/frame-scheduler.js'),'utf8');
|
|
for(const name of ['scheduleBoardDragFrame','queueCameraInteraction','scheduleWorldOverview','schedulePresenceRender','scheduleReactionRender']){
|
|
const source=functionSource(name);
|
|
if(name==='queueCameraInteraction')assert(source.includes('cameraInteractionScheduler.push')&&frameScheduler.includes('clearArmed()'),'Camera missed-vsync fallback does not cancel its paired scheduler');
|
|
else if(name==='scheduleBoardDragFrame')assert(source.includes('requestFrame')&&frameScheduler.includes('clearArmed()'),'Pickup missed-vsync fallback does not cancel its paired scheduler');
|
|
else if(name!=='scheduleWorldOverview')assert(!source.includes('setTimeout('),`${name} still double-throttles through setTimeout plus requestAnimationFrame`);
|
|
if(name==='scheduleBoardDragFrame'||name==='queueCameraInteraction')assert(frameScheduler.includes('requestFrame(step)'),`${name} must use the shared frame-synchronized lane`);
|
|
else assert(source.includes('requestAnimationFrame'),`${name} must remain frame-synchronized`);
|
|
}
|
|
const minimap=functionSource('scheduleMinimap');
|
|
assert(minimap.includes("interactionActive('overview')"),'Minimap must not repaint during an active gesture');
|
|
const overview=functionSource('drawWorldOverview');
|
|
assert(functionSource('positionCachedWorldOverview').includes('overviewCanvas.style.transform'),'Overview panning must move the cached bitmap as a compositor layer');
|
|
assert(functionSource('scheduleWorldOverview').includes('requestIdleCallback'),'Overview cache rebuilds must be deferred to idle time');
|
|
assert(overview.includes('overviewBitmapCopies'),'Overview bitmap copy must only occur during cache rebuild');
|
|
assert(!overview.includes('sourceX='),'Overview must not copy a viewport-sized sub-rectangle every pan frame');
|
|
const camera=functionSource('applyCamera');
|
|
assert(camera.includes('translate3d('),'Nearby field panning must use a compositor transform');
|
|
assert(camera.includes('shiftOnlineLayersForCamera'),'Online canvases must move without full repaint during camera gestures');
|
|
assert(camera.includes('minimapDirty=true'),'Camera movement must mark, not immediately repaint, the minimap');
|
|
assert(functionSource('boardPlayHudVisible').includes('hudBoardId===b?.id')&&functionSource('activateBoardPointerDrag').includes('activateBoardHud(b)'),'Persistent manipulated-board HUD gating changed unexpectedly');
|
|
assert(!css.includes('#viewport.panning::after{display:none}')&&!css.includes('#world.camera-interacting'),'Panning still activates an automatic lightweight visual mode');
|
|
assert(css.includes('#presenceCanvas,#reactionCanvas{transform-origin:0 0'),'Online canvases are not compositor-ready');
|
|
assert(buildMeta.APP_VERSION==='47.83','Application version was not advanced');
|
|
console.log('v47.83 compositor frame-pipeline regression test passed');
|