| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="resources/test-runner-paint-helper.js"></script> | |
| 5 <script> | |
| 6 function runTest() { | |
| 7 runner([{ | |
| 8 expectedError: "A class with name:'foo' is already registered.", | |
| 9 script: "registerPaint('foo', class { paint() { } }); registerPaint('foo
', class { paint() { } });", | |
| 10 }, { | |
| 11 expectedError: "The empty string is not a valid name.", | |
| 12 script: "registerPaint('', class { });", | |
| 13 }, { | |
| 14 expectedError: "failed!", | |
| 15 script: "registerPaint('foo3', class { static get inputProperties() { th
row Error('failed!'); } });", | |
| 16 }, { | |
| 17 expectedError: "The value provided is neither an array, nor does it have
indexed properties.", | |
| 18 script: "registerPaint('foo4', class { static get inputProperties() { re
turn 42; } });", | |
| 19 }, { | |
| 20 expectedError: "The 'prototype' object on the class does not exist.", | |
| 21 script: "var a = function() { }; a.prototype = undefined; registerPaint(
'foo5', a);", | |
| 22 }, { | |
| 23 expectedError: "The 'prototype' property on the class is not an object."
, | |
| 24 script: "var b = function() { }; b.prototype = 42; registerPaint('foo6',
b);", | |
| 25 }, { | |
| 26 expectedError: "The 'paint' function on the prototype does not exist.", | |
| 27 script: "registerPaint('foo7', class { });", | |
| 28 }, { | |
| 29 expectedError: "The 'paint' property on the prototype is not a function.
", | |
| 30 script: "registerPaint('foo8', class { get paint() { return 42; } });", | |
| 31 }, { | |
| 32 script: "registerPaint('foo9', class { paint() { } }); console.log('Succ
ess for \\'foo9\\'.');", | |
| 33 }, { | |
| 34 script: "var c = function() { }; c.prototype.paint = function() { }; reg
isterPaint('foo10', c); console.log('Success for \\'foo10\\'.');", | |
| 35 }, { | |
| 36 script: "registerPaint('foo11', class { static get inputProperties() { r
eturn ['-webkit-border-radius']; } paint() { } }); console.log('Success for \\'f
oo11\\'.');" | |
| 37 }, { | |
| 38 expectedError: "The 'alpha' property on the class is not a boolean.", | |
| 39 script: "registerPaint('foo12', class { static get alpha() { return 42;
} });", | |
| 40 }, { | |
| 41 script: "registerPaint('foo13', class { static get alpha() { return true
; } paint() { } }); console.log('Success for \\'foo13\\'.');", | |
| 42 }]); | |
| 43 } | |
| 44 </script> | |
| 45 </head> | |
| 46 <body onload="runTest()"> | |
| 47 <p>This tests a series of PaintWorkletGlobalScope#registerPaint calls.</p> | |
| 48 <p>See the devtools console for test output.</p> | |
| 49 </body> | |
| 50 </html> | |
| OLD | NEW |