Commit 8f4cc864 authored by rtoy's avatar rtoy Committed by Commit bot

Convert mediastreamaudiodestination to new Audit

Manually convert to use new Audit.

BUG=704967
TEST=constructor/mediastreamaudiodestination.html

Review-Url: https://codereview.chromium.org/2835943004
Cr-Commit-Position: refs/heads/master@{#468139}
parent d623d073
...@@ -5,68 +5,56 @@ ...@@ -5,68 +5,56 @@
<script src="../../resources/testharness.js"></script> <script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script> <script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script> <script src="../resources/audit-util.js"></script>
<script src="../resources/audio-testing.js"></script> <script src="../resources/audit.js"></script>
<script src="audionodeoptions.js"></script> <script src="new-audionodeoptions.js"></script>
</head> </head>
<body> <body>
<script> <script>
var context = new AudioContext(); let context = new AudioContext();
var audit = Audit.createTaskRunner(); let audit = Audit.createTaskRunner();
audit.defineTask("invalid constructor", function (taskDone) { audit.define('initialize', (task, should) => {
var node; context = initializeContext(should);
var success = true; task.done();
success = Should("new MediaStreamAudioDestinationNode()",
function () {
node = new MediaStreamAudioDestinationNode();
})
.throw("TypeError");
success = Should("new MediaStreamAudioDestinationNode(1)",
function () {
node = new MediaStreamAudioDestinationNode(1)
})
.throw("TypeError") && success;;
success = Should("new MediaStreamAudioDestinationNode(context, 42)",
function () {
node = new MediaStreamAudioDestinationNode(context, 42)
})
.throw("TypeError") && success;;
taskDone();
}); });
audit.defineTask("default constructor", function (taskDone) { audit.define('invalid constructor', (task, should) => {
var node; testInvalidConstructor(
var success; should, 'MediaStreamAudioDestinationNode', context);
task.done();
});
success = Should("new MediaStreamAudioDestinationNode(context)", audit.define('default constructor', (task, should) => {
function () { let prefix = 'node0';
node = new MediaStreamAudioDestinationNode(context); let node = testDefaultConstructor(
}).notThrow() && success; should, 'MediaStreamAudioDestinationNode', context, {
prefix: prefix,
numberOfInputs: 1,
numberOfOutputs: 1,
channelCount: 2,
channelCountMode: 'max',
channelInterpretation: 'speakers'
});
success = Should("node instanceof MediaStreamAudioDestinationNode", testDefaultAttributes(should, node, prefix, []);
node instanceof MediaStreamAudioDestinationNode)
.beEqualTo(true) && success;
success = Should("node.channelCount", node.channelCount)
.beEqualTo(2) && success;
taskDone(); task.done();
}); });
audit.defineTask("test AudioNodeOptions", function (taskDone) { audit.define('test AudioNodeOptions', (task, should) => {
testAudioNodeOptions(context, "MediaStreamAudioDestinationNode", { testAudioNodeOptions(
expectedChannelCount: { should, context, 'MediaStreamAudioDestinationNode', {
channelCount: {
// An arbitrary but valid, non-default count for this node. // An arbitrary but valid, non-default count for this node.
value: 7 value: 7
} }
}); });
taskDone(); task.done();
}); });
audit.runTasks(); audit.run();
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment