worklet-test-utils.js (381B)
1 // Returns a reference to a worklet object corresponding to a given type. 2 function get_worklet(type) { 3 if (type == 'animation') 4 return CSS.animationWorklet; 5 if (type == 'layout') 6 return CSS.layoutWorklet; 7 if (type == 'paint') 8 return CSS.paintWorklet; 9 if (type == 'audio') 10 return new OfflineAudioContext(2,44100*40,44100).audioWorklet; 11 return undefined; 12 }