mirror of
https://github.com/servo/servo.git
synced 2025-09-14 08:58:21 +01:00
Update web-platform-tests to revision 7a6f5673ff5d146ca5c09c6a1b42b7706cfee328
This commit is contained in:
parent
e2fca1b228
commit
4787b28da3
261 changed files with 8195 additions and 4689 deletions
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
convolver-setBuffer-already-has-value.html
|
||||
</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/webaudio/resources/audit.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script id="layout-test-code">
|
||||
let audit = Audit.createTaskRunner();
|
||||
|
||||
audit.define('test', (task, should) => {
|
||||
let context = new AudioContext();
|
||||
let audioBuffer = new AudioBuffer(
|
||||
{numberOfChannels: 1, length: 1, sampleRate: context.sampleRate});
|
||||
let convolver = context.createConvolver();
|
||||
should(() => {
|
||||
convolver.buffer = null;
|
||||
}, 'Set buffer to null before set non-null').notThrow();
|
||||
|
||||
should(() => {
|
||||
convolver.buffer = audioBuffer;
|
||||
}, 'Set buffer first normally').notThrow();
|
||||
|
||||
should(() => {
|
||||
convolver.buffer = audioBuffer;
|
||||
}, 'Set buffer a second time').throw('InvalidStateError');
|
||||
|
||||
should(() => {
|
||||
convolver.buffer = null;
|
||||
}, 'Set buffer to null').notThrow();
|
||||
|
||||
should(() => {
|
||||
convolver.buffer = null;
|
||||
}, 'Set buffer to null again, to make sure').notThrow();
|
||||
|
||||
should(() => {
|
||||
convolver.buffer = audioBuffer;
|
||||
}, 'Set buffer to non-null to verify to throw an error')
|
||||
.throw('InvalidStateError');
|
||||
|
||||
task.done();
|
||||
});
|
||||
|
||||
audit.run();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue