mirror of
https://github.com/servo/servo.git
synced 2025-09-11 23:48:21 +01:00
Update web-platform-tests to revision 7c50c216081d6ea3c9afe553ee7b64534020a1b2
This commit is contained in:
parent
5063ac465b
commit
f9ee2396ab
254 changed files with 2043 additions and 1285 deletions
|
@ -341,6 +341,77 @@
|
|||
task.done();
|
||||
});
|
||||
|
||||
audit.define('curve overlap', (task, should) => {
|
||||
let context =
|
||||
new OfflineAudioContext(1, testDurationFrames, sampleRate);
|
||||
let g = context.createGain();
|
||||
let startTime = 5;
|
||||
let startTimeLater = 10;
|
||||
let startTimeEarlier = 2.5;
|
||||
let curveDuration = 10;
|
||||
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.
|
||||
should(
|
||||
() => {
|
||||
g.gain.setValueCurveAtTime(curve, startTime, curveDuration);
|
||||
},
|
||||
`g.gain.setValueCurveAtTime([${curve}], ${startTime}, ${curveDuration})`)
|
||||
.notThrow();
|
||||
|
||||
// Check that an exception is thrown when trying to overlap two curves,
|
||||
// in various ways
|
||||
|
||||
// Same start time and end time (curve exactly overlapping)
|
||||
should(
|
||||
() => {
|
||||
g.gain.setValueCurveAtTime(curve, startTime, curveDuration);
|
||||
},
|
||||
`second g.gain.setValueCurveAtTime([${curve}], ${startTime}, ${curveDuration})`)
|
||||
.throw('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
|
||||
should(
|
||||
() => {
|
||||
g.gain.setValueCurveAtTime(curve, startTimeEarlier, curveDuration);
|
||||
},
|
||||
`g.gain.setValueCurveAtTime([${curve}], ${startTimeEarlier}, ${curveDuration})`)
|
||||
.throw('NotSupportedError');
|
||||
// Start time after the start time of the other curve, but earlier than
|
||||
// its end.
|
||||
should(
|
||||
() => {
|
||||
g.gain.setValueCurveAtTime(curve, startTimeLater, curveDuration);
|
||||
},
|
||||
`g.gain.setValueCurveAtTime([${curve}], ${startTimeLater}, ${curveDuration})`)
|
||||
.throw('NotSupportedError');
|
||||
// Setting an event exactly at the end of the curve should work.
|
||||
should(
|
||||
() => {
|
||||
g.gain.setValueAtTime(1.0, startTime + curveDuration);
|
||||
},
|
||||
`g.gain.setValueAtTime(1.0, ${startTime + curveDuration})`)
|
||||
.notThrow();
|
||||
|
||||
task.done();
|
||||
});
|
||||
|
||||
audit.define('curve lengths', (task, should) => {
|
||||
let context =
|
||||
new OfflineAudioContext(1, testDurationFrames, sampleRate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue