2019-01-27 18:05:20 +00:00
|
|
|
import Test from "helper/Test";
|
|
|
|
import TransportRepeatEvent from "Tone/core/TransportRepeatEvent";
|
|
|
|
import Tone from "Tone/core/Tone";
|
|
|
|
import Offline from "helper/Offline";
|
|
|
|
import PassAudio from "helper/PassAudio";
|
|
|
|
import Oscillator from "Tone/source/Oscillator";
|
|
|
|
import AudioNode from "Tone/core/AudioNode";
|
2017-09-04 20:01:57 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
describe("TransportRepeatEvent", function(){
|
2017-09-04 20:01:57 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("can be created and disposed", function(){
|
|
|
|
return Offline(function(Transport){
|
|
|
|
var event = new TransportRepeatEvent(Transport, {
|
|
|
|
"time" : 0
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
event.dispose();
|
|
|
|
Test.wasDisposed(event);
|
|
|
|
});
|
|
|
|
});
|
2017-09-04 20:01:57 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("generates a unique event ID", function(){
|
|
|
|
return Offline(function(Transport){
|
|
|
|
var event = new TransportRepeatEvent(Transport, {
|
|
|
|
"time" : 0
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
expect(event.id).to.be.a("number");
|
|
|
|
event.dispose();
|
|
|
|
});
|
|
|
|
});
|
2017-09-04 20:01:57 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("is removed from the Transport when disposed", function(){
|
|
|
|
return Offline(function(Transport){
|
|
|
|
var event = new TransportRepeatEvent(Transport, {
|
|
|
|
"time" : 0
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
event.dispose();
|
|
|
|
expect(Transport._timeline.length).to.equal(0);
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2017-09-04 20:01:57 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|