| Index: third_party/WebKit/LayoutTests/csspaint/register-failed.html
|
| diff --git a/third_party/WebKit/LayoutTests/csspaint/register-failed.html b/third_party/WebKit/LayoutTests/csspaint/register-failed.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..aefa902b9aee1586070d9f2dabf0938468ad447d
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/csspaint/register-failed.html
|
| @@ -0,0 +1,44 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script>
|
| +function runner(tests) {
|
| + if (window.testRunner) {
|
| + testRunner.waitUntilDone();
|
| + testRunner.dumpAsText();
|
| + }
|
| +
|
| + tests.reduce(function(chain, obj) {
|
| + return chain.then(function() {
|
| + console.log('The worklet should throw an error with: "' + obj.expectedError + '"');
|
| + var blob = new Blob([obj.script], {type: 'text/javascript'});
|
| + return paintWorklet.import(URL.createObjectURL(blob));
|
| + });
|
| + }, Promise.resolve()).then(function() {
|
| + if (window.testRunner) {
|
| + testRunner.notifyDone();
|
| + }
|
| + });
|
| +}
|
| +
|
| +function runTest() {
|
| + runner([{
|
| + expectedError: "A class with name:'foo' is already registered.",
|
| + script: "registerPaint('foo', class { }); registerPaint('foo', class { });",
|
| + }, {
|
| + expectedError: "The empty string is not a valid name.",
|
| + script: "registerPaint('', class { });",
|
| + }, {
|
| + expectedError: "failed!",
|
| + script: "registerPaint('foo3', class { static get inputProperties() { throw Error('failed!'); } });",
|
| + }, {
|
| + expectedError: "The value provided is neither an array, nor does it have indexed properties.",
|
| + script: "registerPaint('foo4', class { static get inputProperties() { return 42; } });",
|
| + }]);
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>This test imports a </p>
|
| +</body>
|
| +</html>
|
|
|