Update web-platform-tests to revision abd18b3e018d25ed668d179c905b7869dca5e239

This commit is contained in:
WPT Sync Bot 2018-07-19 21:07:28 -04:00
parent 908a642063
commit 158f7eec0e
117 changed files with 2997 additions and 434 deletions

View file

@ -121,10 +121,10 @@
.notThrow();
should(() => {
buffer.copyFromChannel(null, 0);
}, '1: buffer.copyFromChannel(null, 0)').throw('TypeError');
}, '1: buffer.copyFromChannel(null, 0)').throw(TypeError);
should(() => {
buffer.copyFromChannel(context, 0);
}, '2: buffer.copyFromChannel(context, 0)').throw('TypeError');
}, '2: buffer.copyFromChannel(context, 0)').throw(TypeError);
should(() => {
buffer.copyFromChannel(x, -1);
}, '3: buffer.copyFromChannel(x, -1)').throw('IndexSizeError');
@ -156,14 +156,14 @@
buffer.copyFromChannel(shared_buffer, 0);
},
'8: buffer.copyFromChannel(SharedArrayBuffer view, 0)')
.throw('TypeError');
.throw(TypeError);
should(
() => {
buffer.copyFromChannel(shared_buffer, 0, 0);
},
'9: buffer.copyFromChannel(SharedArrayBuffer view, 0, 0)')
.throw('TypeError');
.throw(TypeError);
}
task.done();
@ -177,10 +177,10 @@
.exist();
should(() => {
buffer.copyToChannel(null, 0);
}, '0: buffer.copyToChannel(null, 0)').throw('TypeError');
}, '0: buffer.copyToChannel(null, 0)').throw(TypeError);
should(() => {
buffer.copyToChannel(context, 0);
}, '1: buffer.copyToChannel(context, 0)').throw('TypeError');
}, '1: buffer.copyToChannel(context, 0)').throw(TypeError);
should(() => {
buffer.copyToChannel(x, -1);
}, '2: buffer.copyToChannel(x, -1)').throw('IndexSizeError');
@ -211,14 +211,14 @@
buffer.copyToChannel(shared_buffer, 0);
},
'7: buffer.copyToChannel(SharedArrayBuffer view, 0)')
.throw('TypeError');
.throw(TypeError);
should(
() => {
buffer.copyToChannel(shared_buffer, 0, 0);
},
'8: buffer.copyToChannel(SharedArrayBuffer view, 0, 0)')
.throw('TypeError');
.throw(TypeError);
}
task.done();

View file

