Verify public debug API disabled
This commit is contained in:
@@ -43,6 +43,7 @@ try {
|
||||
return {
|
||||
title: document.title,
|
||||
canvasCount: document.querySelectorAll('canvas').length,
|
||||
debugApiPresent: Boolean(window.__HEROS_DEBUG__),
|
||||
canvas: canvas
|
||||
? {
|
||||
width: canvas.width,
|
||||
@@ -88,6 +89,7 @@ try {
|
||||
|
||||
assert(state.title?.trim().length > 0, `Expected deployed page title: ${JSON.stringify(state)}`);
|
||||
assert(state.canvasCount === 1, `Expected exactly one game canvas: ${JSON.stringify(state)}`);
|
||||
assert(state.debugApiPresent === false, `Expected public deploy to keep debug API disabled: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas?.width >= 960 && state.canvas?.height >= 540, `Expected desktop-size game canvas: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas?.pixelProbe?.readable === true, `Expected readable canvas pixels: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas.pixelProbe.sampleCount >= 500, `Expected enough canvas pixel samples: ${JSON.stringify(state)}`);
|
||||
|
||||
Reference in New Issue
Block a user