Bug 1465316 [wpt PR 11239] - [WebAudio] throw an error when buffer has been already set., a=testonly

Automatic update from web-platform-tests[WebAudio] throw an error when buffer has been already set.

should throw an InvalidStateError when buffer has been already
set in ConvolverNode

Bug: 709656
Change-Id: Ia0826f9ffa2e180da1311f4cded8ff7fe5461147
Reviewed-on: https://chromium-review.googlesource.com/1077713
Reviewed-by: Raymond Toy <rtoy@chromium.org>
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Cr-Commit-Position: refs/heads/master@{#570767}

--

wpt-commits: b44c26506446c1d95c644786254774255a96ffc1
wpt-pr: 11239
This commit is contained in:
Hwanseung Lee 2018-07-06 23:07:46 +00:00 коммит произвёл James Graham
Родитель 8ebdcafa1c
Коммит 24aaa44b5f
2 изменённых файлов: 61 добавлений и 0 удалений

Просмотреть файл

@ -382147,6 +382147,12 @@
{}
]
],
"webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html": [
[
"/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html",
{}
]
],
"webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-null.html": [
[
"/webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-null.html",
@ -624686,6 +624692,10 @@
"8fac11e0ecfa8bfb9b49d68d0792793f44e94ad4",
"testharness"
],
"webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-already-has-value.html": [
"673bc5a4ff452dd83bd9209b33f40ccdadd0cf43",
"testharness"
],
"webaudio/the-audio-api/the-convolvernode-interface/convolver-setBuffer-null.html": [
"f32f5acdf031b1a2b32bc37324b105d1df7c5fdb",
"testharness"

Просмотреть файл

@ -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>