@ -24,13 +24,13 @@
audit.define('invalid constructor', (task, should) => {
should(() => {
new AudioBuffer();
}, 'new AudioBuffer()').throw('TypeError');
}, 'new AudioBuffer()').throw(TypeError);
should(() => {
new AudioBuffer(1);
}, 'new AudioBuffer(1)').throw('TypeError');
}, 'new AudioBuffer(1)').throw(TypeError);
should(() => {
new AudioBuffer(Date, 42);
}, 'new AudioBuffer(Date, 42)').throw('TypeError');
}, 'new AudioBuffer(Date, 42)').throw(TypeError);
task.done();
});
@ -42,19 +42,19 @@
// optional.
should(() => {
new AudioBuffer({});
}, 'buffer = new AudioBuffer({})').throw('TypeError');
}, 'buffer = new AudioBuffer({})').throw(TypeError);
should(() => {
new AudioBuffer({length: 1});
}, 'buffer = new AudioBuffer({length: 1})').throw('TypeError');
}, 'buffer = new AudioBuffer({length: 1})').throw(TypeError);
should(() => {
new AudioBuffer({sampleRate: 48000});
}, 'buffer = new AudioBuffer({sampleRate: 48000})').throw('TypeError');
}, 'buffer = new AudioBuffer({sampleRate: 48000})').throw(TypeError);
should(() => {
buffer = new AudioBuffer({numberOfChannels: 1});
}, 'buffer = new AudioBuffer({numberOfChannels: 1}').throw('TypeError');
}, 'buffer = new AudioBuffer({numberOfChannels: 1}').throw(TypeError);
// Length and sampleRate are required, but others are optional.
should(

View file

@ -17,15 +17,15 @@
let oscTypes = ['sine', 'square', 'sawtooth', 'triangle', 'custom'];
let audit = Audit.createTaskRunner();
audit.define('start/stop exceptions', (task, should) => {
// We're not going to render anything, so make it simple
let context = new OfflineAudioContext(1, 1, sampleRate);
let node = new AudioBufferSourceNode(context);
testStartStop(should, node, [
{args: [0, -1], errorType: 'RangeError'},
{args: [0, 0, -1], errorType: 'RangeError'}
{args: [0, -1], errorType: RangeError},
{args: [0, 0, -1], errorType: RangeError}
]);
task.done();
});

View file

@ -28,7 +28,7 @@
// Make sure we can't set to something which isn't an AudioBuffer.
should(function() {
source.buffer = 57;
}, 'source.buffer = 57').throw('TypeError');
}, 'source.buffer = 57').throw(TypeError);
// It's ok to set the buffer to null.
should(function() {

View file

@ -140,7 +140,7 @@
context = new AudioContext({'latencyHint': 'foo'})
},
'context = new AudioContext({\'latencyHint\': \'foo\'})')
.throw('TypeError');
.throw(TypeError);
// Verify that no extra options can be passed into the
// AudioContextOptions.
@ -149,7 +149,7 @@
context = new AudioContext('latencyHint')
},
'context = new AudioContext(\'latencyHint\')')
.throw('TypeError');
.throw(TypeError);
Promise.all(closingPromises).then(function() {
task.done();

View file

@ -46,11 +46,11 @@
// Try calling connect() method with illegal values.
should(
() => audioNode.connect(0, 0, 0), 'audioNode.connect(0, 0, 0)')
.throw('TypeError');
.throw(TypeError);
should(
() => audioNode.connect(null, 0, 0),
'audioNode.connect(null, 0, 0)')
.throw('TypeError');
.throw(TypeError);
should(
() => audioNode.connect(context.destination, 5, 0),
'audioNode.connect(context.destination, 5, 0)')
@ -77,7 +77,7 @@
should(
() => context3 = new AudioContext(1, 44100, 44100),
'context3 = new AudioContext(1, 44100, 44100)')
.throw('TypeError');
.throw(TypeError);
// Ensure it is an EventTarget
should(

View file

@ -45,7 +45,7 @@
let defaultFuncArg = (value) => [value, 1];
// Test the value parameter
doTests(should, gain, 'TypeError', nonFiniteValues, [
doTests(should, gain, TypeError, nonFiniteValues, [
{automationName: 'setValueAtTime', funcArg: defaultFuncArg}, {
automationName: 'linearRampToValueAtTime',
funcArg: defaultFuncArg
@ -75,7 +75,7 @@
let defaultFuncArg = (startTime) => [1, startTime];
// Test the time parameter
doTests(should, gain, 'TypeError', nonFiniteValues, [
doTests(should, gain, TypeError, nonFiniteValues, [
{automationName: 'setValueAtTime', funcArg: defaultFuncArg},
{
automationName: 'linearRampToValueAtTime',
@ -112,7 +112,7 @@
// contents of the array are not important.
let curve = new Float32Array(3);
doTests(should, gain, 'TypeError', nonFiniteValues, [
doTests(should, gain, TypeError, nonFiniteValues, [
{
automationName: 'setValueCurveAtTime',
funcArg: (startTime) => [curve, startTime, 1]
@ -121,7 +121,7 @@
// Non-finite values for the curve should signal an error
doTests(
should, gain, 'TypeError',
should, gain, TypeError,
[[1, 2, Infinity, 3], [1, NaN, 2, 3]], [{
automationName: 'setValueCurveAtTime',
funcArg: (c) => [c, 1, 1]
@ -144,7 +144,7 @@
// Test the time parameter
let curve = new Float32Array(3);
doTests(should, gain, 'RangeError', [-1], [
doTests(should, gain, RangeError, [-1], [
{automationName: 'setValueAtTime', funcArg: defaultFuncArg},
{
automationName: 'linearRampToValueAtTime',
@ -178,7 +178,7 @@
should(
() => gain.gain.setValueCurveAtTime(curve, 1, 0),
'gain.gain.setValueCurveAtTime(curve, 1, 0)')
.throw('RangeError');
.throw(RangeError);
task.done();
});
@ -191,7 +191,7 @@
(task, should) => {
let gain = context.createGain();
doTests(should, gain, 'RangeError', [0, -1e-100, 1e-100], [{
doTests(should, gain, RangeError, [0, -1e-100, 1e-100], [{
automationName: 'exponentialRampToValueAtTime',
funcArg: (value) => [value, 1]
}]);

View file

@ -68,7 +68,7 @@
.linearRampToValueAtTime(2.0, 1.0);
},
'Calling setValueAtTime() with a negative end time')
.throw('RangeError');
.throw(RangeError);
// The first operation succeeds but the second fails due to zero target
// value for the exponential ramp. Thus only the first should have
@ -79,7 +79,7 @@
0.0, 1.0);
},
'Calling exponentialRampToValueAtTime() with a zero target value')
.throw('RangeError');
.throw(RangeError);
osc.start();
osc.stop(1.0);

View file

@ -130,7 +130,7 @@
Float32Array.from([NaN, NaN]), time, 0.01);
},
'setValueCurveAtTime([NaN, NaN], ' + time + ', 0.01)')
.throw('TypeError');
.throw(TypeError);
should(
() => {
@ -138,7 +138,7 @@
Float32Array.from([1, Infinity]), time, 0.01);
},
'setValueCurveAtTime([1, Infinity], ' + time + ', 0.01)')
.throw('TypeError');
.throw(TypeError);
let d = context.createDelay();
// Check that we get warnings for out-of-range values and also throw for
@ -158,7 +158,7 @@
},
'delayTime.setValueCurveAtTime([1, 5, Infinity], ' + time +
', 0.01)')
.throw('TypeError');
.throw(TypeError);
// One last test that prints out lots of digits for the time.
time = Math.PI / 100;

View file

@ -116,7 +116,7 @@
should(
() => new AudioWorkletNode(context, 'dummy', options1),
'Creating AudioWorkletNode with channelCountMode "foobar"')
.throw('TypeError');
.throw(TypeError);
task.done();
});
@ -138,7 +138,7 @@
should(
() => new AudioWorkletNode(context, 'dummy', options1),
'Creating AudioWorkletNode with channelCountMode "foobar"')
.throw('TypeError');
.throw(TypeError);
task.done();
});

View file

@ -73,7 +73,7 @@
'null, ' +
'new Float32Array(1), ' +
'new Float32Array(1))')
.throw('TypeError');
.throw(TypeError);
should(
function() {
@ -85,7 +85,7 @@
'new Float32Array(1), ' +
'null, ' +
'new Float32Array(1))')
.throw('TypeError');
.throw(TypeError);
should(
function() {
@ -97,7 +97,7 @@
'new Float32Array(1), ' +
'new Float32Array(1), ' +
'null)')
.throw('TypeError');
.throw(TypeError);
should(
function() {

View file

@ -32,11 +32,15 @@
bufferSource.buffer = toneBuffer;
window.context = context;
should(() => context.createDelay(180)).throw();
should(() => context.createDelay(0)).throw();
should(() => context.createDelay(-1)).throw();
should(() => context.createDelay(NaN)).throw();
;
should(() => context.createDelay(180)).throw("NotSupportedError",
"Delay length cannot be 180 seconds or more");
should(() => context.createDelay(0)).throw("NotSupportedError",
"Delay length cannot be 0");
should(() => context.createDelay(-1)).throw("NotSupportedError",
"Delay length cannot be negative");
should(() => context.createDelay(NaN)).throw(TypeError,
"Delay length cannot be a NaN");
let delay = context.createDelay(179);
delay.delayTime.value = delayTimeSeconds;
window.delay = delay;

View file

@ -99,7 +99,7 @@
{
testAttribute: 'channelCountMode',
testValue: 'foobar',
expectedErrorType: 'TypeError'
expectedErrorType: TypeError
},
// Test channel interpretation
{
@ -113,7 +113,7 @@
{
testAttribute: 'channelInterpretation',
testValue: 'foobar',
expectedErrorType: 'TypeError'
expectedErrorType: TypeError
}
];

View file

@ -57,7 +57,7 @@
node = new IIRFilterNode(context, options);
},
'node = new IIRFilterNode(, ' + JSON.stringify(options) + ')')
.throw('TypeError');
.throw(TypeError);
options = {feedforward: [1, 0.5]};
should(
@ -65,7 +65,7 @@
node = new IIRFilterNode(context, options);
},
'node = new IIRFilterNode(c, ' + JSON.stringify(options) + ')')
.throw('TypeError');
.throw(TypeError);
task.done();
});

View file

@ -51,17 +51,17 @@
should(function() {
// Two args are required.
context.createIIRFilter();
}, 'createIIRFilter()').throw('TypeError');
}, 'createIIRFilter()').throw(TypeError);
should(function() {
// Two args are required.
context.createIIRFilter(new Float32Array(1));
}, 'createIIRFilter(new Float32Array(1))').throw('TypeError');
}, 'createIIRFilter(new Float32Array(1))').throw(TypeError);
should(function() {
// null is not valid
context.createIIRFilter(null, null);
}, 'createIIRFilter(null, null)').throw('TypeError');
}, 'createIIRFilter(null, null)').throw(TypeError);
should(function() {
// There has to be at least one coefficient.
@ -127,17 +127,17 @@
should(function() {
// Feedback coefficients must be finite.
context.createIIRFilter([1], [1, Infinity, NaN]);
}, 'createIIRFilter([1], [1, NaN, Infinity])').throw('TypeError');
}, 'createIIRFilter([1], [1, NaN, Infinity])').throw(TypeError);
should(function() {
// Feedforward coefficients must be finite.
context.createIIRFilter([1, Infinity, NaN], [1]);
}, 'createIIRFilter([1, NaN, Infinity], [1])').throw('TypeError');
}, 'createIIRFilter([1, NaN, Infinity], [1])').throw(TypeError);
should(function() {
// Test that random junk in the array is converted to NaN.
context.createIIRFilter([1, 'abc', []], [1]);
}, 'createIIRFilter([1, \'abc\', []], [1])').throw('TypeError');
}, 'createIIRFilter([1, \'abc\', []], [1])').throw(TypeError);
task.done();
});
@ -155,7 +155,7 @@
null, new Float32Array(1), new Float32Array(1));
},
'getFrequencyResponse(null, new Float32Array(1), new Float32Array(1))')
.throw('TypeError');
.throw(TypeError);
should(
function() {
@ -164,7 +164,7 @@
new Float32Array(1), null, new Float32Array(1));
},
'getFrequencyResponse(new Float32Array(1), null, new Float32Array(1))')
.throw('TypeError');
.throw(TypeError);
should(
function() {
@ -173,7 +173,7 @@
new Float32Array(1), new Float32Array(1), null);
},
'getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)')
.throw('TypeError');
.throw(TypeError);
should(
function() {

View file

@ -23,12 +23,12 @@
// First and only arg should be a dictionary.
should(() => {
new OfflineAudioContext(3);
}, 'new OfflineAudioContext(3)').throw('TypeError');
}, 'new OfflineAudioContext(3)').throw(TypeError);
// Constructor needs 1 or 3 args, so 2 should throw.
should(() => {
new OfflineAudioContext(3, 42);
}, 'new OfflineAudioContext(3, 42)').throw('TypeError');
}, 'new OfflineAudioContext(3, 42)').throw(TypeError);
// Valid constructor
should(() => {
@ -63,12 +63,12 @@
// No args should throw
should(() => {
new OfflineAudioContext();
}, 'new OfflineAudioContext()').throw('TypeError');
}, 'new OfflineAudioContext()').throw(TypeError);
// Empty OfflineAudioContextOptions should throw
should(() => {
new OfflineAudioContext({});
}, 'new OfflineAudioContext({})').throw('TypeError');
}, 'new OfflineAudioContext({})').throw(TypeError);
let options = {length: 42};
// sampleRate is required.
@ -77,7 +77,7 @@
new OfflineAudioContext(options);
},
'new OfflineAudioContext(' + JSON.stringify(options) + ')')
.throw('TypeError');
.throw(TypeError);
options = {sampleRate: 12345};
// length is required.
@ -86,7 +86,7 @@
new OfflineAudioContext(options);
},
'new OfflineAudioContext(' + JSON.stringify(options) + ')')
.throw('TypeError');
.throw(TypeError);
// Valid constructor. Verify that the resulting context has the
// correct values.

View file

@ -161,7 +161,7 @@
node = new PannerNode(context, options);
},
'new PannerNode(c, " + JSON.stringify(options) + ")')
.throw('TypeError');
.throw(TypeError);
// Test channelInterpretation.
options = {channelInterpretation: 'speakers'};
@ -190,7 +190,7 @@
node = new PannerNode(context, options);
},
'new PannerNode(c, ' + JSON.stringify(options) + ')')
.throw('TypeError');
.throw(TypeError);
task.done();
});

View file

@ -65,7 +65,7 @@
tests: [
{value: 'clamped-max'}, {value: 'explicit'},
{value: 'max', error: 'NotSupportedError'},
{value: 'foobar', error: 'TypeError'}
{value: 'foobar', error: TypeError}
]
},
{
@ -74,7 +74,7 @@
attribute: 'channelInterpretation',
tests: [
{value: 'speakers'}, {value: 'discrete'},
{value: 'foobar', error: 'TypeError'}
{value: 'foobar', error: TypeError}
]
}].forEach(entry => {
entry.tests.forEach(testItem => {