Files
ladybird/Tests/LibWeb/Text/input/WebAudio/OscillatorNode.html
Shannon Booth b48ba823b9 LibWeb: Implement AudioNode.context
This is just a simple getter which returns the audio context that
created this audio node.
2024-05-04 14:01:38 +02:00

20 lines
586 B
HTML

<script src="../include.js"></script>
<script>
test(() => {
const audioContext = new OfflineAudioContext(1, 5000, 44100);
const oscillator = audioContext.createOscillator();
// Check prototype
let prototype = Object.getPrototypeOf(oscillator);
while (prototype) {
println(prototype.constructor.name);
prototype = Object.getPrototypeOf(prototype);
}
// Context getter
println(`context: '${oscillator.context}, is same as original: ${audioContext === oscillator.context}`);
});
</script>