aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html')
-rw-r--r--tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html b/tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html
index c4cf755f9b5..e19fa417e93 100644
--- a/tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html
+++ b/tests/wpt/web-platform-tests/css/css-paint-api/invalid-image-pending-script.https.html
@@ -5,16 +5,28 @@
#output {
width: 100px;
height: 100px;
- background-image: paint(invalid);
- background-color: green;
+ background-image: paint(invalid), paint(successIndicator);
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/css-paint-tests.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>
- importPaintWorkletAndTerminateTestAfterAsyncPaint("");
+ importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent);
</script>
</body>
</html>