fix failing tests to use same (corrected) currentTime as OneShotSource

This commit is contained in:
Marcel Blum 2021-10-20 22:30:59 -04:00
parent 6decb02d9a
commit 6700a3c5f5
2 changed files with 2 additions and 2 deletions

View file

@ -152,7 +152,7 @@ describe("ToneConstantSource", () => {
expect(source.getStateAtTime(0)).to.equal("stopped");
expect(source.getStateAtTime(currentTime)).to.equal("started");
setTimeout(() => {
currentTime = source.context.currentTime;
currentTime = source.now();
source.stop(0);
expect(source.getStateAtTime(currentTime + 0.01)).to.equal("stopped");
source.dispose();

View file

@ -191,7 +191,7 @@ describe("ToneOscillatorNode", () => {
expect(osc.getStateAtTime(0)).to.equal("stopped");
expect(osc.getStateAtTime(currentTime)).to.equal("started");
setTimeout(() => {
currentTime = osc.context.currentTime;
currentTime = osc.now();
osc.stop(0);
expect(osc.getStateAtTime(currentTime + 0.01)).to.equal("stopped");
osc.dispose();