('Cancelling functions queued to run before the next paint', function() {

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

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