https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1d80ed8c6e3c70dc91ecdc3942cf736c974e2490 authored by Behind The Math on 05 April 2018, 03:02:14 UTC
Add tests to check that the User-Agent header is set for XHR requests
Tip revision: 1d80ed8
invalid-image-pending-script.https.html
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="invalid-image-pending-script-ref.html">
<style>
    #output {
        width: 100px;
        height: 100px;
        background-image: paint(invalid), paint(successIndicator);
    }
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="output"></div>

<script id="code" type="text/worklet">
// This is testing that even though there is no paint function registered for
// 'invalid', it won't cause any error, and the other painter (successIndicator)
// will paint as usual.
registerPaint('successIndicator', class {
    paint(ctx, geom) {
        ctx.fillStyle = 'green';
        ctx.fillRect(0, 0, geom.width, geom.height);
    }
});
</script>

<script>
    importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>
</body>
</html>
back to top