diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-009.https.html')
-rw-r--r-- | tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-009.https.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-009.https.html b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-009.https.html new file mode 100644 index 00000000000..03c7c690154 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-009.https.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<link rel="match" href="parse-input-arguments-ref.html"> +<style> +.container { + width: 100px; + height: 100px; +} + +#canvas-geometry { + background-image: paint(geometry); +} +</style> +<script src="/common/reftest-wait.js"></script> +<script src="/common/css-paint-tests.js"></script> +<body> +<div id="canvas-geometry" class="container"></div> + +<script id="code" type="text/worklet"> +var testsPassed = false; +try { + var a = function() { }; + a.prototype = undefined; + registerPaint('foo5', a); +} catch(ex) { + if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' object on the class does not exist.") + testsPassed = true; +} + +registerPaint('geometry', class { + paint(ctx, geom) { + if (testsPassed) + ctx.strokeStyle = 'green'; + else + ctx.strokeStyle = 'red'; + ctx.lineWidth = 4; + ctx.strokeRect(0, 0, geom.width, geom.height); + } +}); +</script> + +<script> + importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent); +</script> +</body> +</html> |