зеркало из https://github.com/mozilla/gecko-dev.git
Bug 982541 - Update OscillatorNode.{start, stop} to have the first argument optional and default to zero. r=ehsan
This commit is contained in:
Родитель
3fb8a3bb48
Коммит
8d09c94c90
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче