diff options
author | Josh Matthews <josh@joshmatthews.net> | 2017-11-15 12:15:13 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2017-11-15 12:47:30 -0500 |
commit | c227604a2c79a247011a5d986a943a2ae911bab2 (patch) | |
tree | 01e72ba2a8a61b56fbbbb6f465e2a9a2c249bd89 /tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html | |
parent | 85fa6409bb699647b4f5e22952538365e87418d7 (diff) | |
download | servo-c227604a2c79a247011a5d986a943a2ae911bab2.tar.gz servo-c227604a2c79a247011a5d986a943a2ae911bab2.zip |
Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html')
-rw-r--r-- | tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html new file mode 100644 index 00000000000..ff388deeab7 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-003.https.html @@ -0,0 +1,48 @@ +<!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 { + registerPaint('foo2', class { + static get inputArguments() { + return ['<non-sense-type>']; + } + }); +} catch(ex) { + if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': Invalid argument types.") + 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> |