Revert "DEV: Allow afterFramePaint to be used in tests (#27226)" (#27228)

This reverts commit 63b7b598cb.

Causing issues in production builds
This commit is contained in:
David Taylor 2024-05-28 14:01:10 +01:00 committed by GitHub
parent d0427919f1
commit 531fc1d754
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 9 deletions

View File

@ -1,13 +1,8 @@
import { registerWaiter } from "@ember/test";
/**
* Runs `callback` shortly after the next browser Frame is produced.
* ref: https://webperf.tips/tip/measuring-paint-time
*/
export default function runAfterFramePaint(callback) {
let done = false;
registerWaiter(() => done);
// Queue a "before Render Steps" callback via requestAnimationFrame.
requestAnimationFrame(() => {
// MessageChannel is one of the highest priority task queues
@ -15,10 +10,7 @@ export default function runAfterFramePaint(callback) {
const messageChannel = new MessageChannel();
// Setup the callback to run in a Task
messageChannel.port1.onmessage = () => {
done = true;
callback();
};
messageChannel.port1.onmessage = callback;
// Queue the Task on the Task Queue
messageChannel.port2.postMessage(undefined);