Bug 982541 - Update OscillatorNode.{start, stop} to have the first argument optional and default to zero. r=ehsan

This commit is contained in:
Paul Adenot 2014-03-13 14:51:41 +08:00
parent 7fd21d981d
commit ede84d6b72
3 changed files with 19 additions and 2 deletions

View File

@ -49,6 +49,13 @@ addLoadEvent(function() {
osc.setPeriodicWave(context.createPeriodicWave(real, imag));
is(osc.type, "custom", "Failed to set custom waveform");
expectNoException(function() {
osc.start();
});
expectNoException(function() {
osc.stop();
});
SimpleTest.finish();
});

View File

@ -12,6 +12,16 @@ function expectException(func, exceptionCode) {
ok(threw, "The exception was thrown");
}
function expectNoException(func) {
var threw = false;
try {
func();
} catch (ex) {
threw = true;
}
ok(!threw, "An exception was not thrown");
}
function expectTypeError(func) {
var threw = false;
try {

View File

@ -30,9 +30,9 @@ interface OscillatorNode : AudioNode {
readonly attribute AudioParam detune; // in Cents
[Throws]
void start(double when);
void start(optional double when = 0);
[Throws]
void stop(double when);
void stop(optional double when = 0);
void setPeriodicWave(PeriodicWave periodicWave);
attribute EventHandler onended;