unction() {
  var whenIdle = window.requestIdleCallback ? window.requestIdleCallback : function(fn) { setTimeout(fn, 16); };

  test('Queued functions are cancelable.', function(done) {
    var callback = sinon.spy();
    var asyncRef = idlePeriod.run(callback);
    idlePeriod.cancel(asyncRef);
    whenIdle(function() {
      assert.isFalse(callback.called);
      done();
    });
  });

  test('Multiple instances of the same queued function are cancelable.', function(done) {
    var callback = sinon.spy();
