cks(func);
    });
  }

  test('runIdleTaskWhileIdle', function() {
    withMockedScheduling(function() {
      tr.b.forceAllPendingTasksToRunForTest();

      let rafRan = false;
      tr.b.requestAnimationFrame(function() {
        rafRan = true;
      });
      let idleRan = false;
      tr.b.requestIdleCallback(function() {
        idleRan = true;
      });
      fakeNow = 0;
      tr.b.forcePendingRAFTasksToRun(fakeNow);
      assert.isFalse(idleRan);
      assert.isTrue(rafRan);
      tr.b.forcePendin