blob: e61e9aa2d4d0012bb2ee8354dba27e75b9db7678 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>
Test Constructor: MediaStreamAudioSource
</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script>
<script src="../resources/audit.js"></script>
<script src="audionodeoptions.js"></script>
</head>
<body>
<script id="layout-test-code">
let context = new AudioContext();
let audit = Audit.createTaskRunner();
audit.define('initialize', (task, should) => {
context = initializeContext(should);
task.done();
});
audit.define('invalid constructor', (task, should) => {
testInvalidConstructor(should, 'MediaStreamAudioSourceNode', context);
task.done();
});
audit.define('constructor options', (task, should) => {
let node;
let options = {mediaStream: new MediaStream()};
// We throw because the mediaStream has no tracks. But otherwise the
// constructor worked.
should(
() => {
node = new MediaStreamAudioSourceNode(context, options);
},
'node = new MediaStreamAudioSourceNode(context, ' +
JSON.stringify(options) + ')')
.throw('InvalidStateError');
task.done();
});
audit.run();
</script>
</body>
</html>