https://github.com/web-platform-tests/wpt
Raw File
Tip revision: c424923d34fe8256abb1f4ca75bd1aef256c5a63 authored by Boris Zbarsky on 13 February 2018, 03:37:24 UTC
Use a null prototype for @@unscopables objects in the DOM.
Tip revision: c424923
worklet-reftest.js
// To make sure that we take the snapshot at the right time, we do double
// requestAnimationFrame. In the second frame, we take a screenshot, that makes
// sure that we already have a full frame.
function importWorkletAndTerminateTestAfterAsyncPaint(worklet, code) {
    if (typeof worklet == "undefined") {
        takeScreenshot();
    } else {
        var blob = new Blob([code], {type: 'text/javascript'});
        worklet.addModule(URL.createObjectURL(blob)).then(function() {
            requestAnimationFrame(function() {
                requestAnimationFrame(function() {
                    takeScreenshot();
                });
            });
        });
    }
}

back to top