summaryrefslogtreecommitdiffstats
path: root/base/idletimer_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/idletimer_unittest.cc')
-rw-r--r--base/idletimer_unittest.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/base/idletimer_unittest.cc b/base/idletimer_unittest.cc
index 613adad..ea53854 100644
--- a/base/idletimer_unittest.cc
+++ b/base/idletimer_unittest.cc
@@ -8,6 +8,9 @@
namespace {
class IdleTimerTest : public testing::Test {
+ private:
+ // IdleTimer requires a UI message loop on the current thread.
+ MessageLoopForUI message_loop_;
};
};
@@ -63,7 +66,7 @@ class ResetIdleTask : public Task {
// A non-repeating idle timer will fire once on idle, and
// then will not fire again unless it goes non-idle first.
-TEST(IdleTimerTest, NoRepeatIdle) {
+TEST_F(IdleTimerTest, NoRepeatIdle) {
// Create an IdleTimer, which should fire once after 100ms.
// Create a Quit timer which will fire after 1s.
// Verify that we fired exactly once.
@@ -80,7 +83,7 @@ TEST(IdleTimerTest, NoRepeatIdle) {
delete t;
}
-TEST(IdleTimerTest, NoRepeatFlipIdleOnce) {
+TEST_F(IdleTimerTest, NoRepeatFlipIdleOnce) {
// Create an IdleTimer, which should fire once after 100ms.
// Create a Quit timer which will fire after 1s.
// Create a timer to reset once, idle after 500ms.
@@ -101,7 +104,7 @@ TEST(IdleTimerTest, NoRepeatFlipIdleOnce) {
delete t2;
}
-TEST(IdleTimerTest, NoRepeatNotIdle) {
+TEST_F(IdleTimerTest, NoRepeatNotIdle) {
// Create an IdleTimer, which should fire once after 100ms.
// Create a Quit timer which will fire after 1s.
// Create a timer to reset idle every 50ms.
@@ -129,7 +132,7 @@ TEST(IdleTimerTest, NoRepeatNotIdle) {
// as it has been idle. So, if the machine remains idle, it will continue
// firing over and over.
-TEST(IdleTimerTest, Repeat) {
+TEST_F(IdleTimerTest, Repeat) {
// Create an IdleTimer, which should fire repeatedly after 100ms.
// Create a Quit timer which will fire after 1.05s.
// Verify that we fired 10 times.
@@ -149,7 +152,7 @@ TEST(IdleTimerTest, Repeat) {
delete t;
}
-TEST(IdleTimerTest, RepeatIdleReset) {
+TEST_F(IdleTimerTest, RepeatIdleReset) {
// Create an IdleTimer, which should fire repeatedly after 100ms.
// Create a Quit timer which will fire after 1s.
// Create a reset timer, which fires after 550ms
@@ -173,7 +176,7 @@ TEST(IdleTimerTest, RepeatIdleReset) {
delete t2;
}
-TEST(IdleTimerTest, RepeatNotIdle) {
+TEST_F(IdleTimerTest, RepeatNotIdle) {
// Create an IdleTimer, which should fire repeatedly after 100ms.
// Create a Quit timer which will fire after 1s.
// Create a timer to reset idle every 50ms.