diff --git a/tests/unit-test-time-fixture.hpp b/tests/unit-test-time-fixture.hpp
new file mode 100644
index 0000000..03421f8
--- /dev/null
+++ b/tests/unit-test-time-fixture.hpp
@@ -0,0 +1,68 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_TESTS_UNIT_TESTS_UNIT_TEST_TIME_FIXTURE_HPP
+#define NDN_TESTS_UNIT_TESTS_UNIT_TEST_TIME_FIXTURE_HPP
+
+#include <ndn-cxx/util/time-unit-test-clock.hpp>
+#include <boost/asio.hpp>
+
+namespace ndn {
+namespace tests {
+
+class UnitTestTimeFixture
+{
+public:
+  UnitTestTimeFixture()
+    : steadyClock(make_shared<time::UnitTestSteadyClock>())
+    , systemClock(make_shared<time::UnitTestSystemClock>())
+  {
+    time::setCustomClocks(steadyClock, systemClock);
+  }
+
+  ~UnitTestTimeFixture()
+  {
+    time::setCustomClocks(nullptr, nullptr);
+  }
+
+  void
+  advanceClocks(const time::nanoseconds& tick, size_t nTicks = 1)
+  {
+    for (size_t i = 0; i < nTicks; ++i) {
+      steadyClock->advance(tick);
+      systemClock->advance(tick);
+
+      if (io.stopped())
+        io.reset();
+      io.poll();
+    }
+  }
+
+public:
+  shared_ptr<time::UnitTestSteadyClock> steadyClock;
+  shared_ptr<time::UnitTestSystemClock> systemClock;
+  boost::asio::io_service io;
+};
+
+} // namespace tests
+} // namespace ndn
+
+#endif // NDN_TESTS_UNIT_TESTS_UNIT_TEST_TIME_FIXTURE_HPP
diff --git a/tests/unit-tests/test-interest-table.cpp b/tests/unit-tests/test-interest-table.cpp
index 6f9e97a..531de09 100644
--- a/tests/unit-tests/test-interest-table.cpp
+++ b/tests/unit-tests/test-interest-table.cpp
@@ -19,19 +19,18 @@
 
 #include "interest-table.hpp"
 
-#include <ndn-cxx/util/scheduler.hpp>
 #include <unistd.h>
 
+#include "../unit-test-time-fixture.hpp"
 #include "boost-test.hpp"
 
 namespace chronosync {
 namespace test {
 
-class InterestTableFixture
+class InterestTableFixture : public ndn::tests::UnitTestTimeFixture
 {
 public:
   InterestTableFixture()
-    : scheduler(io)
   {
     uint8_t origin[4] = {0x01, 0x02, 0x03, 0x04};
     Name prefix("/test/prefix");
@@ -63,18 +62,6 @@
     table.insert(interest, digest);
   }
 
-  void
-  check(InterestTable& table, size_t size)
-  {
-    BOOST_CHECK_EQUAL(table.size(), size);
-  }
-
-  void
-  terminate()
-  {
-    io.stop();
-  }
-
   shared_ptr<Interest> interest1;
   ndn::ConstBufferPtr digest1;
 
@@ -83,9 +70,6 @@
 
   shared_ptr<Interest> interest3;
   ndn::ConstBufferPtr digest3;
-
-  boost::asio::io_service io;
-  ndn::Scheduler scheduler;
 };
 
 BOOST_FIXTURE_TEST_SUITE(InterestTableTest, InterestTableFixture)
@@ -137,38 +121,25 @@
 {
   InterestTable table(io);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(50),
-                          ndn::bind(&InterestTableFixture::insert, this,
-                                    ndn::ref(table), interest1, digest1));
+  insert(ndn::ref(table), interest1, digest1);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(150),
-                          ndn::bind(&InterestTableFixture::insert, this,
-                                    ndn::ref(table), interest2, digest2));
+  advanceClocks(ndn::time::milliseconds(10), 10);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(150),
-                          ndn::bind(&InterestTableFixture::insert, this,
-                                    ndn::ref(table), interest3, digest3));
+  insert(ndn::ref(table), interest2, digest2);
+  insert(ndn::ref(table), interest3, digest3);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(200),
-                          ndn::bind(&InterestTableFixture::insert, this,
-                                    ndn::ref(table), interest2, digest2));
+  advanceClocks(ndn::time::milliseconds(10), 5);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(220),
-                          ndn::bind(&InterestTableFixture::check, this,
-                                    ndn::ref(table), 2));
+  insert(ndn::ref(table), interest2, digest2);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(270),
-                          ndn::bind(&InterestTableFixture::check, this,
-                                    ndn::ref(table), 1));
+  advanceClocks(ndn::time::milliseconds(10), 2);
+  BOOST_CHECK_EQUAL(table.size(), 2);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(420),
-                          ndn::bind(&InterestTableFixture::check, this,
-                                    ndn::ref(table), 0));
+  advanceClocks(ndn::time::milliseconds(10), 5);
+  BOOST_CHECK_EQUAL(table.size(), 1);
 
-  scheduler.scheduleEvent(ndn::time::milliseconds(500),
-                          ndn::bind(&InterestTableFixture::terminate, this));
-
-  io.run();
+  advanceClocks(ndn::time::milliseconds(10), 15);
+  BOOST_CHECK_EQUAL(table.size(), 0);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
