https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 190c3feba3a42cbc4c32facd7994c190589d889e authored by Liam R. E. Quin on 26 March 2018, 01:04:45 UTC
[svg 2 text] test for length and indexed access
Tip revision: 190c3fe
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