Bug 1488630 [wpt PR 12837] - Fix cases where setValueCurveAtTime was not throwing errors, a=testonly

Automatic update from web-platform-testsFix cases where setValueCurveAtTime was not throwing errors

Catch more cases where we should throw errors if a new
setValueCurveAtTime overlaps an existing setValueCurveAtTime event.

Add some additional tests for more coverage.  Also, some of the
existing tests were using incorrect expected error types so fix them.

Remove test expectations file since we pass now.

Bug: 879767
Test: the-audioparam-interface/audioparam-setValueCurve-exceptions.html
Change-Id: I14a7a7c9ab36955b7e084ca9148495860b661111
Reviewed-on: https://chromium-review.googlesource.com/1205719
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589059}

--

wpt-commits: 9f63e45e03bb836556466ba43082c4a1c464b14e
wpt-pr: 12837
This commit is contained in:
moz-wptsync-bot 2018-09-07 13:20:07 +00:00
parent 38013d478a
commit 497f8bab64

View File

@ -297,16 +297,7 @@
let curveDurationShorter = 5;
let curve = [1, 2, 3];
// Having an event that ends at time t and then starting a ramp at time
// t should work.
should(
() => {
g.gain.linearRampToValueAtTime(1.0, startTime);
},
`g.gain.linearRampToValueAtTime(1.0, ${startTime})`)
.notThrow();
// An initial curve event, starting from the end of the linear ramp.
// An initial curve event
should(
() => {
g.gain.setValueCurveAtTime(curve, startTime, curveDuration);
@ -323,21 +314,21 @@
g.gain.setValueCurveAtTime(curve, startTime, curveDuration);
},
`second g.gain.setValueCurveAtTime([${curve}], ${startTime}, ${curveDuration})`)
.throw('NotSupportedError');
.throw(DOMException, 'NotSupportedError');
// Same start time, shorter end time
should(
() => {
g.gain.setValueCurveAtTime(curve, startTime, curveDurationShorter);
},
`g.gain.setValueCurveAtTime([${curve}], ${startTime}, ${curveDurationShorter})`)
.throw('NotSupportedError');
// Earlier start time, end time after the start time of an another curve
.throw(DOMException, 'NotSupportedError');
// Earlier start time, end time after the start time an another curve
should(
() => {
g.gain.setValueCurveAtTime(curve, startTimeEarlier, curveDuration);
},
`g.gain.setValueCurveAtTime([${curve}], ${startTimeEarlier}, ${curveDuration})`)
.throw('NotSupportedError');
.throw(DOMException, 'NotSupportedError');
// Start time after the start time of the other curve, but earlier than
// its end.
should(
@ -345,7 +336,22 @@
g.gain.setValueCurveAtTime(curve, startTimeLater, curveDuration);
},
`g.gain.setValueCurveAtTime([${curve}], ${startTimeLater}, ${curveDuration})`)
.throw('NotSupportedError');
.throw(DOMException, 'NotSupportedError');
// New event wholly contained inside existing event
should(
() => {
g.gain.setValueCurveAtTime(curve, startTime + 1, curveDuration - 1);
},
`g.gain.setValueCurveAtTime([${curve}], ${startTime+1}, ${curveDuration-1})`)
.throw(DOMException, 'NotSupportedError');
// Old event completely contained inside new event
should(
() => {
g.gain.setValueCurveAtTime(curve, startTime - 1, curveDuration + 1);
},
`g.gain.setValueCurveAtTime([${curve}], ${startTime-1}, ${curveDuration+1})`)
.throw(DOMException, 'NotSupportedError');
// Setting an event exactly at the end of the curve should work.
should(
() => {