mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
IDLGenerators: Handle restricted/unrestricted floating point types
This commit is contained in:
parent
2bd8093449
commit
3e221fbb2d
Notes:
sideshowbarker
2024-07-17 07:09:53 +09:00
Author: https://github.com/mattco98
Commit: 3e221fbb2d
Pull-request: https://github.com/SerenityOS/serenity/pull/24474
8 changed files with 108 additions and 15 deletions
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
function checkException(name, cb) {
|
||||
try {
|
||||
cb();
|
||||
println(`${name}: did not throw an exception`);
|
||||
} catch (e) {
|
||||
println(`${name}: threw an exception`);
|
||||
}
|
||||
}
|
||||
|
||||
// Test invalid values
|
||||
checkException('KeyframeEffect with NaN options value', () => new KeyframeEffect(null, null, NaN));
|
||||
checkException('KeyframeEffect with infinite delay value', () => new KeyframeEffect(null, null, { delay: -Infinity }));;
|
||||
checkException('KeyframeEffect with NaN delay value', () => new KeyframeEffect(null, null, { delay: NaN }));
|
||||
checkException('KeyframeEffect with infinite endDelay value', () => new KeyframeEffect(null, null, { endDelay: Infinity }));
|
||||
checkException('KeyframeEffect with NaN endDelay value', () => new KeyframeEffect(null, null, { endDelay: NaN }));
|
||||
checkException('KeyframeEffect with NaN iterations', () => new KeyframeEffect(null, null, { iterations: NaN }));
|
||||
|
||||
// Test valid values
|
||||
checkException('KeyframeEffect with infinite options value', () => new KeyframeEffect(null, null, Infinity));
|
||||
checkException('KeyframeEffect with finite options value', () => new KeyframeEffect(null, null, 1234.5));
|
||||
checkException('KeyframeEffect with infinite iterations', () => new KeyframeEffect(null, null, { iterations: Infinity }));
|
||||
checkException('KeyframeEffect with infinite duration', () => new KeyframeEffect(null, null, { duration: Infinity }));
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue