mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
skipping test in firefox
This commit is contained in:
parent
7f9cda9db0
commit
f3d651272c
2 changed files with 16 additions and 13 deletions
|
@ -2,7 +2,7 @@ import { expect } from "chai";
|
|||
import { BasicTests } from "test/helper/Basic";
|
||||
import { CompareToFile } from "test/helper/CompareToFile";
|
||||
import { Offline } from "test/helper/Offline";
|
||||
import { ONLINE_TESTING } from "test/helper/Supports";
|
||||
import { OFFLINE_BUFFERSOURCE_ONENDED, ONLINE_TESTING } from "test/helper/Supports";
|
||||
import { ToneAudioBuffer } from "Tone/core/context/ToneAudioBuffer";
|
||||
import { getContext } from "Tone/core/Global";
|
||||
import { ToneBufferSource } from "./ToneBufferSource";
|
||||
|
@ -270,19 +270,21 @@ describe("ToneBufferSource", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("schedules the onended callback when the buffer is done without scheduling stop", () => {
|
||||
if (OFFLINE_BUFFERSOURCE_ONENDED) {
|
||||
it("schedules the onended callback when the buffer is done without scheduling stop", () => {
|
||||
|
||||
let wasInvoked = false;
|
||||
return Offline(() => {
|
||||
const player = new ToneBufferSource(buffer).toDestination();
|
||||
player.start(0);
|
||||
player.onended = () => {
|
||||
wasInvoked = true;
|
||||
};
|
||||
}, buffer.duration * 2).then(() => {
|
||||
expect(wasInvoked).to.equal(true);
|
||||
let wasInvoked = false;
|
||||
return Offline(() => {
|
||||
const player = new ToneBufferSource(buffer).toDestination();
|
||||
player.start(0);
|
||||
player.onended = () => {
|
||||
wasInvoked = true;
|
||||
};
|
||||
}, buffer.duration * 1.1).then(() => {
|
||||
expect(wasInvoked).to.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import { UAParser } from "ua-parser-js";
|
||||
|
||||
const parsed = new UAParser().getBrowser();
|
||||
|
@ -39,3 +38,5 @@ export const ONLINE_TESTING = isntVersion("Chrome", 71);
|
|||
export const AUDIO_CONTEXT_CLOSE_RESOLVES = isnt("Firefox") && isnt("Safari", 10);
|
||||
// if it supports gUM testing
|
||||
export const GET_USER_MEDIA = isnt("Safari");
|
||||
// firefox does not invoke AudioBufferSourceNode.onended in the offline context
|
||||
export const OFFLINE_BUFFERSOURCE_ONENDED = isnt("Firefox");
|
||||
|
|
Loading…
Reference in a new issue