From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/worklet/tests/common.js | 23 ++ dom/worklet/tests/dynamic_import.js | 7 + dom/worklet/tests/invalid_specifier.mjs | 3 + dom/worklet/tests/mochitest.ini | 40 +++ dom/worklet/tests/server_import_with_cache.sjs | 12 + dom/worklet/tests/specifier_with_user.mjs | 3 + dom/worklet/tests/test_audioWorklet.html | 53 +++ ...t_audioWorkletGlobalScopeRegisterProcessor.html | 78 +++++ dom/worklet/tests/test_audioWorklet_WASM.html | 85 +++++ .../tests/test_audioWorklet_insecureContext.html | 29 ++ dom/worklet/tests/test_audioWorklet_options.html | 81 +++++ dom/worklet/tests/test_basic.html | 66 ++++ dom/worklet/tests/test_console.html | 54 +++ dom/worklet/tests/test_dump.html | 30 ++ dom/worklet/tests/test_dynamic_import.html | 54 +++ dom/worklet/tests/test_exception.html | 73 ++++ dom/worklet/tests/test_fetch_failed.html | 39 +++ dom/worklet/tests/test_import_with_cache.html | 49 +++ dom/worklet/tests/test_paintWorklet.html | 49 +++ dom/worklet/tests/test_promise.html | 57 +++ dom/worklet/tests/worklet_audioWorklet.js | 16 + dom/worklet/tests/worklet_audioWorklet_WASM.js | 16 + dom/worklet/tests/worklet_audioWorklet_options.js | 12 + dom/worklet/tests/worklet_console.js | 1 + dom/worklet/tests/worklet_dump.js | 1 + dom/worklet/tests/worklet_exception.js | 1 + dom/worklet/tests/worklet_paintWorklet.js | 5 + dom/worklet/tests/worklet_promise.js | 22 ++ ...est_audioWorkletGlobalScopeRegisterProcessor.js | 384 +++++++++++++++++++++ 29 files changed, 1343 insertions(+) create mode 100644 dom/worklet/tests/common.js create mode 100644 dom/worklet/tests/dynamic_import.js create mode 100644 dom/worklet/tests/invalid_specifier.mjs create mode 100644 dom/worklet/tests/mochitest.ini create mode 100644 dom/worklet/tests/server_import_with_cache.sjs create mode 100644 dom/worklet/tests/specifier_with_user.mjs create mode 100644 dom/worklet/tests/test_audioWorklet.html create mode 100644 dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html create mode 100644 dom/worklet/tests/test_audioWorklet_WASM.html create mode 100644 dom/worklet/tests/test_audioWorklet_insecureContext.html create mode 100644 dom/worklet/tests/test_audioWorklet_options.html create mode 100644 dom/worklet/tests/test_basic.html create mode 100644 dom/worklet/tests/test_console.html create mode 100644 dom/worklet/tests/test_dump.html create mode 100644 dom/worklet/tests/test_dynamic_import.html create mode 100644 dom/worklet/tests/test_exception.html create mode 100644 dom/worklet/tests/test_fetch_failed.html create mode 100644 dom/worklet/tests/test_import_with_cache.html create mode 100644 dom/worklet/tests/test_paintWorklet.html create mode 100644 dom/worklet/tests/test_promise.html create mode 100644 dom/worklet/tests/worklet_audioWorklet.js create mode 100644 dom/worklet/tests/worklet_audioWorklet_WASM.js create mode 100644 dom/worklet/tests/worklet_audioWorklet_options.js create mode 100644 dom/worklet/tests/worklet_console.js create mode 100644 dom/worklet/tests/worklet_dump.js create mode 100644 dom/worklet/tests/worklet_exception.js create mode 100644 dom/worklet/tests/worklet_paintWorklet.js create mode 100644 dom/worklet/tests/worklet_promise.js create mode 100644 dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js (limited to 'dom/worklet/tests') diff --git a/dom/worklet/tests/common.js b/dom/worklet/tests/common.js new file mode 100644 index 0000000000..df6005cfe4 --- /dev/null +++ b/dom/worklet/tests/common.js @@ -0,0 +1,23 @@ +window.onload = function () { + // We are the parent. Let's load the test. + if (parent == this || !location.search.includes("worklet_iframe")) { + SimpleTest.waitForExplicitFinish(); + + configureTest().then(() => { + var iframe = document.createElement("iframe"); + iframe.src = location.href + "?worklet_iframe"; + document.body.appendChild(iframe); + }); + + return; + } + + // Here we are in the iframe. + window.SimpleTest = parent.SimpleTest; + window.is = parent.is; + window.isnot = parent.isnot; + window.ok = parent.ok; + window.info = parent.info; + + runTestInIframe(); +}; diff --git a/dom/worklet/tests/dynamic_import.js b/dom/worklet/tests/dynamic_import.js new file mode 100644 index 0000000000..a5196d212f --- /dev/null +++ b/dom/worklet/tests/dynamic_import.js @@ -0,0 +1,7 @@ +import("./empty-worklet-script.js") + .then(() => { + console.log("Fail"); + }) + .catch(e => { + console.log(e.name + ": Success"); + }); diff --git a/dom/worklet/tests/invalid_specifier.mjs b/dom/worklet/tests/invalid_specifier.mjs new file mode 100644 index 0000000000..128b60ffa6 --- /dev/null +++ b/dom/worklet/tests/invalid_specifier.mjs @@ -0,0 +1,3 @@ +/* eslint-disable import/no-unassigned-import */ +/* eslint-disable import/no-unresolved */ +import "foo"; diff --git a/dom/worklet/tests/mochitest.ini b/dom/worklet/tests/mochitest.ini new file mode 100644 index 0000000000..ebc85359cb --- /dev/null +++ b/dom/worklet/tests/mochitest.ini @@ -0,0 +1,40 @@ +[DEFAULT] +scheme = https +support-files = + common.js + +[test_audioWorklet.html] +support-files=worklet_audioWorklet.js +[test_audioWorkletGlobalScopeRegisterProcessor.html] +support-files=worklet_test_audioWorkletGlobalScopeRegisterProcessor.js +[test_audioWorklet_WASM.html] +skip-if = release_or_beta # requires dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled +support-files=worklet_audioWorklet_WASM.js +[test_audioWorklet_insecureContext.html] +scheme = http +skip-if = + http3 +[test_audioWorklet_options.html] +skip-if = release_or_beta # requires dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled +support-files=worklet_audioWorklet_options.js +[test_basic.html] +[test_console.html] +support-files=worklet_console.js +[test_dump.html] +support-files=worklet_dump.js +[test_dynamic_import.html] +support-files=dynamic_import.js +[test_exception.html] +support-files = + worklet_exception.js + invalid_specifier.mjs +[test_fetch_failed.html] +support-files=specifier_with_user.mjs +[test_import_with_cache.html] +skip-if = verify +support-files=server_import_with_cache.sjs +[test_paintWorklet.html] +skip-if = release_or_beta +support-files=worklet_paintWorklet.js +[test_promise.html] +support-files=worklet_promise.js diff --git a/dom/worklet/tests/server_import_with_cache.sjs b/dom/worklet/tests/server_import_with_cache.sjs new file mode 100644 index 0000000000..ed34a7a72f --- /dev/null +++ b/dom/worklet/tests/server_import_with_cache.sjs @@ -0,0 +1,12 @@ +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/javascript", false); + + var state = getState("alreadySent"); + if (!state) { + setState("alreadySent", "1"); + } else { + response.setStatusLine("1.1", 404, "Not Found"); + } + + response.write("42"); +} diff --git a/dom/worklet/tests/specifier_with_user.mjs b/dom/worklet/tests/specifier_with_user.mjs new file mode 100644 index 0000000000..3d9bdb45cf --- /dev/null +++ b/dom/worklet/tests/specifier_with_user.mjs @@ -0,0 +1,3 @@ +/* eslint-disable import/no-unassigned-import */ +/* eslint-disable import/no-unresolved */ +import "http://user@example1.com/a.js"; diff --git a/dom/worklet/tests/test_audioWorklet.html b/dom/worklet/tests/test_audioWorklet.html new file mode 100644 index 0000000000..f7f3665e2f --- /dev/null +++ b/dom/worklet/tests/test_audioWorklet.html @@ -0,0 +1,53 @@ + + + + Test for AudioWorklet + + + + + + + + + diff --git a/dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html b/dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html new file mode 100644 index 0000000000..c26df05ad0 --- /dev/null +++ b/dom/worklet/tests/test_audioWorkletGlobalScopeRegisterProcessor.html @@ -0,0 +1,78 @@ + + + + Test for AudioWorklet + + + + + + + + + diff --git a/dom/worklet/tests/test_audioWorklet_WASM.html b/dom/worklet/tests/test_audioWorklet_WASM.html new file mode 100644 index 0000000000..127cc8b924 --- /dev/null +++ b/dom/worklet/tests/test_audioWorklet_WASM.html @@ -0,0 +1,85 @@ + + + + Test for AudioWorklet + WASM + + + + + + + + + + diff --git a/dom/worklet/tests/test_audioWorklet_insecureContext.html b/dom/worklet/tests/test_audioWorklet_insecureContext.html new file mode 100644 index 0000000000..3cbb419ac3 --- /dev/null +++ b/dom/worklet/tests/test_audioWorklet_insecureContext.html @@ -0,0 +1,29 @@ + + + + Test for No AudioWorklet in insecure context + + + + + + + + + diff --git a/dom/worklet/tests/test_audioWorklet_options.html b/dom/worklet/tests/test_audioWorklet_options.html new file mode 100644 index 0000000000..df7a8b5649 --- /dev/null +++ b/dom/worklet/tests/test_audioWorklet_options.html @@ -0,0 +1,81 @@ + + + + Test for AudioWorklet + Options + WASM + + + + + + + + diff --git a/dom/worklet/tests/test_basic.html b/dom/worklet/tests/test_basic.html new file mode 100644 index 0000000000..b13cadd6d1 --- /dev/null +++ b/dom/worklet/tests/test_basic.html @@ -0,0 +1,66 @@ + + + + Test for Worklet + + + + + + + + + diff --git a/dom/worklet/tests/test_console.html b/dom/worklet/tests/test_console.html new file mode 100644 index 0000000000..c33b93001f --- /dev/null +++ b/dom/worklet/tests/test_console.html @@ -0,0 +1,54 @@ + + + + Test for Worklet - Console + + + + + + + + + diff --git a/dom/worklet/tests/test_dump.html b/dom/worklet/tests/test_dump.html new file mode 100644 index 0000000000..f7885a1e21 --- /dev/null +++ b/dom/worklet/tests/test_dump.html @@ -0,0 +1,30 @@ + + + + Test for Worklet - Console + + + + + + + + + diff --git a/dom/worklet/tests/test_dynamic_import.html b/dom/worklet/tests/test_dynamic_import.html new file mode 100644 index 0000000000..e0326b976c --- /dev/null +++ b/dom/worklet/tests/test_dynamic_import.html @@ -0,0 +1,54 @@ + + + + Test import() should throw a TypeError for Worklets + + + + + + + + + diff --git a/dom/worklet/tests/test_exception.html b/dom/worklet/tests/test_exception.html new file mode 100644 index 0000000000..598dc859f3 --- /dev/null +++ b/dom/worklet/tests/test_exception.html @@ -0,0 +1,73 @@ + + + + Test for Exception in Worklet script + + + + + + + + + diff --git a/dom/worklet/tests/test_fetch_failed.html b/dom/worklet/tests/test_fetch_failed.html new file mode 100644 index 0000000000..b5d316805f --- /dev/null +++ b/dom/worklet/tests/test_fetch_failed.html @@ -0,0 +1,39 @@ + + + + Test fetch an child module script with an invalid uri for Worklet + + + + + + + + + diff --git a/dom/worklet/tests/test_import_with_cache.html b/dom/worklet/tests/test_import_with_cache.html new file mode 100644 index 0000000000..de1744f9cc --- /dev/null +++ b/dom/worklet/tests/test_import_with_cache.html @@ -0,0 +1,49 @@ + + + + Test for Worklet + + + + + + + + + diff --git a/dom/worklet/tests/test_paintWorklet.html b/dom/worklet/tests/test_paintWorklet.html new file mode 100644 index 0000000000..a02a2757fb --- /dev/null +++ b/dom/worklet/tests/test_paintWorklet.html @@ -0,0 +1,49 @@ + + + + Test for PaintWorklet + + + + + + + + + diff --git a/dom/worklet/tests/test_promise.html b/dom/worklet/tests/test_promise.html new file mode 100644 index 0000000000..8ea71af9a6 --- /dev/null +++ b/dom/worklet/tests/test_promise.html @@ -0,0 +1,57 @@ + + + + Test for promise in worklet + + + + + + + + + diff --git a/dom/worklet/tests/worklet_audioWorklet.js b/dom/worklet/tests/worklet_audioWorklet.js new file mode 100644 index 0000000000..fa916d4359 --- /dev/null +++ b/dom/worklet/tests/worklet_audioWorklet.js @@ -0,0 +1,16 @@ +class DummyProcessWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } +} + +// We need to pass a valid AudioWorkletProcessor here, otherwise, it will fail, +// and the console.log won't be executed +registerProcessor("sure!", DummyProcessWorkletProcessor); +console.log( + globalThis instanceof AudioWorkletGlobalScope ? "So far so good" : "error" +); diff --git a/dom/worklet/tests/worklet_audioWorklet_WASM.js b/dom/worklet/tests/worklet_audioWorklet_WASM.js new file mode 100644 index 0000000000..1215b4c8d0 --- /dev/null +++ b/dom/worklet/tests/worklet_audioWorklet_WASM.js @@ -0,0 +1,16 @@ +class WasmProcessWorkletProcessor extends AudioWorkletProcessor { + constructor(...args) { + super(...args); + this.port.onmessage = e => { + // Let's send it back. + this.port.postMessage(e.data); + }; + } + + process(inputs, outputs, parameters) { + // Do nothing, output silence + return true; + } +} + +registerProcessor("wasm", WasmProcessWorkletProcessor); diff --git a/dom/worklet/tests/worklet_audioWorklet_options.js b/dom/worklet/tests/worklet_audioWorklet_options.js new file mode 100644 index 0000000000..eb7a704234 --- /dev/null +++ b/dom/worklet/tests/worklet_audioWorklet_options.js @@ -0,0 +1,12 @@ +class OptionsProcessWorkletProcessor extends AudioWorkletProcessor { + constructor(...args) { + super(...args); + this.port.postMessage(args[0].processorOptions); + } + + process(inputs, outputs, parameters) { + return true; + } +} + +registerProcessor("options", OptionsProcessWorkletProcessor); diff --git a/dom/worklet/tests/worklet_console.js b/dom/worklet/tests/worklet_console.js new file mode 100644 index 0000000000..557beb1af2 --- /dev/null +++ b/dom/worklet/tests/worklet_console.js @@ -0,0 +1 @@ +console.log("Hello world from a worklet"); diff --git a/dom/worklet/tests/worklet_dump.js b/dom/worklet/tests/worklet_dump.js new file mode 100644 index 0000000000..439d13f700 --- /dev/null +++ b/dom/worklet/tests/worklet_dump.js @@ -0,0 +1 @@ +dump("Hello world from a worklet"); diff --git a/dom/worklet/tests/worklet_exception.js b/dom/worklet/tests/worklet_exception.js new file mode 100644 index 0000000000..f3b473756e --- /dev/null +++ b/dom/worklet/tests/worklet_exception.js @@ -0,0 +1 @@ +foobar(); diff --git a/dom/worklet/tests/worklet_paintWorklet.js b/dom/worklet/tests/worklet_paintWorklet.js new file mode 100644 index 0000000000..7cf5256e51 --- /dev/null +++ b/dom/worklet/tests/worklet_paintWorklet.js @@ -0,0 +1,5 @@ +// This should work for real... at some point. +registerPaint("sure!", () => {}); +console.log( + globalThis instanceof PaintWorkletGlobalScope ? "So far so good" : "error" +); diff --git a/dom/worklet/tests/worklet_promise.js b/dom/worklet/tests/worklet_promise.js new file mode 100644 index 0000000000..8c593fd001 --- /dev/null +++ b/dom/worklet/tests/worklet_promise.js @@ -0,0 +1,22 @@ +class WasmProcessWorkletProcessor extends AudioWorkletProcessor { + constructor(...args) { + super(...args); + this.port.onmessage = e => { + WebAssembly.compile(e.data).then( + m => { + this.port.postMessage(m); + }, + () => { + this.port.postMessage("error"); + } + ); + }; + } + + process(inputs, outputs, parameters) { + // Do nothing, output silence + return true; + } +} + +registerProcessor("promise", WasmProcessWorkletProcessor); diff --git a/dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js b/dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js new file mode 100644 index 0000000000..cddb9524ec --- /dev/null +++ b/dom/worklet/tests/worklet_test_audioWorkletGlobalScopeRegisterProcessor.js @@ -0,0 +1,384 @@ +// Define several classes. +class EmptyWorkletProcessor extends AudioWorkletProcessor {} + +class NoProcessWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } +} + +class BadDescriptorsWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return "A string"; + } +} + +class GoodDescriptorsWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "myParam", + defaultValue: 0.707, + }, + ]; + } +} + +class DummyProcessWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } +} + +class DescriptorsNoNameWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + defaultValue: 0.707, + }, + ]; + } +} + +class DescriptorsDefaultValueNotNumberWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + defaultValue: "test", + }, + ]; + } +} + +class DescriptorsMinValueNotNumberWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + minValue: "test", + }, + ]; + } +} + +class DescriptorsMaxValueNotNumberWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + maxValue: "test", + }, + ]; + } +} + +class DescriptorsDuplicatedNameWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + }, + { + name: "test", + }, + ]; + } +} + +class DescriptorsNotDictWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [42]; + } +} + +class DescriptorsOutOfRangeMinWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + defaultValue: 0, + minValue: 1, + maxValue: 2, + }, + ]; + } +} + +class DescriptorsOutOfRangeMaxWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + defaultValue: 3, + minValue: 1, + maxValue: 2, + }, + ]; + } +} + +class DescriptorsBadRangeMaxWorkletProcessor extends AudioWorkletProcessor { + constructor() { + super(); + } + + process() { + // Do nothing, output silence + } + + static get parameterDescriptors() { + return [ + { + name: "test", + defaultValue: 1.5, + minValue: 2, + maxValue: 1, + }, + ]; + } +} + +// Test not a constructor +// "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor is not a constructor." +try { + registerProcessor("sure!", () => {}); +} catch (e) { + console.log(e); +} + +// Test empty name +// "NotSupportedError: Argument 1 of AudioWorkletGlobalScope.registerProcessor should not be an empty string." +try { + registerProcessor("", EmptyWorkletProcessor); +} catch (e) { + console.log(e); +} + +// Test not an object +// "TypeError: Argument 2 of AudioWorkletGlobalScope.registerProcessor is not an object." +try { + registerProcessor("my-worklet-processor", ""); +} catch (e) { + console.log(e); +} + +// Test Empty class definition +registerProcessor("empty-worklet-processor", EmptyWorkletProcessor); + +// Test class with constructor but not process function +registerProcessor("no-worklet-processor", NoProcessWorkletProcessor); + +// Test class with parameterDescriptors being iterable, but the elements are not +// dictionaries. +// "TypeError: AudioWorkletGlobalScope.registerProcessor: Element 0 in parameterDescriptors can't be converted to a dictionary.", +try { + registerProcessor( + "bad-descriptors-worklet-processor", + BadDescriptorsWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// Test class with good parameterDescriptors +// No error expected here +registerProcessor( + "good-descriptors-worklet-processor", + GoodDescriptorsWorkletProcessor +); + +// Test class with constructor and process function +// No error expected here +registerProcessor("dummy-worklet-processor", DummyProcessWorkletProcessor); + +// Test class adding class with the same name twice +// "NotSupportedError: Operation is not supported: Argument 1 of AudioWorkletGlobalScope.registerProcessor is invalid: a class with the same name is already registered." +try { + registerProcessor("dummy-worklet-processor", DummyProcessWorkletProcessor); +} catch (e) { + console.log(e); +} + +// "name" is a mandatory field in descriptors +// "TypeError: Missing required 'name' member of AudioParamDescriptor." +try { + registerProcessor( + "descriptors-no-name-worklet-processor", + DescriptorsNoNameWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// "defaultValue" should be a number +// "TypeError: 'defaultValue' member of AudioParamDescriptor is not a finite floating-point value." +try { + registerProcessor( + "descriptors-default-value-not-number-worklet-processor", + DescriptorsDefaultValueNotNumberWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// "min" should be a number +// "TypeError: 'minValue' member of AudioParamDescriptor is not a finite floating-point value." +try { + registerProcessor( + "descriptors-min-value-not-number-worklet-processor", + DescriptorsMinValueNotNumberWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// "max" should be a number +// "TypeError: 'maxValue' member of AudioParamDescriptor is not a finite floating-point value." +try { + registerProcessor( + "descriptors-max-value-not-number-worklet-processor", + DescriptorsMaxValueNotNumberWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// Duplicated values are not allowed for "name" +// "NotSupportedError: Duplicated name \"test\" in parameterDescriptors" +try { + registerProcessor( + "descriptors-duplicated-name-worklet-processor", + DescriptorsDuplicatedNameWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// Descriptors' elements should be dictionnary +// "TypeError: Element 0 in parameterDescriptors can't be converted to a dictionary.", +try { + registerProcessor( + "descriptors-not-dict-worklet-processor", + DescriptorsNotDictWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// defaultValue value should be in range [minValue, maxValue]. defaultValue < minValue is not allowed +// "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.", +try { + registerProcessor( + "descriptors-out-of-range-min-worklet-processor", + DescriptorsOutOfRangeMinWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// defaultValue value should be in range [minValue, maxValue]. defaultValue > maxValue is not allowed +// "NotSupportedError: In parameterDescriptors, test defaultValue is out of the range defined by minValue and maxValue.", +try { + registerProcessor( + "descriptors-out-of-range-max-worklet-processor", + DescriptorsOutOfRangeMaxWorkletProcessor + ); +} catch (e) { + console.log(e); +} + +// We should have minValue < maxValue to define a valid range +// "NotSupportedError: In parameterDescriptors, test minValue should be smaller than maxValue.", +try { + registerProcessor( + "descriptors-bad-range-max-worklet-processor", + DescriptorsBadRangeMaxWorkletProcessor + ); +} catch (e) { + console.log(e); +} -- cgit v1.2.3